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