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
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/ \
65 --with-datadir=/var/run/citadel \
66 --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS)
73 build-stamp: configure-stamp
76 # Add here commands to compile the package.
81 clean: configure-stamp
84 rm -f build-stamp configure-stamp
86 # Add here commands to clean up after the build process.
87 [ ! -f Makefile ] || $(MAKE) clean
97 $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
98 chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/*
99 find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \;
100 rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
101 # mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/
105 # Build architecture-independent files here.
106 binary-indep: build install
107 # We have nothing to do by default.
109 # Build architecture-dependent files here.
110 binary-arch: build install
118 dh_installinit --name=webcit
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install configure