* add way to build the debs with url debugging
[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
19 ifneq (,$(findstring compression,$(DEB_BUILD_OPTIONS)))
20         ZLIB_ARGS=--without-zlib
21 else
22         ZLIB_ARGS=--with-zlib
23 endif
24 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
25         PROFILE_ARGS= --with-gprof
26 endif
27 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
28         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW
29         LDFLAGS += -pg 
30         EXTRA_ARGS =  --with-backtrace
31 else
32         CFLAGS += -O2
33 endif
34 ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
35         CFLAGS += -D DEBUG_URLSTRINGS
36 endif
37
38 configure: configure-stamp
39 configure-stamp:
40         dh_testdir
41         CFLAGS="$(CFLAGS)" ./configure \
42                 --host=$(DEB_HOST_GNU_TYPE) \
43                 --build=$(DEB_BUILD_GNU_TYPE) \
44                 --prefix=/usr/sbin/ \
45                 --with-wwwdir=/usr/share/citadel-webcit \
46                 --with-localedir=/usr/share/ \
47                 --with-editordir=/usr/share/tinymce/www \
48                 --with-rundir=/var/run/citadel \
49                 --with-ical --with-db --with-ldap \
50                 --with-ssldir=/etc/ssl/webcit/ \
51                 $(ZLIB_ARGS) --with-ssl --with-libiconf \
52                 --with-newt --with-included-gettext \
53                 --with-datadir=/var/run/citadel \
54                 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
55
56         touch configure-stamp
57
58
59 build: build-stamp
60
61 build-stamp: configure-stamp 
62         dh_testdir
63
64 # Add here commands to compile the package.
65         $(MAKE)
66 #docbook-to-man debian/webcit.sgml > webcit.1
67
68         touch build-stamp
69
70 clean:
71         dh_testdir
72         dh_testroot
73         rm -f build-stamp configure-stamp
74
75 # Add here commands to clean up after the build process.
76         -$(MAKE) clean
77
78         dh_clean 
79
80 install: build
81         dh_testdir
82         dh_testroot
83         dh_clean -k 
84         dh_installdirs
85         $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
86         rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
87 #       mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
88
89
90
91 # Build architecture-independent files here.
92 binary-indep: build install
93 # We have nothing to do by default.
94
95 # Build architecture-dependent files here.
96 binary-arch: build install
97         dh_testdir
98         dh_testroot
99         dh_installchangelogs
100         dh_installdocs
101         dh_installexamples
102         dh_install
103 #       dh_installmenu
104         dh_installdebconf       
105 #       dh_installlogrotate
106 #       dh_installemacsen
107 #       dh_installpam
108 #       dh_installmime
109         dh_installinit --name=webcit
110 #       dh_installcron
111 #       dh_installinfo
112         dh_installman
113         dh_link
114         dh_strip
115         dh_compress
116         dh_fixperms
117 #       dh_perl
118 #       dh_python
119 #       dh_makeshlibs
120         dh_installdeb
121         dh_shlibdeps
122         dh_gencontrol
123         dh_md5sums
124         dh_builddeb
125
126 binary: binary-indep binary-arch
127 .PHONY: build clean binary-indep binary-arch binary install configure