cec20b37bead5a6f13fceaaf63818081e17f5192
[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 export VERSION=`grep 'THIS IS' $(CURDIR)/ChangeLog  |head -n 1 |sed "s;.* ;;"`
24
25 CFLAGS = -Wall -g
26
27 #ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
28         CFLAGS += -O0 -ggdb
29 #else
30 #       CFLAGS += -O2
31 #endif
32
33 config.status: configure
34         dh_testdir
35         CFLAGS="$(CFLAGS)" ./configure \
36                 --host=$(DEB_HOST_GNU_TYPE) \
37                 --build=$(DEB_BUILD_GNU_TYPE) \
38                 --prefix=/usr/sbin \
39                 --with-sysconfdir=/etc/citadel \
40                 --with-spooldir=/var/spool/citadel \
41                 --with-datadir=/var/lib/citadel \
42                 --with-rundir=/var/run/citadel \
43                 --with-docdir=/usr/share/doc/citadel-doc/ \
44                 --enable-autologin --with-pam \
45                 --with-ical --with-db --with-ldap
46
47
48 #Architecture 
49 build: build-arch build-indep
50
51 build-arch: build-arch-stamp
52 build-arch-stamp:  config.status
53
54         # Add here commands to compile the arch part of the package.
55         #$(MAKE) 
56         touch build-arch-stamp
57
58 build-indep: build-indep-stamp
59 build-indep-stamp:  config.status
60
61         # Add here commands to compile the indep part of the package.
62         #$(MAKE) doc
63         touch build-indep-stamp
64
65 clean:
66         dh_testdir
67         dh_testroot
68         rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
69         -$(MAKE) distclean
70 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
71         cp -f /usr/share/misc/config.sub config.sub
72 endif
73 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
74         cp -f /usr/share/misc/config.guess config.guess
75 endif
76
77
78         dh_clean 
79
80 install: install-indep install-arch
81 install-indep:
82         dh_testdir
83         dh_testroot
84         dh_clean -k -i 
85         dh_installdirs -i
86         export root=$(CURDIR)/debian/tmp; $(MAKE) install-doc-new prefix=$(CURDIR)/debian/citadel-doc/
87
88
89 install-arch:
90         dh_testdir
91         dh_testroot
92         dh_clean -k -s 
93         dh_installdirs -s
94         mkdir -p  $(CURDIR)/debian/tmp/
95         export root=$(CURDIR)/debian/tmp/;$(MAKE) install-exec-new install-data-new
96
97         mkdir -p $(CURDIR)/debian/tmp/usr/lib/citadel-server
98         mv \
99                 $(CURDIR)/debian/tmp/usr/sbin/setup \
100                 $(CURDIR)/debian/tmp/usr/lib/citadel-server/
101         mv \
102                 $(CURDIR)/debian/tmp/usr/sbin/ctdlsvc \
103                 $(CURDIR)/debian/tmp/usr/lib/citadel-server/
104 #       cd $(CURDIR)/debian/tmp/usr/share/doc/citadel-server/examples/help; md5sum * >../help.md5sums
105 #       cd $(CURDIR)/debian/tmp/usr/share/doc/citadel-server/examples/messages; md5sum * >../messages.md5sums
106         cp \
107                 $(CURDIR)/debian/tmp/usr/sbin/citmail \
108                 $(CURDIR)/debian/tmp/usr/sbin/sendmail
109         dh_installexamples  
110         dh_install 
111 # Must not depend on anything. This is to be called by
112 # binary-arch/binary-indep
113 # in another 'make' thread.
114 binary-common:
115         dh_testdir
116         dh_testroot
117         dh_installchangelogs ChangeLog
118         dh_installdocs
119         dh_installexamples
120 #       dh_installmenu
121         dh_installdebconf       
122 #       dh_installlogrotate     
123 #       dh_installemacsen
124 #       dh_installpam
125 #       dh_installmime
126         dh_installinit  --name=citadel
127 #       dh_installcron
128 #       dh_installinfo
129         dh_installman
130 #doesn't work like that. will be done by postinst.
131 #       mkdir -p $(CURDIR)/debian/citadel-mta/usr/sbin
132 #       dh_link --package=citadel-mta /usr/sbin/citmail /usr/sbin/sendmail
133         dh_strip
134         dh_compress 
135         dh_fixperms
136 #       dh_perl
137 #       dh_python
138         dh_makeshlibs
139         dh_installdeb
140         dh_shlibdeps
141         dh_gencontrol
142         dh_md5sums
143         dh_builddeb
144 # Build architecture independant packages using the common target.
145 binary-indep: build-indep install-indep
146         $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
147
148 # Build architecture dependant packages using the common target.
149 binary-arch: build-arch install-arch
150         $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
151
152 binary: binary-arch binary-indep
153 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch