| 
301
 | 
     1 #!/usr/bin/make -f
 | 
| 
486
 | 
     2 # $Id: rules 633 2004-11-28 09:46:27Z godisch $
 | 
| 
301
 | 
     3 
 | 
| 
 | 
     4 BUILDDIR = debian/noffle
 | 
| 
 | 
     5 DEBDIR   = $(BUILDDIR)/DEBIAN
 | 
| 
 | 
     6 DOCDIR   = $(BUILDDIR)/usr/share/doc/noffle
 | 
| 
 | 
     7 SPOOLDIR = $(BUILDDIR)/var/spool/noffle
 | 
| 
 | 
     8 MANDIR   = $(BUILDDIR)/usr/share/man
 | 
| 
 | 
     9 testdir  = test -f src/noffle.c -a -f debian/rules
 | 
| 
 | 
    10 testroot = test x`whoami` = xroot
 | 
| 
 | 
    11 
 | 
| 
 | 
    12 # FOR AUTOCONF 2.13 ONLY
 | 
| 
 | 
    13 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 | 
| 
 | 
    14 	CONFFLAGS += $(DEB_HOST_GNU_TYPE)
 | 
| 
 | 
    15 else
 | 
| 
 | 
    16 	CONFFLAGS += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_HOST_GNU_TYPE)
 | 
| 
 | 
    17 endif
 | 
| 
 | 
    18 
 | 
| 
 | 
    19 # FOR AUTOCONF 2.52 AND NEWER ONLY
 | 
| 
 | 
    20 #ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 | 
| 
 | 
    21 #	CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
 | 
| 
 | 
    22 #else
 | 
| 
 | 
    23 #	CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 | 
| 
 | 
    24 #endif
 | 
| 
 | 
    25 
 | 
| 
 | 
    26 CFLAGS = -Wall -g
 | 
| 
 | 
    27 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 | 
| 
 | 
    28 	CFLAGS += -O0
 | 
| 
 | 
    29 else
 | 
| 
 | 
    30 	CFLAGS += -O2
 | 
| 
 | 
    31 endif
 | 
| 
 | 
    32 export CFLAGS
 | 
| 
 | 
    33 
 | 
| 
 | 
    34 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 | 
| 
 | 
    35 	STRIP_FLAG =
 | 
| 
 | 
    36 else
 | 
| 
 | 
    37 	STRIP_FLAG = -s
 | 
| 
 | 
    38 endif
 | 
| 
 | 
    39 
 | 
| 
 | 
    40 clean:
 | 
| 
 | 
    41 	$(testdir)
 | 
| 
369
 | 
    42 	rm -f configure-stamp build-stamp debian/files debian/substvars
 | 
| 
301
 | 
    43 	-$(MAKE) -i distclean
 | 
| 
369
 | 
    44 	rm -rf debian/noffle
 | 
| 
394
 | 
    45 	-cat `ls -r debian/patches/*.diff` /dev/null | patch -RENtp1 -r debian/rejected --no-backup-if-mismatch
 | 
| 
369
 | 
    46 	rm -f debian/rejected
 | 
| 
301
 | 
    47 
 | 
| 
369
 | 
    48 configure-stamp: configure
 | 
| 
301
 | 
    49 	$(testdir)
 | 
