* we don't have a changelog anymore.
[citadel.git] / citadel / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 #
5 # This file was originally written by Joey Hess and Craig Small.
6 # As a special exception, when this file is copied by dh-make into a
7 # dh-make output file, you may use that output file without restriction.
8 # This special exception was added by Craig Small in version 0.37 of dh-make.
9 #
10 # Modified to make a template file for a multi-binary package with separated
11 # build-arch and build-indep targets  by Bill Allombert 2001
12
13 # Uncomment this to turn on verbose mode.
14 #export DH_VERBOSE=1
15
16 # This has to be exported to make some magic below work.
17 export DH_OPTIONS
18
19 # These are used for cross-compiling and for saving the configure script
20 # from having to guess our platform (since we know it already)
21 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
22 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
23
24 CFLAGS = -Wall -g
25
26 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -O0 -ggdb
28 else
29         CFLAGS += -O2
30 endif
31
32 config.status: configure
33         dh_testdir
34         CFLAGS="$(CFLAGS)" ./configure \
35                 --host=$(DEB_HOST_GNU_TYPE) \
36                 --build=$(DEB_BUILD_GNU_TYPE) \
37                 --prefix=/usr/sbin \
38                 --with-sysconfdir=/etc/citadel \
39                 --with-spooldir=/var/spool/citadel \
40                 --with-datadir=/var/lib/citadel \
41                 --with-rundir=/var/run/citadel \
42                 --with-docdir=/usr/share/doc/citadel-doc/ \
43                 --with-pam \
44                 --with-libical \
45                 --with-libsieve \
46                 --with-db \
47                 --with-ldap
48
49
50 #Architecture 
51 build: build-arch build-indep
52
53 build-arch: build-arch-stamp
54 build-arch-stamp:  config.status
55
56 #       # Add here commands to compile the arch part of the package.
57 #       $(MAKE) 
58         touch build-arch-stamp
59
60 build-indep: build-indep-stamp
61 build-indep-stamp:  config.status
62
63 #       # Add here commands to compile the indep part of the package.
64 #       #$(MAKE) doc
65         touch build-indep-stamp
66
67 clean:
68         dh_testdir
69         dh_testroot
70         rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
71         -$(MAKE) distclean
72 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
73         cp -f /usr/share/misc/config.sub config.sub
74 endif
75 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
76         cp -f /usr/share/misc/config.guess config.guess
77 endif
78
79
80         dh_clean 
81
82 install: install-indep install-arch
83 install-indep:
84         dh_testdir
85         dh_testroot
86         dh_clean -k -i 
87         dh_installdirs -i
88         $(MAKE) -C . install DESTDIR="$(CURDIR)/debian/tmp" install-doc-new prefix=$(CURDIR)/debian/citadel-doc/
89
90
91 install-arch:
92         dh_testdir
93         dh_testroot
94         dh_clean -k -s 
95         dh_installdirs -s
96         mkdir -p  $(CURDIR)/debian/tmp/
97         $(MAKE) -C . install DESTDIR="$(CURDIR)/debian/tmp/" install-exec-new install-data-new
98
99         mkdir -p $(CURDIR)/debian/tmp/usr/lib/citadel-server
100         mv \
101                 $(CURDIR)/debian/tmp/usr/sbin/setup \
102                 $(CURDIR)/debian/tmp/usr/lib/citadel-server/
103 #       cd $(CURDIR)/debian/tmp/usr/share/doc/citadel-server/examples/help; md5sum * >../help.md5sums
104 #       cd $(CURDIR)/debian/tmp/usr/share/doc/citadel-server/examples/messages; md5sum * >../messages.md5sums
105         cp \
106                 $(CURDIR)/debian/tmp/usr/sbin/citmail \
107                 $(CURDIR)/debian/tmp/usr/sbin/sendmail
108         dh_installexamples  
109         dh_install 
110 # Must not depend on anything. This is to be called by
111 # binary-arch/binary-indep
112 # in another 'make' thread.
113 binary-common:
114         dh_testdir
115         dh_testroot
116 #       dh_installchangelogs ChangeLog
117         dh_installdocs
118         dh_installexamples
119 #       dh_installmenu
120         dh_installdebconf       
121 #       dh_installlogrotate     
122 #       dh_installemacsen
123 #       dh_installpam
124 #       dh_installmime
125         dh_installinit  --name=citadel
126 #       dh_installcron
127 #       dh_installinfo
128         dh_installman
129 #doesn't work like that. will be done by postinst.
130 #       mkdir -p $(CURDIR)/debian/citadel-mta/usr/sbin
131 #       dh_link --package=citadel-mta /usr/sbin/citmail /usr/sbin/sendmail
132         dh_strip
133         dh_compress 
134         dh_fixperms
135 #       dh_perl
136 #       dh_python
137         dh_makeshlibs
138         dh_installdeb
139         dh_shlibdeps
140         dh_gencontrol
141         dh_md5sums
142         dh_builddeb
143 # Build architecture independant packages using the common target.
144 binary-indep: build-indep install-indep
145         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
146
147 # Build architecture dependant packages using the common target.
148 binary-arch: build-arch install-arch
149         $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
150
151 binary: binary-arch binary-indep
152 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch