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
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# the build captures $SHELL, hard-wire to "/bin/sh"
export CONFIG_SHELL=/bin/sh
include /usr/share/dpkg/default.mk
# main packaging script based on dh7 syntax
%:
dh $@
COMMON_CONFOPTS=--with-authdaemonvar=/run/courier/authdaemon \
--with-pkgconfdir=/etc/courier \
--libdir=\$${prefix}/lib \
--libexecdir=\$${prefix}/lib/courier \
--datadir=\$${prefix}/lib/courier \
--localstatedir=/var/lib/courier \
--with-mailuser=courier \
--with-mailgroup=courier \
--without-socks \
--with-authpam \
--with-authpipe \
--without-authpwd \
--with-authmysql \
--with-mysql-includes=/usr/include/mysql \
--with-mysql-libs=/usr/lib \
--with-authmysqlrc=/etc/courier/authmysqlrc \
--with-authpgsql \
--with-pgsql-includes=`pg_config --includedir` \
--with-pgsql-libs=/usr/lib \
--with-authpgsqlrc=/etc/courier/authpgsqlrc \
--without-authshadow \
--with-authldap \
--with-authldaprc=/etc/courier/authldaprc \
--with-authsqlite="" \
--with-authsqliterc=/etc/courier/authsqliterc \
--with-authcram \
--with-db=gdbm \
--without-fcgi \
--with-htmllibdir=/usr/share/sqwebmail \
--with-ispell=/usr/bin/ispell \
--enable-userdb \
--enable-syslog=1 \
--disable-root-check \
--with-locking-method=fcntl \
override_dh_auto_configure:
dh_auto_configure -- PS=/bin/ps $(COMMON_CONFOPTS)
override_dh_install:
pod2man --center='Debian GNU/Linux Documentation' \
--release='Debian GNU/Linux '`cat /etc/debian_version` \
--section=8 debian/authenumerate.pod \
--verbose \
> debian/tmp/usr/share/man/man8/authenumerate.8
# Change default module list
perl -pe 's/^authmodulelist=".*?"/authmodulelist="authpam"/' debian/tmp/etc/courier/authdaemonrc.dist > debian/tmp/etc/courier/authdaemonrc
rm -v debian/tmp/etc/courier/authdaemonrc.dist
# Change default LDAP server to localhost
perl -pe 's/^(LDAP_SERVER\s+)ldap.example.com/$$1localhost/' debian/tmp/etc/courier/authldaprc.dist > debian/tmp/etc/courier/authldaprc
rm -v debian/tmp/etc/courier/authldaprc.dist
# Change default MySQL server to localhost
perl -pe 's/^(MYSQL_SERVER\s+)mysql.example.com/$$1localhost/;s%^(#?\s*MYSQL_SOCKET\s+)/.*%$$1/var/run/mysqld/mysqld.sock%' debian/tmp/etc/courier/authmysqlrc.dist > debian/tmp/etc/courier/authmysqlrc
rm -v debian/tmp/etc/courier/authmysqlrc.dist
# Change default SQlite 3 path to /var/lib/courier/users.db
perl -pe 's%^(SQLITE_DATABASE\s+)/var/users.db%$$1/var/lib/courier/users.db%' debian/tmp/etc/courier/authsqliterc.dist > debian/tmp/etc/courier/authsqliterc
rm -v debian/tmp/etc/courier/authsqliterc.dist
mv -v debian/tmp/etc/courier/authpgsqlrc.dist debian/tmp/etc/courier/authpgsqlrc
dh_install
dh_missing --fail-missing
|