1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
#!/usr/bin/make -f
SHELL+= -e
D := $(CURDIR)/debian/inn2
B := $(CURDIR)/build
include /usr/share/dpkg/architecture.mk
ifeq ($(DEB_HOST_ARCH_BITS),32)
configure_flags = --enable-largefiles
endif
# the upstream source needs to be copied in the build directory
src_files := $(shell find . -maxdepth 1 -not -name build -and \
-not -name . -and -not -name debian -and -not -name .pc \
-and -not -name .git \
)
##############################################################################
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@ --builddirectory=$B
override_dh_auto_clean:
rm -rf $B
override_dh_autoreconf:
# do not run libtoolize because support/ltmain.sh has been customized
LIBTOOLIZE=true \
dh_autoreconf
override_dh_auto_configure:
mkdir -p $B
for dir in $(src_files); do [ -e $B/$$dir ] || cp -ldpR $$dir $B; done
CONFIG_SHELL=/bin/sh \
BZIP2=/bin/bzip2 \
GZIP=/bin/gzip \
PERL=/usr/bin/perl \
PYTHON=/usr/bin/python3 \
ac_cv_path_AWK=awk \
ac_cv_prog_AWK=awk \
ac_cv_path_CAT=cat \
ac_cv_path_EGREP=egrep \
ac_cv_path_OPENSSL=openssl \
ac_cv_path_SED=sed \
ac_cv_path_SORT=sort \
ac_cv_path_UUSTAT=uustat \
ac_cv_path_UUX=uux \
ac_cv_path_GPGV=/usr/bin/gpgv \
ac_cv_path_GPG=/usr/bin/gpg1 \
ac_cv_path_PATH_GETFTP=wget \
dh_auto_configure -- \
--enable-uucp-rnews \
--with-canlock \
--with-perl \
--with-python \
--with-openssl \
--with-sqlite3 \
--prefix=/usr/lib/news \
--libdir=/usr/lib/news \
--mandir=/usr/share/man \
--sysconfdir=/etc/news \
--includedir=/usr/include \
--with-db-dir=/var/lib/news \
--with-filter-dir=/etc/news/filter \
--with-log-dir=/var/log/news \
--with-run-dir=/run/news \
--with-spool-dir=/var/spool/news \
--with-tmp-dir=/var/spool/news/incoming/tmp \
--with-http-dir=/var/www/inn \
--with-libperl-dir=/usr/share/perl5 \
--with-bdb=/usr \
--with-krb5=/usr \
--with-sasl=/usr \
--with-sendmail=/usr/sbin/sendmail \
--with-zlib=/usr \
$(configure_flags)
override_dh_auto_test:
C_TAP_VERBOSE=1 \
dh_auto_test
override_dh_auto_install:
dh_auto_install --destdir=$D
override_dh_install:
dh_movefiles --sourcedir=$(subst $(CURDIR)/,,$D)
# move back to the main package these man pages
mv $D-dev/usr/share/man/man3/libinn_uwildmat.3 \
$D-dev/usr/share/man/man3/*.3pm \
$D/usr/share/man/man3/
# remove assorted crap and
# make sure we don't ship active, active.times, newsgroups in place!
rm -rf $D/usr/lib/news/bin/simpleftp $D/usr/share/man/man1/simpleftp.1\
$D/usr/lib/news/doc/ $D/usr/include/ $D/etc/news/motd.* \
$D/usr/lib/news/share/ \
$D/usr/lib/news/*.la \
$D/etc/news/filter/*.tcl \
$D/var/lib/news/* $D/run/ $D/var/www/
# compatibility symlink for nnrpd-ssl which was removed in 2.5.2-1
ln -s nnrpd $D/usr/lib/news/bin/nnrpd-ssl
install -m 755 extra/buildinnkeyring extra/ginpaths2 \
$D/usr/lib/news/bin/
perl -i -pe 's/^(pathhost:\s+).+/$${1}server.example.net/' \
$D-inews/etc/news/inn.conf
cp extra/active extra/newsgroups $D/usr/lib/news/examples/
mv $D/etc/news/filter/*.py $D/usr/share/doc/inn2/examples/filter/
override_dh_installdocs:
dh_installdocs --sourcedir=$B
override_dh_installchangelogs:
if [ -e ChangeLog ]; then \
dh_installchangelogs ChangeLog ; \
else \
dh_installchangelogs ; \
fi
override_dh_installinit:
dh_installinit --noscripts --init-script=inn2
override_dh_installsystemd:
dh_installsystemd --no-stop-on-upgrade
override_dh_fixperms:
dh_fixperms -Xusr/lib/news/bin/innbind -Xusr/lib/news/bin/rnews
# these files may contain passwords
chown root:news \
$D-inews/etc/news/passwd.nntp \
$D/etc/news/incoming.conf \
$D/etc/news/innfeed.conf \
$D/etc/news/inn-radius.conf \
$D/etc/news/inn-secrets.conf
chmod 640 $D-inews/etc/news/passwd.nntp \
$D/etc/news/incoming.conf \
$D/etc/news/innfeed.conf \
$D/etc/news/inn-radius.conf \
$D/etc/news/inn-secrets.conf
chmod -x $D/usr/lib/news/bin/control/*.pl $D/etc/news/*.local
chmod u+w,o+r $D/usr/lib/news/bin/innbind
chown -R news:news $D/var/spool/news/ $D/var/lib/news/ \
$D/var/log/news/
chmod -R g+w $D/var/spool/news/ $D/var/lib/news/ \
$D/var/log/news/
override_dh_makeshlibs:
dh_makeshlibs --noscripts
override_dh_shlibdeps:
dh_shlibdeps --exclude=/usr/lib/news/bin/auth/passwd/auth_krb5 -- \
-dSuggests $D/usr/lib/news/bin/auth/passwd/auth_krb5 \
-dDepends
override_dh_gencontrol:
dh_gencontrol -- \
-VPERLAPI=$$(perl -MConfig -e 'printf("perlapi-%s", $$Config{debian_abi} || $$Config{version})')
|