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