comparison debian/rules @ 301:3b5b7f3fd71f noffle

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