X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fdebian%2Frules;h=cd0a58efb6ba21143fa8755eec7df37de41fbf46;hb=3dd282daca51256fe10f464a9397625d67e96489;hp=10d6d8fb74557ae5214ef61438a7c5b6d74a67d4;hpb=142845b3e1e6550e350957b9d24656991eeed942;p=citadel.git diff --git a/webcit/debian/rules b/webcit/debian/rules index 10d6d8fb7..cd0a58efb 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -9,52 +9,83 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/quilt/quilt.make +upstreamversion := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p') +DESTDIR=$(CURDIR)/debian/citadel-webcit -CFLAGS = -Wall -g -ggdb +EXTRA_ARGS= +PROFILE_ARGS= +COMPILER= +CFLAGS= +#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug iodbg clang" -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 +ifneq (,$(findstring clang,$(DEB_BUILD_OPTIONS))) + COMPILER="clang" +endif +ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS))) + PROFILE_ARGS= --with-gprof + LDFLAGS += -pg +endif +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW -pedantic -Wformat-nonliteral + EXTRA_ARGS = --with-backtrace else - CFLAGS += -O0 -ggdb + CFLAGS += -O2 +endif +ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -D DEBUG_URLSTRINGS +endif + +ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS))) + CFLAGS += -D SERV_TRACE endif -configure: configure-stamp + +configure: patch configure-stamp configure-stamp: dh_testdir - rm -rf $(CURDIR)/debian/webcit $(CURDIR)/debian/citadel-webcit $(CURDIR)/debian/citadel-webcit-apache - CFLAGS="$(CFLAGS)" ./configure \ +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + export CC=$(COMPILER); export CFLAGS=" -Wformat -Werror=format-security $(CFLAGS)"; ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ - --prefix=/usr \ - --with-staticdir=/usr/share/doc/citadel-webcit/examples \ - --with-staticrundir=/var/lib/citadel/www/ \ - --with-editordir=/usr/share/ \ + --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-ical --with-db --with-ldap --with-zlib --with-ssl --with-libiconf --with-newt --with-included-gettext + --with-ssldir=/etc/ssl/webcit/ \ + --with-ssl \ + --with-datadir=/var/run/citadel \ + --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) touch configure-stamp -#we don't do /usr/share/tiny_mce, because of make brings one with it. + build: build-stamp -build-stamp: configure-stamp +build-stamp: configure-stamp dh_testdir - # Add here commands to compile the package. +# Add here commands to compile the package. $(MAKE) - #docbook-to-man debian/webcit.sgml > webcit.1 touch build-stamp -clean: +clean: configure-stamp dh_testdir dh_testroot rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. - -$(MAKE) clean +# Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) clean + debconf-updatepo dh_clean @@ -63,16 +94,12 @@ install: build dh_testroot dh_clean -k dh_installdirs + $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR) + chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/* + find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \; + rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js +# mkdir -p $(DESTDIR)/etc/citadel; cp webcit.conf $(DESTDIR)/etc/citadel/ -# Add here commands to install the package into debian/webcit. - root=$(CURDIR)/debian/webcit/ - export root=$(CURDIR)/debian/citadel-webcit; \ - $(MAKE) install DESTDIR=$(CURDIR)/debian/citadel-webcit - mkdir -p $(CURDIR)/debian/citadel-webcit/usr/lib/citadel-webcit ;\ - mv $(CURDIR)/debian/citadel-webcit/usr/sbin/setup \ - $(CURDIR)/debian/citadel-webcit/usr/lib/citadel-webcit/; \ - cd $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/ && \ - md5sum `find -type f |grep -v md5sums `>md5sums; \ # Build architecture-independent files here. @@ -83,14 +110,12 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs ChangeLog + dh_installchangelogs dh_installdocs dh_installexamples -# dh_install + dh_install dh_installdebconf -# dh_installlogrotate -# dh_installinit -# dh_installcron + dh_installinit --name=webcit dh_installman dh_link dh_strip