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