Rev 3 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/usr/bin/make -f# Sample debian/rules that uses debhelper.# GNU copyright 1997 by Joey Hess.## This version is for a hypothetical package that builds an# architecture-dependant package, as well as an architecture-independent# package.## $Id: rules,v 1.64 2006/08/05 15:49:18 grendel Exp $## Uncomment this to turn on verbose mode.#export DH_VERBOSE=1include /usr/share/dpatch/dpatch.makePIKEV=7.6PIKE=pike$(PIKEV)ifdef CCVERCC=gcc-$(CCVER)elseCC=gccendififeq (,$(DEB_BUILD_ARCH))DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)endifCPPFLAGS_EXTRA = -DDEBIANifdef SSPSSP_FLAGS=-fstack-protectorendififneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA=--without-rtldebug --without-cdebug --without-debug --without-coptelseCFARGSEXTRA=--without-rtldebug --without-cdebug --without-debugendif# Temporary workaround for hppa linker issuesifeq ($(DEB_BUILD_ARCH),hppa)CFLAGS_EXTRA += -ffunction-sectionsendififneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA += --with-rtldebug --with-cdebug --with-debugendifCFLAGS_EXTRA += $(SSP_FLAGS)# Temporary workaround for hppa linker issuesifeq ($(DEB_BUILD_ARCH),hppa)CFLAGS_EXTRA += -ffunction-sectionsendififeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))INSTALL_PROGRAM += -sendifEXTRA_ARGS=--with-securityDO_MACHINE_CODE=noifeq ($(DEB_BUILD_ARCH),i386)DO_MACHINE_CODE=yesendififeq ($(DEB_BUILD_ARCH),powerpc)DO_MACHINE_CODE=yesendififeq ($(DEB_BUILD_ARCH),sparc)DO_MACHINE_CODE=noendififeq ($(DO_MACHINE_CODE),yes)MACHINE_OPTS=--with-machine-codeelseMACHINE_OPTS=--without-machine-codeendifVERSION:=$(shell dpkg-parsechangelog | grep ^Version | sed -e 's/Version: //;s/-[^-]*$$//')OS=$(shell uname -srm|sed -e 's/ /-/g'|tr '[A-Z]' '[a-z]'|tr '/' '_')BUILDDIR=build/$(OS)CFARGS=$(CFARGSEXTRA) \--prefix=/usr--with-cflags="$(CFLAGS_EXTRA)" \--with-cppflags="$(CPPFLAGS_EXTRA)" \--with-bignums \--with-gmp \--with-poll \--with-zlib \--with-freetype \--with-ttflib \--with-libnettle \--without-libpdf \--without-libpanda \--without-sybase \--with-java \--with-odbc \--with-sane \--with-postgres \--with-postgres-include-dir=/usr/include/postgresql \--with-libpq-dir=/usr/lib \--with-perl \--without-ffmpeg \--without-libpdf \--without-libpanda $(MACHINE_OPTS) $(EXTRA_ARGS) \--without-GTK \--with-GTK2RUNPIKE=$(CURDIR)/$(BUILDDIR)/pike -DNOT_INSTALLED -DPRECOMPILED_SEARCH_MORE -m$(CURDIR)/$(BUILDDIR)/master.pikeRUNPIKE2=$(CURDIR)/debian/$(PIKE)-core/usr/bin/pike -m$(CURDIR)/$(BUILDDIR)/lib/master.pikePIKE_FAKEROOT=$(CURDIR)/debian/$(PIKE)-corePIKE_FAKEROOT_OMIT=$(BUILDDIR)*:$(CURDIR)/lib*:$(CURDIR)/src*:$(CURDIR)/bin*:$(CURDIR)/man*:$(BUILDDIR)/lib*:$(CURDIR)*:$(CURDIR)/debian/$(PIKE)-core*export CFLAGS CC PIKE VERSIONbuild-arch: build-arch-stampbuild-arch-stamp: $(DPATCH_STAMPFN)dh_testdir# Add here command to compile/build the package.$(MAKE) compile CONFIGUREARGS="$(CFARGS)"touch build-arch-stampbuild-indep: build-indep-stampbuild-indep-stamp: $(DPATCH_STAMPFN)dh_testdir# Add here command to compile/build the arch indep package.# It's ok not to do anything here, if you don't need to build# anything for this package.#/usr/bin/docbook-to-man debian/$(PIKE).sgml > $(PIKE).1$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"touch build-indep-stampbuild: build-arch build-indepclean: clean-patched unpatchdh_cleanrm -rf debian/pike7.6-gtkclean-patched:dh_testdirdh_testrootrm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp# Add here commands to clean up after the build process.-$(MAKE) distcleanrm -rf refdoc/modref refdoc/traditional_manualinstall: DH_OPTIONS=install: builddh_testdirdh_testrootdh_clean -kdh_installdirs# Add here commands to install the package into debian/tmp.$(MAKE) -C$(BUILDDIR)/ \buildroot=$(CURDIR)/debian/tmp \prefix=/usr/lib \pike_name=/usr/bin/$(PIKE) \include_prefix="/usr/include/pike/$(VERSION)/" \install# Some cleaning# -rm -f `find $(CURDIR)/debian/tmp/usr/lib/pike/$(VERSION)/ -name ".autodoc" -type f -print`# -@for f in `cat $(CURDIR)/debian/toremove.txt | sed -e 's/@PIKE@/$(PIKE)/g;s/@VERSION@/$(VERSION)/g'`; do \# echo Removing $(CURDIR)/debian/$(PIKE)-core/$$f ; \# rm $(CURDIR)/debian/$(PIKE)-core/$$f &> /dev/null || echo " FAILED"; \# done# an eye-candyinstall -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pixmaps/pikeinstall -m 644 -o root -g root $(CURDIR)/debian/pike.xpm $(CURDIR)/debian/$(PIKE)-core/usr/share/pixmaps/pike/$(PIKE).xpm# install the docsmkdir -p $(CURDIR)/debian/$(PIKE)-doc/usr/share/doc/$(PIKE)-doc/html/manualdh_install --sourcedir=$(CURDIR) -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manualmkdir -p $(CURDIR)/debian/$(PIKE)-manual/usr/share/doc/$(PIKE)-doc/html/manualinstall -m 644 -o root -g root $(CURDIR)/debian/dhelp.manual $(CURDIR)/debian/$(PIKE)-manual/usr/share/doc/$(PIKE)-doc/html/manual/.dhelpmkdir -p $(CURDIR)/debian/$(PIKE)-doc/usr/share/doc/$(PIKE)-doc/html/referencemkdir -p $(CURDIR)/debian/$(PIKE)-reference/usr/share/doc/$(PIKE)-doc/html/reference/dh_install --sourcedir=$(CURDIR) -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/referenceinstall -m 644 -o root -g root $(CURDIR)/debian/dhelp.refdoc $(CURDIR)/debian/$(PIKE)-reference/usr/share/doc/$(PIKE)-doc/html/reference/.dhelpln -sf ../lib/pike/$(VERSION)/bin/pike $(CURDIR)/debian/$(PIKE)-core/usr/bin/$(PIKE)install -m 644 -o root -g root $(CURDIR)/man/pike.1 $(CURDIR)/debian/$(PIKE)-core/usr/share/man/man1/$(PIKE).1rm -rf $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/man/install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/mv $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/include/pike \$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION) ; \rm -rf $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/includechmod 644 `find $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/ -type f -print`# move all the *.pmod and *.pike files to /usr/share recreating the structureinstall -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)for f in `(cd $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/ && find -name "*.pmod" -print -o -name "*.pike" -print)`; do \install -d -m 755 -o root -g root $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)/lib/`dirname $$f`/; \if [ -f $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/$$f ]; then \mv $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/lib/$$f $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION)/lib/$$f; \(echo /usr/share/pike/$(VERSION)/lib/$$f /usr/lib/pike/$(VERSION)/lib/$$f | sed -e 's#/./#/#g') >> $(CURDIR)/debian/links; \fi; \donedh_link && rm -f $(CURDIR)/debian/linkssed -e "`$(RUNPIKE) -e 'write("s#@CFLAGS@#%s#g;s/@LDFLAGS@//g;s/@MAJOR@/%d/g; s/@MINOR@/%d/g; s/@BUILD@/%d/g","-I/usr/include/pike/$(VERSION)/", __REAL_MAJOR__, __REAL_MINOR__, __REAL_BUILD__);'`" \$(CURDIR)/debian/pike-config.in > $(CURDIR)/debian/$(PIKE)-dev/usr/bin/$(PIKE)-config# Fix permissionsfind $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION) -type f -exec chmod -x '{}' ';'chmod 755 $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/bin/pikefor f in `find $(CURDIR)/debian/$(PIKE)-core/usr/bin -type f` \`find $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION) -type f` \`find $(CURDIR)/debian/$(PIKE)-core/usr/share/pike/$(VERSION) -type f`; \do \file $$f | grep "script" >/dev/null \&& perl -pi -e 's@#\!.*NOMODULE@#\!/usr/bin/$(PIKE)@' $$f \&& chmod a+x $$f; \file $$f | grep "script" >/dev/null \&& perl -pi -e 's@#\!.*/usr/local/bin/pike@#\!/usr/bin/$(PIKE)@' $$f; \file $$f | grep "script" >/dev/null \&& perl -pi -e 's@#\!.*/usr/bin/env.*pike@#\!/usr/bin/$(PIKE)@' $$f; \done; exit 0find build/ -name precompile.sh -exec 'cp {} $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)' \;find build/ -name smartlink -exec 'cp {} $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)' \;cp ./bin/fixdepends.sh ./bin/install_module ./bin/mktestsuite $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)# Some more permission changesfor f in run_autoconfig precompile.sh smartlink fixdepends.sh install_module mktestsuite; do \chmod 755 $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/$$f ; \done# Create the documentation links to save spacefor f in `cat $(CURDIR)/debian/tocoredoc.txt`; do \dh_link -p$$f /usr/share/doc/$(PIKE)-core /usr/share/doc/$$f ; \done# install the specs filesed -e 's/@PIKEVERSION@/$(VERSION)/g' \-e 's;@CONFIGURE_ARGS@;$(CFARGS);g' \< $(CURDIR)/debian/specs.in > $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/specs# pike -x module fixecho 's;\$$\(MODULE_BASE\)/dynamic_module_makefile;\$$\(PIKE_SRC_DIR\)/dynamic_module_makefile;g' > \$(CURDIR)/debian/sed-script.tmpsed -r -f $(CURDIR)/debian/sed-script.tmp < \$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile > \$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile.newmv $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile.new \$(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefilerm -f $(CURDIR)/debian/sed-script.tmprm -r $(CURDIR)/debian/$(PIKE)-core/usr/lib/pike/$(VERSION)/docdh_install --sourcedir=debian/tmp# Need to move dynamic_module_makefile back to -core, since it contains platform-specific stuff# mv $(CURDIR)/debian/$(PIKE)-dev/usr/include/pike/$(VERSION)/dynamic_module_makefile \# $(CURDIR)/debian/$(PIKE)-core/usr/include/pike/$(VERSION)/dynamic_module_makefile# Build architecture-independent files here.# Pass -i to all debhelper commands in this target to reduce clutter.binary-indep: build-indep installdh_testdir -idh_testroot -idh_installdocs -idh_installchangelogs -idh_link -idh_compress -idh_fixperms -idh_installdeb -idh_gencontrol -idh_md5sums -idh_builddeb -i# Build architecture-dependent files here.binary-arch: build-arch installdh_testdir -adh_testroot -a# dh_installdebconf -adh_installdocs -adh_installmenu -a -p$(PIKE)-coredh_installman -p$(PIKE)-core debian/tmp/usr/share/man/man1/$(PIKE).1dh_installchangelogs -adh_strip -adh_link -adh_compress -adh_fixperms -adh_installdeb -adh_shlibdeps -adh_gencontrol -adh_md5sums -adh_builddeb -abinary: binary-indep binary-arch.PHONY: build clean binary-indep binary-arch binary install configure