#!/usr/bin/make -f
#
-# Copyright 2004,2005 by Stefan Hornburg (Racke) <racke@linuxia.de>
+# Copyright 2004,2005,2008 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
# 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
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+LDFLAGS += -lcrypt
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
+
COMMON_CONFOPTS=--prefix=/usr --mandir=\$${prefix}/share/man \
--with-authdaemonvar=/var/run/courier/authdaemon \
+ CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
--sysconfdir=/etc/courier \
--with-pkgconfdir=/etc/courier \
--libexecdir=\$${prefix}/lib/courier \
--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 \
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) \
+ ./configure $(COMMON_CONFOPTS) \
--with-postgresql-includes=/usr/include/postgresql/8.0 \
&& $(MAKE) && touch stamp-build; \
else \
- LDFLAGS=-lcrypt ./configure $(COMMON_CONFOPTS) \
+ ./configure $(COMMON_CONFOPTS) \
--with-postgresql-includes=/usr/include/postgresql \
&& $(MAKE) && touch stamp-build; \
fi \
rm -f stamp-build stamp-install
# Add here commands to clean up after the build process.
- -$(MAKE) clean
+ [ ! -f Makefile ] || $(MAKE) distclean
dh_clean
install: check stamp-build
dh_installdirs
# Add here commands to install the package into debian/tmp.
- $(MAKE) DESTDIR=$(BUILD) install
+ $(MAKE) DESTDIR=$(BUILD) install
+
+ sed -i "/dependency_libs/ s/'.*'/''/" `find $(BUILD) -name '*.la'`
# (cd $(BUILD)/usr/lib/courier/courier-authlib/changepwd; ln -fs ../../authsystem.passwd ./authsystem.passwd)
# 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)
+ (cd $(BUILD)/usr/share/man/man8 && ln -s makeuserdb.8.gz pw2userdb.8.gz)
dh_installdocs
# - change authentification default settings
mv $(BUILD)/etc/courier/authpgsqlrc.dist $(BUILD)/etc/courier/authpgsqlrc
rm $(BUILD)/etc/courier/*.dist
+# Lintian overrides
+ mkdir -p $(BUILD)/usr/share/lintian/overrides
+ for package in courier-authdaemon courier-authlib-ldap courier-authlib-mysql courier-authlib-postgresql; do \
+ cp debian/$$package.lintian $(BUILD)/usr/share/lintian/overrides/$$package; \
+ done
+
# 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
dh_md5sums -i
dh_builddeb -i
+calibdir = debian/courier-authlib/usr/lib/courier-authlib
+
# Build architecture-dependent files here.
binary-arch: stamp-build stamp-install
dh_testdir
dh_compress -a
dh_fixperms -a
debian/courier_perms -a
- dh_installdeb -a
dh_perl -a
- dh_makeshlibs -a
- dh_shlibdeps -a
+ dh_makeshlibs -pcourier-authlib -- -Pdebian/courier-authlib -e$(calibdir)/libcourier*.so
+ dh_shlibdeps -a -l$(calibdir)
+ dh_installdeb -a
dh_gencontrol -- -VRELUP="$(RELUP)"
dh_md5sums -a
dh_builddeb -a