Rev 207 | 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=1ifdef CCVERCC=gcc-$(CCVER)elseCC=gccendifexport DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)CFARGSEXTRA := --with-cdebugifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))export CC=$(DEB_HOST_GNU_TYPE)-gccCFARGSEXTRA += --host=$(DEB_HOST_GNU_TYPE)endifDEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA += --without-coptelseifneq (,$(filter $(DEB_HOST_ARCH), i386))CFARGSEXTRA += --without-coptexport DEB_CFLAGS_MAINT_STRIP := -O2 -O3export DEB_CFLAGS_MAINT_PREPEND := -O1elseCFARGSEXTRA += --with-coptendifendififneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))CFARGSEXTRA += --with-rtldebugelseCFARGSEXTRA += --without-rtldebugendif# Temporary workaround for hppa linker issuesifeq ($(DEB_BUILD_ARCH),hppa)export DEB_CFLAGS_MAINT_APPEND += -ffunction-sectionsendifEXTRA_ARGS=--with-securityexport DEB_CPPFLAGS_MAINT_APPEND := -DDEBIANexport DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-neededDO_MACHINE_CODE=noifeq ($(DEB_HOST_ARCH),i386)DO_MACHINE_CODE=yesendififeq ($(DEB_HOST_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))endif# --with-lib-path is just to stop configure from adding all the# standard library directories with -L as well as -R to LDFLAGSCFARGS=$(CFARGSEXTRA) \--with-cflags='`dpkg-buildflags --get CFLAGS`' \--with-cppflags='`dpkg-buildflags --get CPPFLAGS`' \--with-ldflags='`dpkg-buildflags --get LDFLAGS`' \--prefix=/usr \--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 \$(MACHINE_OPTS) $(EXTRA_ARGS)include_prefix=/usr/include/pike$(PIKEV)/pikelib_prefix=/usr/lib/pike$(PIKEV)MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core)#{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 Gnome GDK GTKSupport ZXID# 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:dh_testdir$(MAKE) compile CONFIGUREARGS="$(CFARGS)"touch build-arch-stampbuild-indep: build-indep-stampbuild-indep-stamp:dh_testdir$(MAKE) documentation CONFIGUREARGS="$(CFARGS)"touch build-indep-stampbuild: build-archclean:dh_testdirdh_testrootrm -f build-stamp build-arch-stamp build-indep-stamp configure-stamp$(MAKE) distcleanrm -rf refdoc/modref refdoc/traditional_manualdh_cleaninstall: DH_OPTIONS=install: build-archdh_testdirdh_testrootdh_prep$(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# Simply strip exec permissions and shebangs from all pike scripts.find $(TMP)/usr -name *.p* -type f \-exec chmod a-x '{}' + \-exec sed -ri -e '1!b;/^#!/d' '{}' +# Install our own, simpler specs file.sed -e "s;@include_prefix@;$(include_prefix);g" \-e "s;@CONFIGURE_ARGS@;$(CFARGS);g" \debian/specs.in > $(TMP)$(include_prefix)/specs# Fix precompike.pikesed -i -e "s%\.\./lib%$(lib_prefix)%" $(TMP)$(include_prefix)/precompile.pike# # 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_lintian -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 -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); do \sed "s/#PACKAGE#/$$p/" debian/prerm-snippet >> debian/$$p.prerm.debhelper; \donedh_installdocs -a --link-doc=$(PIKE)-coredh_installmenu -adh_installchangelogs -a -k CHANGESdh_lintian -adh_link -adh_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