3 # Copyright 2004,2005 by Stefan Hornburg (Racke) <racke@linuxia.de>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public
16 # License along with this program; if not, write to the Free
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 BUILD
=$(shell pwd
)/debian
/tmp
21 RELUP
=$(shell dpkg-parsechangelog | perl
-ne
'print $$1 if /^Version: (.*?)-(.*)$$/')
23 # Uncomment this to turn on verbose mode.
26 # This is the debhelper compatability version to use.
29 # This has to be exported to make some magic below work.
32 # Common configuration options
33 NONSSL_CONFOPTS
=--without-certdb
--without-authpgsql
35 COMMON_CONFOPTS
=--prefix=/usr
--mandir=\
$${prefix}/share
/man \
36 --with-authdaemonvar
=/var
/run
/courier
/authdaemon \
37 --sysconfdir
=/etc
/courier \
38 --with-pkgconfdir
=/etc
/courier \
39 --libexecdir
=\
$${prefix}/lib
/courier \
40 --datadir=\
$${prefix}/lib
/courier \
41 --localstatedir
=/var
/lib
/courier \
42 --sbindir
=\
$${exec_prefix}/sbin \
43 --with-mailuser
=daemon \
44 --with-mailgroup
=daemon \
50 --with-mysql-includes
=/usr
/include/mysql \
51 --with-mysql-libs
=/usr
/lib \
52 --with-authmysqlrc
=/etc
/courier
/authmysqlrc \
54 --with-pgsql-includes
=`pg_config --includedir` \
55 --with-pgsql-libs
=/usr
/lib \
56 --with-authpgsqlrc
=/etc
/courier
/authpgsqlrc \
57 --without-authshadow \
58 --without-authvchkpw \
59 --with-authdaemonvar
=/var
/run
/courier
/authdaemon \
61 --with-authldaprc
=/etc
/courier
/authldaprc \
65 --with-htmllibdir
=/usr
/share
/sqwebmail \
66 --with-ispell
=/usr
/bin
/ispell \
75 if
[ `umask` != "0022" ]; then echo
"You need to set umask to 022 in order to compile/build courier"; exit
1; fi
76 chmod
+x debian
/courier_perms
79 # create a list of files that currently exists
80 if
[ ! -f stamp-build
]; then \
81 if
[ -d
/usr
/include/postgresql
/8.0/libpq_fe.h
]; then \
82 LDFLAGS
=-lcrypt .
/configure
$(COMMON_CONFOPTS
) \
83 --with-postgresql-includes
=/usr
/include/postgresql
/8.0 \
84 && $(MAKE
) && touch stamp-build
; \
86 LDFLAGS
=-lcrypt .
/configure
$(COMMON_CONFOPTS
) \
87 --with-postgresql-includes
=/usr
/include/postgresql \
88 && $(MAKE
) && touch stamp-build
; \
96 rm -f stamp-build stamp-install
98 # Add here commands to clean up after the build process.
102 install: check stamp-build
107 # Add here commands to install the package into debian/tmp.
108 $(MAKE
) DESTDIR
=$(BUILD
) install
110 # (cd $(BUILD)/usr/lib/courier/courier-authlib/changepwd; ln -fs ../../authsystem.passwd ./authsystem.passwd)
112 # Install authentification test program
113 # mv $(BUILD)/usr/sbin/authtest $(BUILD)/usr/sbin/courierauthtest
115 # Additional manpages
116 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
117 # 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
119 # Symlinks for userdb manpages
120 (cd
$(BUILD
)/usr
/share
/man
/man8
&& ln
-s makeuserdb
.8.gz pw2userdb
.8.gz
&& ln
-s makeuserdb
.8.gz vchkpw2userdb
.8.gz
)
123 # - change authentification default settings
124 perl
-pe
's/^authmodulelist=".*?"/authmodulelist="authpam"/' $(BUILD
)/etc
/courier
/authdaemonrc.
dist > $(BUILD
)/etc
/courier
/authdaemonrc
125 # - change default LDAP server
126 perl
-pe
's/^(LDAP_SERVER\s+)ldap.example.com/$$1localhost/' $(BUILD
)/etc
/courier
/authldaprc.
dist > $(BUILD
)/etc
/courier
/authldaprc
127 # - change default MySQL server
128 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
129 mv
$(BUILD
)/etc
/courier
/authpgsqlrc.
dist $(BUILD
)/etc
/courier
/authpgsqlrc
130 rm $(BUILD
)/etc
/courier
/*.
dist
132 # This seems to be necessary for building in fakeroot
133 # environment (otherwise dh_strip fails)
134 # set all binaries to 755, by checking if user has x-bit
135 # debian/courier_perms will set the right permissions
136 find
$(BUILD
) -perm
-u
+x
-type f | xargs chmod u
+rwx
,go
+rx
140 # Check if all files have moved out
141 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
145 stamp-install
: install
147 # Build architecture-independent files here.
148 binary-indep
: stamp-build stamp-install
151 # dh_installdebconf -i
152 dh_installexamples
-i
156 dh_installchangelogs
-i
161 debian
/courier_perms
-i
169 # Build architecture-dependent files here.
170 binary-arch
: stamp-build stamp-install
173 # dh_installdebconf -a
174 dh_installexamples
-a
179 dh_installchangelogs
-a
184 debian
/courier_perms
-a
189 dh_gencontrol
-- -VRELUP
="$(RELUP)"
195 .PHONY
: check build
clean binary-arch binary
install