#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Include dpatch stuff. include /usr/share/dpatch/dpatch.make CFLAGS = -Wall -g MAKE_FLAGS = messages=yes OPTFLAG=-O0 GNUSTEP_SETUP=/usr/lib/opengroupware.org/System/Library/Makefiles/GNUstep.sh OGOVER=1.0 OGOSONAME=5.2 ZSVER=1.4 SOPEVER := $(shell COLUMNS=200 dpkg -l libsope-xml*-dev |grep ^ii | awk '{print $$2}' | sed -e s/^libsope-xml// -e s/-dev//) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif controlfiles: controlfiles-stamp debian/control controlfiles-stamp: debian/rules clean-controlfiles for f in debian/*.in; do \ newname=$$(echo $$f | sed s/.in$$// ); \ sed -e s/_OGOVER_/$(OGOVER)/g -e s/_OGOSONAME_/$(OGOSONAME)/g \ -e s/_ZSVER_/$(ZSVER)/g -e s/_SOPEVER_/$(SOPEVER)/g < $$f > $$newname; \ done for f in debian/*_OGOVER_*; do \ newname=$$(echo $$f | sed s/_OGOVER_/$(OGOVER)/ ); \ cp $$f $$newname; \ echo $$newname >> controlfiles.tmp; \ done for f in debian/*_OGOSONAME_*; do \ newname=$$(echo $$f | sed s/_OGOSONAME_/$(OGOSONAME)/ ); \ cp $$f $$newname; \ echo $$newname >> controlfiles.tmp; \ done for f in debian/*_ZSVER_*; do \ newname=$$(echo $$f | sed s/_ZSVER_/$(ZSVER)/ ); \ cp $$f $$newname; \ echo $$newname >> controlfiles.tmp; \ done mv controlfiles.tmp controlfiles-stamp clean-controlfiles: if [ -f controlfiles-stamp ]; then \ for f in $$(cat controlfiles-stamp); do \ rm $$f; \ done; \ rm controlfiles-stamp; \ fi if [ -f controlfiles.tmp ]; then \ for f in $$(cat controlfiles-stamp); do \ rm $$f; \ done; \ rm controlfiles.tmp; \ fi debian/control: debian/control.in debian/rules sed -e s/_OGOVER_/$(OGOVER)/g -e s/_OGOSONAME_/$(OGOSONAME)/g -e s/_ZSVER_/$(ZSVER)/g < debian/control.in > debian/control build: build-stamp build-stamp: patch-stamp controlfiles dh_testdir CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \ $(MAKE) $(MAKE_FLAGS) all touch build-stamp clean: unpatch clean-controlfiles dh_testdir dh_testroot rm -f build-stamp -. $(GNUSTEP_SETUP); $(MAKE) clean -. $(GNUSTEP_SETUP); $(MAKE) distclean dh_clean install: build controlfiles dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \ $(MAKE) $(MAKE_FLAGS) install \ GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/$$GNUSTEP_SYSTEM_ROOT \ FHS_INSTALL_ROOT=$(CURDIR)/debian/tmp/usr rm -rf $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/translations rm -rf $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/templates rm -rf $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/www mkdir $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/translations cp -R WebUI/Resources/* $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/translations mkdir $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/templates cp -R WebUI/Templates/* $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/templates mkdir $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/www cp -R Themes/WebServerResources/* $(CURDIR)/debian/tmp/usr/share/opengroupware.org-$(OGOVER)/www -find $(CURDIR)/debian/tmp -name .svn -type d -exec rm -rf \{\} \; mkdir -p $(CURDIR)/debian/opengroupware.org-environment/usr/sbin install -m755 $(CURDIR)/debian/ogo-create-instance $(CURDIR)/debian/opengroupware.org-environment/usr/sbin install -m755 $(CURDIR)/debian/ogo-remove-instance $(CURDIR)/debian/opengroupware.org-environment/usr/sbin mkdir -p $(CURDIR)/debian/tmp/etc/apache/conf.d/ mkdir -p $(CURDIR)/debian/tmp/etc/apache2/conf.d/ mkdir -p $(CURDIR)/debian/tmp/etc/opengroupware.org/ echo "Alias /OpenGroupware$$(echo $(OGOVER) | sed s/\\.//).woa/WebServerResources/ \ /usr/share/opengroupware.org-$(OGOVER)/www/" > \ $(CURDIR)/debian/tmp/etc/opengroupware.org/apache-resources-$(OGOVER) # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_install --sourcedir=debian/tmp # dh_installmenu dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinfo dh_installinit -n -popengroupware.org-environment --init-script=opengroupware.org -- defaults 80 dh_installman dh_link -popengroupware.org$(OGOVER)-webui-app usr/share/man/man7/undocumented.7.gz usr/share/man/man8/ogo-webui-$(OGOVER).8.gz dh_link -popengroupware.org$(OGOVER)-xmlrpcd usr/share/man/man7/undocumented.7.gz usr/share/man/man8/ogo-xmlrpcd-$(OGOVER).8.gz dh_link -popengroupware.org$(OGOVER)-nhsd usr/share/man/man7/undocumented.7.gz usr/share/man/man8/ogo-nhsd-$(OGOVER).8.gz dh_link -popengroupware.org-zidestore$(ZSVER) usr/share/man/man7/undocumented.7.gz usr/share/man/man8/ogo-zidestore-$(ZSVER).8.gz dh_link -popengroupware.org$(OGOVER)-webui-app etc/opengroupware.org/apache-resources-$(OGOVER) \ etc/apache/conf.d/opengroupware.org-resources-$(OGOVER) dh_link -popengroupware.org$(OGOVER)-webui-app etc/opengroupware.org/apache-resources-$(OGOVER) \ etc/apache2/conf.d/opengroupware.org-resources-$(OGOVER) dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_python dh_makeshlibs -V dh_installdeb dh_shlibdeps -L libopengroupware.org-docapi$(OGOSONAME) -L libopengroupware.org-logic$(OGOSONAME) \ libopengroupware.org-webui-foundation$(OGOSONAME) -L libopengroupware.org-zidestore$(ZSVER) \ -L libopengroupware.org-webmail$(OGOSONAME) -l debian/tmp/usr/lib dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure