4 QUILT_STAMPFN := .stamp-patched
5 include /usr/share/quilt/quilt.make
7 D-std := $(CURDIR)/debian/inn2
8 D-lfs := $(CURDIR)/debian/inn2-lfs
10 B = $(CURDIR)/build-$*
12 ##############################################################################
13 # this code deals with building a second inn2-lfs package from the same
14 # source, but only on 32 bit architectures
15 # Ideally new future 32 bit architectures should not bother with inn2-lfs
16 # and just enable LFS by default.
18 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
19 ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),amd64 ia64 ppc64 s390x))
22 else ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),armel))
23 # 32 bit LFS std package
25 std_configure_flags = --enable-largefiles
27 # 32 bit std package and 32 bit LFS lfs package
29 lfs_configure_flags = --enable-largefiles
32 std_dh_clean_opts = -pinn2 -pinn2-inews -p inn2-dev
33 lfs_dh_clean_opts = -pinn2-lfs
34 std_dh_movefiles_opts = -pinn2 -pinn2-inews -p inn2-dev
35 lfs_dh_movefiles_opts = -pinn2-lfs -pinn2-lfs-inews -p inn2-lfs-dev
38 no_package := --no-package=inn2-lfs
41 # the upstream source needs to be copied in the flavor-specific build dirs
42 src_files := $(shell find . -maxdepth 1 \
43 -not -name . -and -not -name debian -and -not -name .pc \
44 -and -not -name 'build-*' -and -not -name '.stamp-*')
46 ##############################################################################
47 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
48 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
49 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
50 configure_flags += --build $(DEB_HOST_GNU_TYPE)
52 configure_flags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
56 rm -rf .stamp-* build-*
57 [ ! -f Makefile.global ] || $(MAKE) distclean
58 # delete packages which are not in control but are built anyway
59 rm -rf debian/inn2-lfs-dev/ debian/inn2-lfs-inews/
60 # delete the cloned debhelper configuration and logs
61 find debian -maxdepth 1 -name 'inn2-lfs*' -not -type d -print0 \
62 | xargs --no-run-if-empty -0 rm
65 configure: $(addprefix .stamp-configure-, $(FLAVORS))
66 .stamp-configure-%: $(QUILT_STAMPFN)
69 for dir in $(src_files); do cp -ldpR $$dir $B; done
71 _PATH_PERL=/usr/bin/perl \
72 ac_cv_path__PATH_AWK=awk \
73 ac_cv_path__PATH_EGREP=egrep \
74 ac_cv_path__PATH_SED=sed \
75 ac_cv_path__PATH_SORT=sort \
76 ac_cv_path__PATH_UUX=uux \
77 ac_cv_path_PATH_GPGV=/usr/bin/gpgv \
78 ac_cv_path_GETFTP=wget \
79 ac_cv_search_dbm_open=-ldb \
80 LDFLAGS="-Wl,--as-needed $(LDFLAGS)" \
84 --prefix=/usr/lib/news \
85 --mandir=/usr/share/man \
86 --includedir=/usr/include/inn \
87 --with-db-dir=/var/lib/news \
88 --with-etc-dir=/etc/news \
89 --with-filter-dir=/etc/news/filter \
90 --with-lib-dir=/usr/lib/news \
91 --with-log-dir=/var/log/news \
92 --with-run-dir=/var/run/news \
93 --with-spool-dir=/var/spool/news \
94 --with-tmp-dir=/var/spool/news/incoming/tmp \
95 --with-berkeleydb=/usr \
96 --with-kerberos=/usr \
97 --with-sendmail=/usr/sbin/sendmail \
98 $($*_configure_flags) $(configure_flags)
100 mkdir ssl/ ssl/nnrpd/ && \
102 ln -s ../Makefile.global ../include ../storage ../history . && \
103 cd nnrpd/ && ln -s ../../nnrpd/* .
106 build: $(addprefix .stamp-build-, $(FLAVORS))
107 .stamp-build-%: .stamp-configure-%
110 cd $B/ssl/nnrpd/ && $(MAKE) \
111 SSLLIB='-L/usr/lib -lssl -lcrypto -ldl' SSLINC='-DHAVE_SSL=1'
114 install1-%: .stamp-build-%
117 dh_clean -k $($*_dh_clean_opts)
119 cd $B && $(MAKE) install DESTDIR=$D
120 sh -e extra/dh_cloneconf inn2 inn2-lfs
122 dh_movefiles $($*_dh_movefiles_opts) --sourcedir=$(subst $(CURDIR)/,,$D)
125 mv $D-dev/usr/share/man/man3/uwildmat.3 $D/usr/share/man/man3/
127 # remove assorted crap and
128 # make sure we don't ship active, active.times, newsgroups in place!
129 cd $D/etc/news/filter && rm -f *.py *.tcl
130 rm -rf $D/usr/lib/news/bin/simpleftp $D/usr/share/man/man1/simpleftp.1\
131 $D/usr/lib/news/doc/ $D/var/lib/news/* \
134 mv $D/usr/share/man/man1/startinnfeed.1 \
135 $D/usr/share/man/man8/startinnfeed.8
137 cp $B/ssl/nnrpd/nnrpd $D/usr/lib/news/bin/nnrpd-ssl
138 install -m 755 extra/buildinnkeyring extra/ginpaths2 \
140 install -m 755 contrib/showtoken.in $D/usr/lib/news/bin/showtoken
141 install -m 755 extra/bunbatch $D-inews/usr/lib/news/bin/rnews.libexec/
143 install -m 644 extra/send-uucp.cf extra/sasl.conf $D/etc/news/
145 mkdir $D/var/log/news/path
147 install2: $(addprefix install1-, $(FLAVORS))
149 dh_installchangelogs NEWS
152 dh_installinit --noscripts --init-script=inn2
157 -Xusr/lib/news/bin/inndstart -Xusr/lib/news/bin/startinnfeed
158 # some files are not writeable when installed by make install
162 chown root:news $D-inews/etc/news/passwd.nntp
163 chmod 640 $D-inews/etc/news/passwd.nntp
165 chmod -x $D/usr/lib/news/bin/control/*.pl
167 $D/usr/lib/news/bin/inndstart \
168 $D/usr/lib/news/bin/startinnfeed
170 chown news:uucp $D-inews/usr/lib/news/bin/rnews
171 chmod 4755 $D-inews/usr/lib/news/bin/rnews
173 chown -R news:news $D/var/spool/news/ $D/var/lib/news/ \
174 $D/var/run/news/ $D/var/log/news/
175 chmod -R g+w $D/var/spool/news/ $D/var/lib/news/ \
176 $D/var/run/news/ $D/var/log/news/
178 install4-std: install3-std
180 # lfs-specific: rename some files installed by debhelper
181 install4-lfs: install3-lfs
182 for file in /etc/logcheck/ignore.d.server/inn2 /etc/logcheck/violations.ignore.d/inn2 /etc/cron.d/inn2; do \
183 mv $(D-lfs)$$file-lfs $(D-lfs)$$file; \
186 install5: $(addprefix install4-, $(FLAVORS))
190 dh_gencontrol $(no_package) -- \
191 -VPERLAPI=$$(perl -MConfig -e 'print "perlapi-$$Config{version}"')
192 dh_builddeb $(no_package)
194 binary-arch: install5
198 .PHONY: clean configure build binary-arch binary install%