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
|
#!/usr/bin/make -f
# Uncomment to enable verbose build.
#DH_VERBOSE = 1
# Enable the default build hardening flags. <https://wiki.debian.org/HardeningWalkthrough>
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Append the CPPFLAGS to the standard CFLAGS variables. <https://wiki.debian.org/Hardening#Notes_for_packages_using_CMake>
# These shouldn't be required with debhelper >= 9, but without it blhc detects a missing D_FORTIFY_SOURCE=2.
CFLAGS += $(CPPFLAGS)
# Build the package.
%:
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)
execute_after_dh_auto_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
# Remove any undefined "an-trap" macros from the man pages. <https://github.com/svarshavchik/courier/issues/58>
sed -i '/an-trap/d' debian/tmp/usr/share/man/man1/*
sed -i '/an-trap/d' debian/tmp/usr/share/man/man3/*
# 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
|