1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
upstreamversion := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)[0-9]-.\+/\1/p')
upstreampatchlevel := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p')
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=
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 autotools-dev,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
override_dh_installinit:
dh_installinit --name=webcit
override_dh_strip:
dh_strip --dbg-package=webcit-dbg -a
dfsg-free:
rm -rf static/webcit_icons/openid-32x32.gif static/webcit_icons/openid-small.gif tiny_mce
cd ..; mv $(CURDIR) webcit-$(upstreampatchlevel)-dfsg; \
tar --exclude debian -czf webcit_$(upstreampatchlevel)-dfsg.orig.tar.gz \
webcit-$(upstreampatchlevel)-dfsg
|