| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 12 |
include /usr/share/dpkg/default.mk |
| 13 |
|
| 14 |
|
| 15 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 16 |
export _FILE_OFFSET_BITS=64 |
| 17 |
export _TIME_BITS=64 |
| 18 |
|
| 19 |
|
| 20 |
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git |
| 21 |
|
| 22 |
export DOCPKG=cyrus-doc |
| 23 |
export TMPPKG := $(CURDIR)/debian/tmp |
| 24 |
export DOCDIR := $(CURDIR)/debian/$(DOCPKG)/usr/share/doc/$(DOCPKG) |
| 25 |
|
| 26 |
export DEB_CFLAGS_MAINT_APPEND = -Wall -Wextra -g -fno-strict-aliasing -pipe $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2) |
| 27 |
PERL_LDDLFLAGS := $(shell perl -MConfig -e 'print $$Config{lddlflags}') |
| 28 |
export PERL_MM_OPT = INSTALLDIRS="vendor" OPTIMIZE="$(CFLAGS) $(CPPFLAGS)" LDDLFLAGS="$(PERL_LDDLFLAGS) $(LDFLAGS)" |
| 29 |
|
| 30 |
include /usr/share/dpkg/architecture.mk |
| 31 |
|
| 32 |
|
| 33 |
EXTRA_IDENT := Debian-$(DEB_VERSION) |
| 34 |
|
| 35 |
|
| 36 |
export BDB_VERSION ?= $(shell LC_ALL=C dpkg-query -l 'libdb[45].[0-9]-dev' | grep ^ii | sed -e 's|.*\s\libdb\([45]\.[0-9]\)-dev\s.*|\1|') |
| 37 |
DBENGINE := BerkeleyDB$(BDB_VERSION) |
| 38 |
|
| 39 |
CONFFLAGS = |
| 40 |
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) |
| 41 |
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) |
| 42 |
else |
| 43 |
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
| 44 |
endif |
| 45 |
|
| 46 |
MAN1 := imtest installsieve lmtptest mupdatetest nntptest \ |
| 47 |
pop3test sieveshell sivtest smtptest httptest \ |
| 48 |
dav_reconstruct synctest |
| 49 |
|
| 50 |
MAN8 := master reconstruct quota deliver \ |
| 51 |
mbpath ctl_mboxlist ctl_deliver ctl_cyrusdb squatter \ |
| 52 |
tls_prune ipurge cvt_cyrusdb chk_cyrus arbitron \ |
| 53 |
cyr_expire unexpunge sync_client sync_reset cyr_synclog \ |
| 54 |
cyr_dbtool cyr_df ctl_zoneinfo cyr_deny cyr_info \ |
| 55 |
fetchnews fud httpd idled imapd lmtpd mbexamine nntpd \ |
| 56 |
notifyd pop3d smmapd sync_server timsieved \ |
| 57 |
cyr_buildinfo mbtool restore backupd \ |
| 58 |
cvt_xlist_specialuse cyr_ls cyr_userseen cyradm cyrdump \ |
| 59 |
lmtpproxyd mupdate pop3proxyd promstatsd proxyd ptdump \ |
| 60 |
ptexpire ptloader relocate_by_id sievec sieved |
| 61 |
|
| 62 |
%: |
| 63 |
dh $@ |
| 64 |
|
| 65 |
override_dh_auto_configure: |
| 66 |
dh_auto_configure -- \ |
| 67 |
$(CONFFLAGS) \ |
| 68 |
--with-extraident=$(EXTRA_IDENT) \ |
| 69 |
--includedir=/usr/include \ |
| 70 |
--datadir=/usr/share/cyrus \ |
| 71 |
--sharedstatedir=/usr/share/cyrus \ |
| 72 |
--localstatedir=/var/lib/cyrus \ |
| 73 |
--libexecdir=/usr/lib/cyrus/bin \ |
| 74 |
--bindir=/usr/lib/cyrus/bin \ |
| 75 |
--sbindir=/usr/lib/cyrus/bin \ |
| 76 |
--disable-silent-rules \ |
| 77 |
--disable-pcre \ |
| 78 |
--enable-autocreate \ |
| 79 |
--enable-idled \ |
| 80 |
--enable-nntp \ |
| 81 |
--enable-murder \ |
| 82 |
--enable-http \ |
| 83 |
--enable-jmap \ |
| 84 |
--enable-pcre2 \ |
| 85 |
--enable-replication \ |
| 86 |
--enable-xapian \ |
| 87 |
--enable-backup \ |
| 88 |
--enable-calalarmd \ |
| 89 |
--enable-unit-tests \ |
| 90 |
--enable-gssapi="/usr" \ |
| 91 |
--with-cyrus-user=cyrus --with-cyrus-group=mail \ |
| 92 |
--with-pgsql \ |
| 93 |
--with-pgsql-incdir=/usr/include/postgresql \ |
| 94 |
--with-lock=fcntl \ |
| 95 |
--with-ldap \ |
| 96 |
--with-krb \ |
| 97 |
--with-krbimpl=mit \ |
| 98 |
--without-krbdes \ |
| 99 |
--with-openssl \ |
| 100 |
--with-zlib \ |
| 101 |
--with-libcap \ |
| 102 |
--with-pidfile=/run/cyrus-master.pid \ |
| 103 |
--with-com_err="" \ |
| 104 |
--with-syslogfacility=MAIL \ |
| 105 |
--with-gss_impl=mit \ |
| 106 |
--with-sasl \ |
| 107 |
--with-perl=/usr/bin/perl |
| 108 |
echo 'To build this package, configure was called as follows:' \ |
| 109 |
> debian/README.configure-options |
| 110 |
grep '^ac_cs_config=' config.status \ |
| 111 |
| sed -e 's/^ac_cs_config="/configure /;s/"$$//' \ |
| 112 |
| perl -pe 's#\Q'`pwd`'\E#BUILD_PATH#g' |
| 113 |
>> debian/README.configure-options |
| 114 |
|
| 115 |
execute_after_dh_auto_build: |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
echo "DBENGINE $(DBENGINE)" >>debian/cyrus-db-types.txt |
| 120 |
grep '_db"' lib/imapoptions \ |
| 121 |
| cut -d, -f1-2 | sed -e 's/{ "//;s/_db", "/ /;s/"$$//' \ |
| 122 |
| sed -e 's/^tls.* /TLS /;s/^subs.* /SUBS /;s/^seen.* /SEEN /;s/^pts.* /PTS /;s/^mbox.* /MBOX /'\ |
| 123 |
| awk '{printf("%s %s\n",toupper($$1),$$2);}' \ |
| 124 |
>>debian/cyrus-db-types.txt |
| 125 |
mv debian/cyrus-db-types.txt debian/cyrus-db-types.txt.old \ |
| 126 |
&& sort -u < debian/cyrus-db-types.txt.old > debian/cyrus-db-types.txt \ |
| 127 |
&& rm debian/cyrus-db-types.txt.old |
| 128 |
|
| 129 |
|
| 130 |
echo "PACKAGE_VERSION $(DEB_VERSION)" >debian/cyrus-hardwired-config.txt |
| 131 |
if grep -q -s -n -E '^[[:space:]]*#define[[:space:]]+USE_DIR_FULL[[:space:]]+1' config.h ; then \ |
| 132 |
echo "USE_DIR_FULL 1" >>debian/cyrus-hardwired-config.txt ;\ |
| 133 |
else \ |
| 134 |
echo "USE_DIR_FULL 0" >>debian/cyrus-hardwired-config.txt ;\ |
| 135 |
fi |
| 136 |
|
| 137 |
|
| 138 |
cd doc &&\ |
| 139 |
pod2man ../perl/sieve/scripts/sieveshell.pl > ../man/sieveshell.1 &&\ |
| 140 |
fig2dev -L png legacy/murder.fig murder.png &&\ |
| 141 |
rm -f groff-html-*.png pod2htm* |
| 142 |
cd doc &&\ |
| 143 |
mkdir -p man &&\ |
| 144 |
for man in ../man/*.[1-9] ../debian/*.[1-9]; do \ |
| 145 |
echo "Generating html manpage for $$man..."; \ |
| 146 |
groff -man -Thtml $$man > man/`basename $$man`.html; \ |
| 147 |
done |
| 148 |
pod2html perl/imap/cyradm.sh > doc/man/cyradm.1.html |
| 149 |
rm -f pod2htm* |
| 150 |
|
| 151 |
execute_after_dh_auto_install: |
| 152 |
|
| 153 |
|
| 154 |
install -d -m 755 $(TMPPKG)/usr/sbin |
| 155 |
install -m 755 debian/cyrus $(TMPPKG)/usr/sbin |
| 156 |
|
| 157 |
|
| 158 |
install -d -m 755 $(TMPPKG)/etc/cyrus $(TMPPKG)/etc/pam.d |
| 159 |
install -m 644 debian/imapd.conf $(TMPPKG)/etc |
| 160 |
install -m 644 debian/cyrus.conf $(TMPPKG)/etc |
| 161 |
(cd debian ; for i in *.pam ;\ |
| 162 |
do install -m 644 $$i $(TMPPKG)/etc/pam.d/$${i%.pam} ;\ |
| 163 |
done) |
| 164 |
|
| 165 |
|
| 166 |
install -d -m 755 $(TMPPKG)/usr/share/icons/mini |
| 167 |
install -m 644 debian/cyradm-32x32.xpm $(TMPPKG)/usr/share/icons/cyradm.xpm |
| 168 |
install -m 644 debian/cyradm-16x16.xpm $(TMPPKG)/usr/share/icons/mini/cyradm.xpm |
| 169 |
|
| 170 |
|
| 171 |
install -d -m 755 $(TMPPKG)/usr/lib/cyrus/bin/ |
| 172 |
install debian/cyrus-makedirs $(TMPPKG)/usr/lib/cyrus/bin/makedirs |
| 173 |
install -m 755 debian/cyrus-upgrade-db $(TMPPKG)/usr/lib/cyrus/bin/upgrade-db |
| 174 |
install -m 644 debian/get-backtrace.gdb $(TMPPKG)/usr/lib/cyrus/get-backtrace.gdb |
| 175 |
|
| 176 |
|
| 177 |
install -d -m 755 $(TMPPKG)/etc/logcheck/ignore.d.server/ $(TMPPKG)/etc/logcheck/violations.ignore.d/ |
| 178 |
install -m 644 debian/logcheck.ignore $(TMPPKG)/etc/logcheck/ignore.d.server/cyrus-imapd |
| 179 |
install -m 644 debian/logcheck.violations.ignore $(TMPPKG)/etc/logcheck/violations.ignore.d/cyrus-imapd |
| 180 |
|
| 181 |
|
| 182 |
install -m 644 debian/cyrus-db-types.txt debian/cyrus-hardwired-config.txt \ |
| 183 |
$(TMPPKG)/usr/lib/cyrus |
| 184 |
|
| 185 |
|
| 186 |
install -m 644 debian/cyrus-makedirs.8 debian/cyrus-arbitronsort.8 debian/cyrus-dump.8 \ |
| 187 |
$(TMPPKG)/usr/share/man/man8/ |
| 188 |
|
| 189 |
|
| 190 |
for i in $(MAN1); do \ |
| 191 |
mv $(TMPPKG)/usr/share/man/man1/$$i.1 $(TMPPKG)/usr/share/man/man1/cyrus-$$i.1; \ |
| 192 |
done |
| 193 |
|
| 194 |
for i in $(MAN8); do \ |
| 195 |
mv $(TMPPKG)/usr/share/man/man8/$$i.8 $(TMPPKG)/usr/share/man/man8/cyrus-$${i}.8 ; \ |
| 196 |
done |
| 197 |
|
| 198 |
|
| 199 |
install -d -m 755 $(TMPPKG)/usr/lib/cyrus/upgrade |
| 200 |
for i in rehash translatesieve masssievec; do \ |
| 201 |
install -m 755 tools/$$i $(TMPPKG)/usr/lib/cyrus/upgrade ;\ |
| 202 |
done |
| 203 |
|
| 204 |
|
| 205 |
install -m 755 tools/arbitronsort.pl $(TMPPKG)/usr/lib/cyrus/bin/arbitronsort |
| 206 |
|
| 207 |
|
| 208 |
install -d -m 755 $(DOCDIR)/html |
| 209 |
install -m 644 doc/legacy/*.html doc/murder.png $(DOCDIR)/html |
| 210 |
cp -a doc/man $(DOCDIR)/html |
| 211 |
cp -a debian/examples $(DOCDIR) |
| 212 |
install -m 644 contrib/cyrusv2.mc $(DOCDIR)/examples |
| 213 |
|
| 214 |
|
| 215 |
install -d -m 755 $(DOCDIR)/contrib |
| 216 |
xargs < debian/cyrus-common.contrib -rti cp -r '{}' $(DOCDIR)/contrib |
| 217 |
|
| 218 |
|
| 219 |
rm $(TMPPKG)/usr/lib/cyrus/bin/*proxyd |
| 220 |
|
| 221 |
execute_after_dh_install: |
| 222 |
rm -f `cat debian/h-to-drop|sed -e 's/^\/*/debian\/\*\//'` |
| 223 |
|
| 224 |
override_dh_installinit: |
| 225 |
dh_installinit -p cyrus-common --name=cyrus-imapd |
| 226 |
|
| 227 |
override_dh_installchangelogs: |
| 228 |
dh_installchangelogs \ |
| 229 |
-p cyrus-common -p cyrus-doc -p cyrus-clients \ |
| 230 |
-p cyrus-admin -p libcyrus-imap-perl -p cyrus-imapd \ |
| 231 |
-p cyrus-pop3d -p cyrus-murder -p cyrus-replication \ |
| 232 |
-p cyrus-nntpd -p cyrus-caldav -p cyrus-dev \ |
| 233 |
doc/legacy/changes.html |
| 234 |
dh_installchangelogs --remaining-packages |
| 235 |
|
| 236 |
override_dh_installcron: |
| 237 |
dh_installcron --name=cyrus-imapd |
| 238 |
|
| 239 |
override_dh_installsystemd: |
| 240 |
dh_installsystemd --name=cyrus-imapd |
| 241 |
|
| 242 |
override_dh_missing: |
| 243 |
dh_missing --fail-missing -X.la |
| 244 |
|
| 245 |
override_dh_auto_clean: |
| 246 |
perl -pe 's#\@top_srcdir\@#../..#' <perl/annotator/Makefile.PL.in >perl/annotator/Makefile.PL |
| 247 |
dh_auto_clean |