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.
9 # Uncomment this to turn on verbose mode.
12 include /usr/share/quilt/quilt.make
14 upstreamversion := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p')
16 DESTDIR=$(CURDIR)/debian/citadel-webcit
20 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug iodbg"
22 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
23 PROFILE_ARGS= --with-gprof
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
32 ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
33 CFLAGS += -D DEBUG_URLSTRINGS
36 ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS)))
37 CFLAGS += -D SERV_TRACE
41 configure: patch configure-stamp
44 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
45 cp -f /usr/share/misc/config.sub config.sub
47 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
48 cp -f /usr/share/misc/config.guess config.guess
50 CFLAGS="$(CFLAGS)" ./configure \
51 --host=$(DEB_HOST_GNU_TYPE) \
52 --build=$(DEB_BUILD_GNU_TYPE) \
54 --with-wwwdir=/usr/share/citadel-webcit \
55 --with-localedir=/usr/share/ \
56 --with-editordir=/usr/share/tinymce/www/ \
57 --with-rundir=/var/run/citadel \
58 --with-ssldir=/etc/ssl/webcit/ \
60 --with-datadir=/var/run/citadel \
61 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
68 build-stamp: configure-stamp
71 # Add here commands to compile the package.
76 clean: configure-stamp
79 rm -f build-stamp configure-stamp
81 # Add here commands to clean up after the build process.
82 [ ! -f Makefile ] || $(MAKE) clean
92 $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
93 chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/*
94 find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \;
95 rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
96 # mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
100 # Build architecture-independent files here.
101 binary-indep: build install
102 # We have nothing to do by default.
104 # Build architecture-dependent files here.
105 binary-arch: build install
113 dh_installinit --name=webcit
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install configure