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
22 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug iodbg clang"
24 ifneq (,$(findstring clang,$(DEB_BUILD_OPTIONS)))
27 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
28 PROFILE_ARGS= --with-gprof
31 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
32 CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW -pedantic -Wformat-nonliteral -Wmaybe-uninitialized -Wunused-variable
33 EXTRA_ARGS = --with-backtrace
37 ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
38 CFLAGS += -D DEBUG_URLSTRINGS
41 ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS)))
42 CFLAGS += -D SERV_TRACE
46 configure: patch configure-stamp
49 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
50 cp -f /usr/share/misc/config.sub config.sub
52 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
53 cp -f /usr/share/misc/config.guess config.guess
55 export CC=$(COMPILER); export CFLAGS=" -Wformat -Werror=format-security $(CFLAGS)"; ./configure \
56 --host=$(DEB_HOST_GNU_TYPE) \
57 --build=$(DEB_BUILD_GNU_TYPE) \
59 --with-wwwdir=/usr/share/citadel-webcit \
60 --with-localedir=/usr/share/ \
61 --with-editordir=/usr/share/tinymce/www/ \
62 --with-rundir=/var/run/citadel \
63 --with-ssldir=/etc/ssl/webcit/ \
64 --with-etcdir=/etc/citadel \
66 --with-datadir=/var/run/citadel \
67 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
74 build-stamp: configure-stamp
77 # Add here commands to compile the package.
82 clean: configure-stamp
85 rm -f build-stamp configure-stamp
87 # Add here commands to clean up after the build process.
88 [ ! -f Makefile ] || $(MAKE) clean
98 $(MAKE) install-bin install-locale install-wwwdata install-cfg DESTDIR=$(DESTDIR)
99 chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/*
100 find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \;
101 rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
102 # mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
106 # Build architecture-independent files here.
107 binary-indep: build install
108 # We have nothing to do by default.
110 # Build architecture-dependent files here.
111 binary-arch: build install
119 dh_installinit --name=webcit
131 binary: binary-indep binary-arch
132 .PHONY: build clean binary-indep binary-arch binary install configure