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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
#!/usr/bin/make -f
#
# Copyright 2004,2005 by Stefan Hornburg (Racke) <racke@linuxia.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA.
BUILD=$(shell pwd)/debian/tmp
RELUP=$(shell dpkg-parsechangelog | perl -ne 'print $$1 if /^Version: (.*?)-(.*)$$/')
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=4
# This has to be exported to make some magic below work.
export DH_OPTIONS
# Common configuration options
NONSSL_CONFOPTS=--without-certdb --without-authpgsql
COMMON_CONFOPTS=--prefix=/usr --mandir=\$${prefix}/share/man \
--with-authdaemonvar=/var/run/courier/authdaemon \
--sysconfdir=/etc/courier \
--with-pkgconfdir=/etc/courier \
--libexecdir=\$${prefix}/lib/courier \
--datadir=\$${prefix}/lib/courier \
--localstatedir=/var/lib/courier \
--sbindir=\$${exec_prefix}/sbin \
--with-mailuser=daemon \
--with-mailgroup=daemon \
--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 \
--without-authvchkpw \
--with-authdaemonvar=/var/run/courier/authdaemon \
--with-authldap \
--with-authldaprc=/etc/courier/authldaprc \
--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
check:
dh_testdir
# check umask
if [ `umask` != "0022" ]; then echo "You need to set umask to 022 in order to compile/build courier"; exit 1; fi
chmod +x debian/courier_perms
build: check
# create a list of files that currently exists
if [ ! -f stamp-build ]; then \
if [ -d /usr/include/postgresql/8.0/libpq_fe.h ]; then \
LDFLAGS=-lcrypt ./configure $(COMMON_CONFOPTS) \
--with-postgresql-includes=/usr/include/postgresql/8.0 \
&& $(MAKE) && touch stamp-build; \
else \
LDFLAGS=-lcrypt ./configure $(COMMON_CONFOPTS) \
--with-postgresql-includes=/usr/include/postgresql \
&& $(MAKE) && touch stamp-build; \
fi \
fi
stamp-build: build
clean: check
dh_testroot
rm -f stamp-build stamp-install
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: check stamp-build
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp.
$(MAKE) DESTDIR=$(BUILD) install
# (cd $(BUILD)/usr/lib/courier/courier-authlib/changepwd; ln -fs ../../authsystem.passwd ./authsystem.passwd)
# Install authentification test program
# mv $(BUILD)/usr/sbin/authtest $(BUILD)/usr/sbin/courierauthtest
# Additional manpages
pod2man --center='Debian GNU/Linux Documentation' --release='Debian GNU/Linux '`cat /etc/debian_version` --section=8 debian/authenumerate.pod > $(BUILD)/usr/share/man/man8/authenumerate.8
# pod2man --center='Debian GNU/Linux Documentation' --release='Debian GNU/Linux '`cat /etc/debian_version` --section=8 debian/courierauthtest.pod > $(BUILD)/usr/share/man/man8/courierauthtest.8
# Symlinks for userdb manpages
(cd $(BUILD)/usr/share/man/man8 && ln -s makeuserdb.8.gz pw2userdb.8.gz && ln -s makeuserdb.8.gz vchkpw2userdb.8.gz)
dh_installdocs
# - change authentification default settings
perl -pe 's/^authmodulelist=".*?"/authmodulelist="authpam"/' $(BUILD)/etc/courier/authdaemonrc.dist > $(BUILD)/etc/courier/authdaemonrc
# - change default LDAP server
perl -pe 's/^(LDAP_SERVER\s+)ldap.example.com/$$1localhost/' $(BUILD)/etc/courier/authldaprc.dist > $(BUILD)/etc/courier/authldaprc
# - change default MySQL server
perl -pe 's/^(MYSQL_SERVER\s+)mysql.example.com/$$1localhost/;s%^(#?\s*MYSQL_SOCKET\s+)/.*%$$1/var/run/mysqld/mysqld.sock%' $(BUILD)/etc/courier/authmysqlrc.dist > $(BUILD)/etc/courier/authmysqlrc
mv $(BUILD)/etc/courier/authpgsqlrc.dist $(BUILD)/etc/courier/authpgsqlrc
rm $(BUILD)/etc/courier/*.dist
# This seems to be necessary for building in fakeroot
# environment (otherwise dh_strip fails)
# set all binaries to 755, by checking if user has x-bit
# debian/courier_perms will set the right permissions
find $(BUILD) -perm -u+x -type f | xargs chmod u+rwx,go+rx
dh_movefiles
# Check if all files have moved out
if [ `find $(BUILD) -not -type d | wc -l` -ne 0 ]; then find $(BUILD) -not -type d; echo "File(s) found not belonging to any package, please contact maintainer"; exit 1; fi
touch stamp-install
stamp-install: install
# Build architecture-independent files here.
binary-indep: stamp-build stamp-install
dh_testdir
dh_testroot
# dh_installdebconf -i
dh_installexamples -i
dh_installmenu -i
dh_installinit -i
dh_installinfo -i
dh_installchangelogs -i
dh_strip -i
dh_link -i
dh_compress -i
dh_fixperms -i
debian/courier_perms -i
dh_installdeb -i
dh_perl -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: stamp-build stamp-install
dh_testdir
dh_testroot
# dh_installdebconf -a
dh_installexamples -a
dh_installmenu -a
dh_installinit -a
dh_installcron -a
dh_installinfo -a
dh_installchangelogs -a
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
debian/courier_perms -a
dh_installdeb -a
dh_perl -a
dh_makeshlibs -a
dh_shlibdeps -a
dh_gencontrol -- -VRELUP="$(RELUP)"
dh_md5sums -a
dh_builddeb -a
binary: binary-arch
.PHONY: check build clean binary-arch binary install
|