Rev 41 | Rev 71 | 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.makeifdef CCVERCC=gcc-$(CCVER)elseCC=gccendififeq (,$(DEB_BUILD_ARCH))DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)endifCFLAGS_EXTRA = -gCPPFLAGS_EXTRA = -DDEBIANifdef SSPSSP_FLAGS=-fstack-protectorendifCFARGSEXTRA = --with-cdebugifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA += --without-coptelseCFARGSEXTRA += --with-coptendififneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA += --with-rtldebugelseCFARGSEXTRA += --without-rtldebugendifCFLAGS_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-codeendif#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)BUILD:=$(shell sed -ne 's/build://p' buildid.txt)PIKEV:=$(MAJOR).$(MINOR)VERSION:=$(MAJOR).$(MINOR).$(BUILD)PIKE:=pike$(PIKEV)ifneq ($(VERSION),$(DEBVERSION))$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))endifCFARGS=$(CFARGSEXTRA) \--with-cflags='$(CFLAGS_EXTRA)' \--with-cppflags='$(CPPFLAGS_EXTRA)' \--with-bignums \--with-gmp \--with-poll \--with-zlib \--with-freetype \--without-ttflib \--with-libnettle \--without-sybase \--without-java \--with-odbc \--with-sane \--with-postgres \--with-postgres-include-dir=`pg_config --includedir` \--with-libpq-dir=/usr/lib \--without-ffmpeg \--without-fftw \--without-libpdf \--without-libpanda \--without-GTK \--with-GTK2 \--without-bundles \--without-oracle \--without-dvb \--with-sqlite \--disable-rpath \--disable-smartlink_binary \--with-relocatable-dumped-modules \$(MACHINE_OPTS) $(EXTRA_ARGS)include_prefix=/usr/include/pike/$(VERSION)lib_prefix=/usr/lib/pike/$(VERSION)MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core -N $(PIKE)-dev)#{ADT,Array,Audio,Cache,Calendar,Calendar_I,COM,Colors,CommonLog,Crypto,Debug,Filesystem,Error,Float,Function,Geography,Getopt,Gettext,Gmp,Graphics,Gz,HTTPAccept,Int,Kerberos,Languages,Local,Locale,Mapping,Math,MIME,Mird,Multiset,Nettle,Parser,Pike,Pipe,Process,Program,Protocols,Regexp,Remote,SSL,Shuffler,Standards,Stdio,String,System,Thread,Tools,Unicode,Web,Yabu,Yp,_ADT,_Charset,_Roxen,___Gz,___MIME,___Math,___Mird,___Regexp,___Yp,____Charset,__builtin*,spider}.#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF# This is tricky. Note that it's only possible for an exclusion to match the last# component specified in an .install file or on the command line, and below.DH_EXCLUDE:=$(addprefix -X,$(excluded_modules))DH_ALREADY=`for p in $(MODULE_PACKAGES); do \find debian/$$p/usr/lib/pike/*/* -type f -printf "-X%P "; done`TMP=$(CURDIR)/debian/tmp#export CFLAGS CC PIKE VERSIONexport CCbuild-arch: build-arch-stampbuild-arch-stamp: $(DPATCH_STAMPFN)dh_testdir$(MAKE) compile CONFIGUREARGS="$(CFARGS)"touch build-arch-stampbuild-indep: build-indep-stampbuild-indep-stamp: $(DPATCH_STAMPFN)dh_testdir$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"touch build-indep-stampbuild: build-archclean: clean-patched unpatchdh_cleanclean-patched:dh_testdirdh_testrootrm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp$(MAKE) distcleanrm -rf refdoc/modref refdoc/traditional_manualinstall: DH_OPTIONS=install: build-archdh_testdirdh_testrootdh_clean -k$(MAKE) INSTALLARGS=--traditional \buildroot=$(TMP) \prefix=/usr \man_prefix=/usr/share/man \lib_prefix="$(lib_prefix)" \include_prefix="$(include_prefix)" \pike_name=/usr/bin/$(PIKE) \install_nodoc# Some cleaningfind "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'install -d -m755 $(TMP)/usr/share/pixmapsinstall -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpmmv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1# Fix permissions and shebang lines-for f in `find $(TMP)/usr/bin $(TMP)/usr/lib -type f`; do \if file $$f | grep -q "script"; then \chmod a+x $$f; \sed -ri -e 's@#!.*NOMODULE@#!/usr/bin/$(PIKE)@' \-e 's@#! */usr/local/bin/pike@#!/usr/bin/$(PIKE)@' \-e 's@#! */usr/bin/env.*pike@#!/usr/bin/$(PIKE)@' \$$f; \fi; \done# Don't install our own specs file - the ordinary one is not that bad really# sed -e 's/@PIKEVERSION@/$(VERSION)/g' \-e 's;@CONFIGURE_ARGS@;$(CFARGS);g' \debian/specs.in > $(TMP)$(include_prefix)/specs# Install pike-configsed -e "s#@CFLAGS@#-I$(include_prefix)#;s/@LDFLAGS@//" \-e "s/@MAJOR@/$(MAJOR)/;s/@MINOR@/$(MINOR)/;s/@BUILD@/$(BUILD)/" \debian/pike-config.in > $(TMP)/usr/bin/$(PIKE)-config# # pike -x module fix# sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \# $(TMP)$(include_prefix)/modules/dynamic_module_makefile# Build architecture-independent files here.# Pass -i to all debhelper commands in this target to reduce clutter.binary-indep: build-indepdh_testdir -idh_testroot -i# install the docsdh_install -p$(PIKE)-manual refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manualdh_install -p$(PIKE)-reference refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/referencedh_install -i -N$(PIKE)-manual -N$(PIKE)-reference --sourcedir=$(TMP)dh_installdocs -idh_installchangelogs -i -k CHANGESdh_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 -adh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)for p in $(MODULE_PACKAGES) $(PIKE)-dev; do \dh_link -p$$p usr/share/doc/$(PIKE)-core usr/share/doc/$$p; \donedh_installdocs -adh_installmenu -adh_installchangelogs -a -k CHANGESdh_strip -adh_compress -adh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuitedh_installdeb -adh_shlibdeps -adh_gencontrol -adh_md5sums -adh_builddeb -abinary: binary-indep binary-arch.PHONY: build clean binary-indep binary-arch binary install configure