* sending the startup-problem-message now does work.
[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 debug,$(DEB_BUILD_OPTIONS)))
14         CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP 
15         LDFLAGS += -pg 
16         SERVER_LDFLAGS += -lm
17 #       SERVER_LDFLAGS += -pg
18         EXTRA_ARGS = --with-profiling --with-backtrace
19 else
20         CFLAGS += -O2
21 endif
22
23 configure: configure-stamp
24 configure-stamp:
25         dh_testdir
26
27         CFLAGS="$(CFLAGS)" ./configure \
28                 --with-prefix=/var/lib/citadel \
29                 --with-datadir=/var/lib/citadel \
30                 --with-staticdatadir=/usr/share/citadel-server \
31                 --with-spooldir=/var/spool/citadel \
32                 --with-sysconfdir=/etc/citadel \
33                 --with-rundir=/var/run/citadel \
34                 --with-docdir=/usr/share/doc/citadel-doc/ \
35                 --with-ssldir=/etc/ssl/citadel/ \
36                 --with-utility-bindir=/usr/lib/citadel-server/ \
37                 --with-pam \
38                 --with-db \
39                 --with-zlib \
40                 --with-ldap \
41                 --with-libical \
42                 --with-libsieve \
43                 --enable-debug $(EXTRA_ARGS)
44
45         touch configure-stamp
46
47 #Architecture 
48 build: build-arch build-indep
49
50 build-arch: build-arch-stamp
51 build-arch-stamp: configure-stamp
52
53         $(MAKE)
54         touch $@
55
56 build-indep: build-indep-stamp
57 build-indep-stamp: configure-stamp
58
59         touch $@
60
61 clean:
62         dh_testdir
63         dh_testroot
64         rm -f build-arch-stamp build-indep-stamp configure-stamp
65
66         -$(MAKE) distclean
67
68         dh_clean 
69         rm -f config.status config.log
70
71 install: install-indep install-arch
72 install-indep:
73         dh_testdir
74         dh_testroot
75         dh_clean -k -i 
76         dh_installdirs -i
77
78         $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
79
80         dh_install -i --sourcedir=debian/tmp
81
82 install-arch:
83         dh_testdir
84         dh_testroot
85         dh_clean -k -s 
86         dh_installdirs -s
87
88         $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
89
90         install -D -p -m0755 database_cleanup.sh \
91                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/examples/database_cleanup.sh
92
93         install -D -p -m0644 docs/welcomemail.html \
94                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.html
95
96         install -D -p -m0644 docs/welcomemail.txt \
97                 $(DEB_DESTDIR)/usr/share/doc/citadel-server/welcomemail.txt
98
99         dh_install -s --sourcedir=debian/tmp
100
101 binary-common:
102         dh_testdir
103         dh_testroot
104         dh_installchangelogs
105         dh_installdocs
106         dh_installdebconf       
107         dh_installinit --name=citadel
108         dh_installman
109         dh_strip
110         dh_compress 
111         dh_fixperms
112         dh_makeshlibs
113         dh_installdeb
114         dh_shlibdeps
115         dh_gencontrol
116         dh_md5sums
117         dh_builddeb
118
119 # Build architecture independant packages using the common target.
120 binary-indep: build-indep install-indep
121         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
122
123 # Build architecture dependant packages using the common target.
124 binary-arch: build-arch install-arch
125         $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
126
127 binary: binary-arch binary-indep
128 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure