* remove obsolete configure options
[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 include /usr/share/quilt/quilt.make
13
14 upstreamversion := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p')
15
16 DESTDIR=$(CURDIR)/debian/citadel-webcit
17
18 EXTRA_ARGS=
19 PROFILE_ARGS=
20 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug"
21
22 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
23         PROFILE_ARGS= --with-gprof
24         LDFLAGS += -pg 
25 endif
26 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW -pedantic -Wformat-nonliteral
28         EXTRA_ARGS =  --with-backtrace
29 else
30         CFLAGS += -O2
31 endif
32 ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
33         CFLAGS += -D DEBUG_URLSTRINGS
34 endif
35
36 configure: patch configure-stamp
37 configure-stamp:
38         dh_testdir
39 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
40         cp -f /usr/share/misc/config.sub config.sub
41 endif
42 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
43         cp -f /usr/share/misc/config.guess config.guess
44 endif
45         CFLAGS="$(CFLAGS)" ./configure \
46                 --host=$(DEB_HOST_GNU_TYPE) \
47                 --build=$(DEB_BUILD_GNU_TYPE) \
48                 --prefix=/usr/sbin/ \
49                 --with-wwwdir=/usr/share/citadel-webcit \
50                 --with-localedir=/usr/share/ \
51                 --with-editordir=/usr/share/tinymce/www/ \
52                 --with-rundir=/var/run/citadel \
53                 --with-ssldir=/etc/ssl/webcit/ \
54                 --with-ssl \
55                 --with-datadir=/var/run/citadel \
56                 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
57
58         touch configure-stamp
59
60
61 build: build-stamp
62
63 build-stamp: configure-stamp
64         dh_testdir
65
66 # Add here commands to compile the package.
67         $(MAKE)
68
69         touch build-stamp
70
71 clean: configure-stamp
72         dh_testdir
73         dh_testroot
74         rm -f build-stamp configure-stamp
75
76 # Add here commands to clean up after the build process.
77         [ ! -f Makefile ] || $(MAKE) clean
78         debconf-updatepo
79
80         dh_clean 
81
82 install: build
83         dh_testdir
84         dh_testroot
85         dh_clean -k 
86         dh_installdirs
87         $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
88         chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/*
89         find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \;
90         rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
91 #       mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
92
93
94
95 # Build architecture-independent files here.
96 binary-indep: build install
97 # We have nothing to do by default.
98
99 # Build architecture-dependent files here.
100 binary-arch: build install
101         dh_testdir
102         dh_testroot
103         dh_installchangelogs
104         dh_installdocs
105         dh_installexamples
106         dh_install
107         dh_installdebconf       
108         dh_installinit --name=webcit
109         dh_installman
110         dh_link
111         dh_strip
112         dh_compress
113         dh_fixperms
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