| 
369
 | 
    50 	-cat debian/patches/*.diff | patch -Ntp1 -r debian/rejected --no-backup-if-mismatch
 | 
| 
308
 | 
    51 	./configure $(CONFFLAGS) --prefix=/usr --mandir=/usr/share/man \
 | 
| 
 | 
    52 		--with-configfile=/etc/news/noffle.conf \
 | 
| 
 | 
    53 		--with-usersfile=/etc/news/noffle.users --enable-auth=no
 | 
| 
301
 | 
    54 	touch configure-stamp
 | 
| 
 | 
    55 
 | 
| 
 | 
    56 build: build-stamp
 | 
| 
369
 | 
    57 build-stamp: configure-stamp
 | 
| 
301
 | 
    58 	$(testdir)
 | 
| 
 | 
    59 	$(MAKE)
 | 
| 
 | 
    60 	touch build-stamp
 | 
| 
 | 
    61 
 | 
| 
 | 
    62 binary: binary-arch
 | 
| 
 | 
    63 
 | 
| 
 | 
    64 binary-indep:
 | 
| 
 | 
    65 
 | 
| 
 | 
    66 binary-arch: build
 | 
| 
 | 
    67 	$(testdir)
 | 
| 
 | 
    68 	$(testroot)
 | 
| 
369
 | 
    69 	rm -rf debian/noffle
 | 
| 
301
 | 
    70 
 | 
| 
 | 
    71 	# installing binaries
 | 
| 
 | 
    72 	install -o news -g news -m 6755 -D $(STRIP_FLAG) src/noffle $(BUILDDIR)/usr/bin/noffle
 | 
| 
308
 | 
    73 	install -o root -g root -m 0755 -D debian/noffle-cronfetch $(BUILDDIR)/usr/sbin/noffle-cronfetch
 | 
| 
301
 | 
    74 
 | 
| 
 | 
    75 	# installing locking directory
 | 
| 
308
 | 
    76 	install -d -o root -g root -m 0755 $(BUILDDIR)/var/lock
 | 
| 
 | 
    77 	install -d -o news -g news -m 2755 $(BUILDDIR)/var/lock/noffle
 | 
| 
301
 | 
    78 
 | 
| 
 | 
    79 	# installing spool directories
 | 
| 
308
 | 
    80 	install -d -o root -g root -m 0755 $(BUILDDIR)/var/spool
 | 
| 
 | 
    81 	install -d -o news -g news -m 2755 $(SPOOLDIR)/data $(SPOOLDIR)/outgoing $(SPOOLDIR)/overview $(SPOOLDIR)/requested
 | 
| 
301
 | 
    82 	ln -s ../../lock/noffle $(SPOOLDIR)/lock
 | 
| 
 | 
    83 	chown news:news $(SPOOLDIR)/lock
 | 
| 
 | 
    84 
 | 
| 
 | 
    85 	# installing shared files
 | 
| 
308
 | 
    86 	install -D -o root -g root -m 0644 debian/linda        $(BUILDDIR)/usr/share/linda/overrides/noffle
 | 
| 
 | 
    87 	install -D -o root -g root -m 0644 debian/lintian      $(BUILDDIR)/usr/share/lintian/overrides/noffle
 | 
| 
 | 
    88 	install -D -o root -g root -m 0644 debian/conf.debian  $(BUILDDIR)/usr/share/noffle/conf.debian
 | 
| 
 | 
    89 	install -D -o root -g root -m 0644 noffle.conf.example $(BUILDDIR)/usr/share/noffle/noffle.conf
 | 
| 
 | 
    90 	install -D -o root -g root -m 0644 debian/slrn.sl      $(BUILDDIR)/usr/share/slrn/macros/noffle.sl
 | 
| 
 | 
    91 	install -D -o root -g root -m 0644 debian/gnus.el      $(BUILDDIR)/usr/share/emacs/site-lisp/gnus/noffle.el
 | 
| 
301
 | 
    92 
 | 
| 
 | 
    93 	# installing manuals
 | 
| 
308
 | 
    94 	install -d -o root -g root -m 0755 $(MANDIR)/man1 $(MANDIR)/man5 $(MANDIR)/man8
 | 
| 
 | 
    95 	sed 's@/etc/noffle\.conf@/etc/news/noffle.conf@g' docs/noffle.1      > $(MANDIR)/man1/noffle.1
 | 
| 
301
 | 
    96 	sed 's@/etc/noffle\.conf@/etc/news/noffle.conf@g' docs/noffle.conf.5 > $(MANDIR)/man5/noffle.conf.5
 | 
| 
 | 
    97 	chown root:root $(MANDIR)/man1/noffle.1 $(MANDIR)/man5/noffle.conf.5
 | 
| 
308
 | 
    98 	chmod 0644      $(MANDIR)/man1/noffle.1 $(MANDIR)/man5/noffle.conf.5
 | 
| 
 | 
    99 	install    -o root -g root -m 0644 debian/noffle-cronfetch.8 $(MANDIR)/man8
 | 
| 
394
 | 
   100 	find $(MANDIR) -type f -print0 | xargs -0 gzip -9n
 | 
| 
301
 | 
   101 
 | 
| 
 | 
   102 	# installing documentation
 | 
| 
323
 | 
   103 	install -D -o root -g root -m 0644 ChangeLog        $(DOCDIR)/changelog
 | 
| 
 | 
   104 	install -D -o root -g root -m 0644 debian/changelog $(DOCDIR)/changelog.Debian
 | 
| 
 | 
   105 	install    -o root -g root -m 0644 debian/copyright debian/README.Debian AUTHORS NEWS TODO docs/FAQ docs/INTERNALS docs/NOTES $(DOCDIR)
 | 
| 
301
 | 
   106 	ln -s ../../noffle $(DOCDIR)/examples
 | 
| 
327
 | 
   107 	install -D -o root -g root -m 0644 debian/xinetd    $(DOCDIR)/examples/xinetd.conf
 | 
| 
394
 | 
   108 	find $(DOCDIR) -type f \( -size +8 -o -name 'changelog*' \) -print0 | xargs -0 gzip -9n
 | 
| 
301
 | 
   109 
 | 
| 
 | 
   110 	# installing config files
 | 
| 
308
 | 
   111 	install -d -o root -g root -m 0755 $(BUILDDIR)/etc/news $(BUILDDIR)/etc/default
 | 
| 
 | 
   112 	install -D -o root -g root -m 0644 debian/cron.d     $(BUILDDIR)/etc/cron.d/noffle
 | 
| 
 | 
   113 	install -D -o root -g root -m 0755 debian/cron.daily $(BUILDDIR)/etc/cron.daily/noffle
 | 
| 
 | 
   114 	install -D -o root -g root -m 0755 debian/init       $(BUILDDIR)/etc/init.d/noffle
 | 
| 
 | 
   115 	install -D -o root -g root -m 0644 debian/logcheck   $(BUILDDIR)/etc/logcheck/ignore.d.paranoid/noffle
 | 
| 
 | 
   116 	install -D -o root -g root -m 0644 debian/logcheck   $(BUILDDIR)/etc/logcheck/ignore.d.server/noffle
 | 
| 
 | 
   117 	install -D -o root -g root -m 0644 debian/logcheck   $(BUILDDIR)/etc/logcheck/ignore.d.workstation/noffle
 | 
| 
326
 | 
   118 	install -D -o root -g root -m 0755 debian/ip-up      $(BUILDDIR)/etc/ppp/ip-up.d/noffle
 | 
| 
 | 
   119 	install -D -o root -g root -m 0755 debian/ip-down    $(BUILDDIR)/etc/ppp/ip-down.d/noffle
 | 
| 
301
 | 
   120 
 | 
| 
 | 
   121 	# installing packaging information
 | 
| 
308
 | 
   122 	install -d -o root -g root -m 0755 $(DEBDIR)
 | 
| 
323
 | 
   123 	install    -o root -g root -m 0644 debian/control $(DEBDIR)
 | 
| 
 | 
   124 	install    -o root -g root -m 0755 debian/config debian/preinst debian/postinst debian/prerm debian/postrm $(DEBDIR)
 | 
| 
432
 | 
   125 	cd $(BUILDDIR) && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums
 | 
| 
 | 
   126 	cd $(BUILDDIR) && find ./etc -type f | cut -c 2- > DEBIAN/conffiles
 | 
| 
338
 | 
   127 	po2debconf debian/templates > $(DEBDIR)/templates
 | 
| 
301
 | 
   128 	chown root:root $(DEBDIR)/md5sums $(DEBDIR)/conffiles $(DEBDIR)/templates
 | 
| 
308
 | 
   129 	chmod 0644      $(DEBDIR)/md5sums $(DEBDIR)/conffiles $(DEBDIR)/templates
 | 
| 
301
 | 
   130 
 | 
| 
 | 
   131 	# building Debian package
 | 
| 
 | 
   132 	dpkg-shlibdeps $(BUILDDIR)/usr/bin/noffle
 | 
| 
 | 
   133 	dpkg-gencontrol -isp -pnoffle -P$(BUILDDIR)
 | 
| 
486
 | 
   134 	chmod 0644 $(BUILDDIR)/DEBIAN/control
 | 
| 
301
 | 
   135 	dpkg --build $(BUILDDIR) ..
 | 
| 
 | 
   136 	# binary target finished
 | 
| 
 | 
   137 
 | 
| 
369
 | 
   138 .PHONY: clean build binary binary-indep binary-arch
 |