* reorder zlib detection
[citadel.git] / webcit / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 DESTDIR=$(CURDIR)/debian/citadel-webcit
13
14 EXTRA_ARGS=
15 PROFILE_ARGS=
16 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug"
17
18 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
19         PROFILE_ARGS= --with-gprof
20 endif
21 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW
23         LDFLAGS += -pg 
24         EXTRA_ARGS =  --with-backtrace
25 else
26         CFLAGS += -O2
27 endif
28 ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
29         CFLAGS += -D DEBUG_URLSTRINGS
30 endif
31
32 configure: configure-stamp
33 configure-stamp:
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-wwwdir=/usr/share/citadel-webcit \
40                 --with-localedir=/usr/share/ \
41                 --with-editordir=/usr/share/tinymce/www \
42                 --with-rundir=/var/run/citadel \
43                 --with-ical --with-db --with-ldap \
44                 --with-ssldir=/etc/ssl/webcit/ \
45                 --with-ssl --with-libiconf \
46                 --with-newt --with-included-gettext \
47                 --with-datadir=/var/run/citadel \
48                 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
49
50         touch configure-stamp
51
52
53 build: build-stamp
54
55 build-stamp: configure-stamp 
56         dh_testdir
57
58 # Add here commands to compile the package.
59         $(MAKE)
60 #docbook-to-man debian/webcit.sgml > webcit.1
61
62         touch build-stamp
63
64 clean:
65         dh_testdir
66         dh_testroot
67         rm -f build-stamp configure-stamp
68
69 # Add here commands to clean up after the build process.
70         -$(MAKE) clean
71
72         dh_clean 
73
74 install: build
75         dh_testdir
76         dh_testroot
77         dh_clean -k 
78         dh_installdirs
79         $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
80         rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
81 #       mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
82
83
84
85 # Build architecture-independent files here.
86 binary-indep: build install
87 # We have nothing to do by default.
88
89 # Build architecture-dependent files here.
90 binary-arch: build install
91         dh_testdir
92         dh_testroot
93         dh_installchangelogs
94         dh_installdocs
95         dh_installexamples
96         dh_install
97 #       dh_installmenu
98         dh_installdebconf       
99 #       dh_installlogrotate
100 #       dh_installemacsen
101 #       dh_installpam
102 #       dh_installmime
103         dh_installinit --name=webcit
104 #       dh_installcron
105 #       dh_installinfo
106         dh_installman
107         dh_link
108         dh_strip
109         dh_compress
110         dh_fixperms
111 #       dh_perl
112 #       dh_python
113 #       dh_makeshlibs
114         dh_installdeb
115         dh_shlibdeps
116         dh_gencontrol
117         dh_md5sums
118         dh_builddeb
119
120 binary: binary-indep binary-arch
121 .PHONY: build clean binary-indep binary-arch binary install configure