#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PKGNAME=citadel-webcit DESTDIR=$(CURDIR)/debian/$(PKGNAME) export DEB_BUILD_MAINT_OPTIONS=hardening=+all CFLAGS = `dpkg-buildflags --get CFLAGS` CFLAGS += `dpkg-buildflags --get CPPFLAGS` LDFLAGS = `dpkg-buildflags --get LDFLAGS` EXTRA_ARGS= PROFILE_ARGS= #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling" ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS))) PROFILE_ARGS= --with-gprof endif ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW LDFLAGS += -pg EXTRA_ARGS = --with-backtrace else CFLAGS += -O2 endif ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS))) CFLAGS += -D DEBUG_URLSTRINGS endif %: dh ${@} --with quilt override_dh_auto_configure: dh_testdir CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr/sbin/ \ --with-wwwdir=/usr/share/citadel-webcit \ --with-localedir=/usr/share/ \ --with-editordir=/usr/share/tinymce/www \ --with-rundir=/var/run/citadel \ --with-ssldir=/etc/ssl/webcit/ \ --with-ssl \ --with-datadir=/var/run/citadel \ $(EXTRA_ARGS) $(PROFILE_ARGS) override_dh_auto_clean: dh_auto_clean -rm -f Makefile config.log po/Makefile sysdep.h po/webcit/Makefile tests/Makefile override_dh_auto_install: dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR) find $(DESTDIR)/usr/share/citadel-webcit/static -type f -exec chmod a-x {} \; test ! -d $(DESTDIR)/var/lib/citadel-webcit || mv $(DESTDIR)/usr/share/citadel-webcit/static.local $(DESTDIR)/var/lib/citadel-webcit find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \; rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js rm $(DESTDIR)/usr/share/citadel-webcit/static/scriptaculous.js rm $(DESTDIR)/usr/share/citadel-webcit/static/.gitignore override_dh_installinit: dh_installinit --name=webcit override_dh_strip: dh_strip -a