* make the crypto functions use precalculated files instead of relative ones
[citadel.git] / citadel / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 # This has to be exported to make some magic below work.
7 export DH_OPTIONS
8
9 DEB_DESTDIR = $(CURDIR)/debian/tmp
10
11 CFLAGS = -Wall -g
12
13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
14         CFLAGS += -O0 -ggdb
15 else
16         CFLAGS += -O2
17 endif
18
19 configure: configure-stamp
20 configure-stamp:
21         dh_testdir
22
23         CFLAGS="$(CFLAGS)" ./configure \
24                 --with-prefix=/var/lib/citadel \
25                 --with-datadir=/var/lib/citadel \
26                 --with-spooldir=/var/spool/citadel \
27                 --with-sysconfdir=/etc/citadel \
28                 --with-rundir=/var/run/citadel \
29                 --with-docdir=/usr/share/doc/citadel-doc/ \
30                 --with-ssldir=/etc/ssl/citadel/ \
31                 --with-pam \
32                 --with-db \
33                 --with-zlib \
34                 --with-ldap \
35                 --with-libical \
36                 --with-libsieve
37
38         touch configure-stamp
39
40 #Architecture 
41 build: build-arch build-indep
42
43 build-arch: build-arch-stamp
44 build-arch-stamp: configure-stamp
45
46         $(MAKE)
47         touch $@
48
49 build-indep: build-indep-stamp
50 build-indep-stamp: configure-stamp
51
52         touch $@
53
54 clean:
55         dh_testdir
56         dh_testroot
57         rm -f build-arch-stamp build-indep-stamp configure-stamp
58
59         -$(MAKE) distclean
60
61         dh_clean 
62
63 install: install-indep install-arch
64 install-indep:
65         dh_testdir
66         dh_testroot
67         dh_clean -k -i 
68         dh_installdirs -i
69
70         $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
71
72         dh_install -i --sourcedir=debian/tmp
73
74 install-arch:
75         dh_testdir
76         dh_testroot
77         dh_clean -k -s 
78         dh_installdirs -s
79
80         $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
81
82         install -D -p -m0755 $(DEB_DESTDIR)/usr/sbin/setup \
83                 $(DEB_DESTDIR)/usr/lib/citadel-server/setup
84
85         install -D -p -m0755 database_cleanup.sh \
86                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/database_cleanup.sh
87
88         install -D -p -m0644 docs/welcomemail.html \
89                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.html
90
91         install -D -p -m0644 docs/welcomemail.txt \
92                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.txt
93
94         dh_install -s --sourcedir=debian/tmp
95
96 binary-common:
97         dh_testdir
98         dh_testroot
99         dh_installchangelogs
100         dh_installdocs
101         dh_installdebconf       
102         dh_installinit --name=citadel
103         dh_installman
104         dh_strip
105         dh_compress 
106         dh_fixperms
107         dh_makeshlibs
108         dh_installdeb
109         dh_shlibdeps
110         dh_gencontrol
111         dh_md5sums
112         dh_builddeb
113
114 # Build architecture independant packages using the common target.
115 binary-indep: build-indep install-indep
116         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
117
118 # Build architecture dependant packages using the common target.
119 binary-arch: build-arch install-arch
120         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
121
122 binary: binary-arch binary-indep
123 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure