#!/usr/bin/make -f # Made with the aid of debmake, by Christoph Lameter, # based on the sample debian/rules file for GNU hello by Ian Jackson. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS package=mapserver version=$(shell expr `pwd` : '.*-\([0-9.]*\)') version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*') CURDIR := $(shell pwd) PYVERS=$(shell pyversions -r debian/control) RUBYVERS=1.8 PHP5API=$(shell php-config5 --phpapi) PHP5DIR=$(shell php-config5 --extension-dir) # Configure config : # Not using non free libpdf # Explicit disable direct goetiff support, # it's better to use gdal geotiff support for stability reasons COMMON_CONFIG= --prefix=/usr \ --enable-debug \ --without-tiff \ --without-pdf \ --with-gd=/usr \ --with-freetype=/usr \ --with-fribidi-config \ --with-ming \ --with-zlib=/usr \ --with-png=/usr \ --with-xpm=/usr \ --with-jpeg=/usr \ --with-gdal \ --with-ogr \ --with-proj \ --with-eppl \ --with-postgis \ --with-wcs \ --with-sos \ --with-wms \ --with-wmsclient \ --with-wfs \ --with-wfsclient \ --with-threads \ --with-geos \ --with-fastcgi \ --with-agg \ --with-experimental-png \ --with-kml \ --with-cairo \ --with-xml-mapfile rstoptions=--stylesheet=mapscript.css --link-stylesheet MS_CFLAGS=-g -O2 MS_CXXFLAGS=$(MS_CFLAGS) configure-stamp: patch dh_testdir ./configure $(COMMON_CONFIG) CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)" touch configure-stamp configure-php5-stamp: patch clean-first-build dh_testdir ./configure $(COMMON_CONFIG) \ --with-php=/usr/include/php5 CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)" touch configure-php5-stamp # This is the correct, policy-compliant build target #build: build-indep build-arch # This is the incorrect, non-policy compliant build target # it is nessecary because the auto-builders use build, but don't install Build-Depends-Indep build: build-arch build-indep: build-indep-stamp build-indep-stamp: dh_testdir touch build-indep-stamp build-arch: build-arch-stamp build-arch-stamp: configure-stamp dh_testdir # Build binary lib $(MAKE) mapscriptvars || touch mapscriptvars $(MAKE) # Build Perl mapscript cd $(CURDIR)/mapscript/perl && \ perl Makefile.PL INSTALLDIRS=vendor \ && $(MAKE) LD_RUN_PATH="" OPTIMIZE="-O2 -g -W -Wall" # Build python cd $(CURDIR)/mapscript/python && \ set -e; for python in $(PYVERS); do $$python setup.py build; done # Build ruby cd $(CURDIR)/mapscript/ruby && set -e ; \ for v in $(RUBYVERS) ; do \ ruby$$v extconf.rb && $(MAKE) && \ mv mapscript.so ruby$$v-mapscript.so ; \ done touch build-arch-stamp build-php5-stamp: configure-php5-stamp dh_testdir -cd mapscript/php && \ $(MAKE) clean # Build php_mapscript $(MAKE) # This is needed to do 'make clean', but will be removed by the clean # targets. The end result is that 'debuild clean' only can execute # once. Hack around this problem by faking the creation when make fail. clean-first-build: dh_testdir -$(RM) configure-stamp build-arch-stamp build-indep-stamp -$(RM) tile4ms [ ! -f $(CURDIR)/Makefile ] || $(MAKE) mapscriptvars touch mapscriptvars [ ! -f $(CURDIR)/mapscript/perl/Makefile ] || $(MAKE) distclean -C $(CURDIR)/mapscript/perl -cd mapscript/python && \ for python in $(PYVERS); do $$python setup.py clean; done -$(RM) -rf mapscript/python/build [ ! -f $(CURDIR)/mapscript/ruby/Makefile ] || $(MAKE) distclean -C $(CURDIR)/mapscript/ruby -$(RM) -rf $(CURDIR)/mapscript/ruby/mapscript_wrap.c -$(RM) mapscriptvars -$(RM) mapscript/perl/mapscript.i \ mapscript/tcl/mapscript.i \ mapscript/python/mapscript.i [ ! -f $(CURDIR)/Makefile ] || $(MAKE) distclean # Remove some generated files until 50_clean.dpatch is applied upstream. -$(RM) Makefile mapscript/java/Makefile -$(RM) mapscript/csharp/Makefile mapscript/php/Makefile -$(RM) config.log config.status -$(RM) debian/.#* .#* clean: unpatch clean-first-build dh_testdir dh_prep -$(RM) configure-php5-stamp build-php5-stamp install-arch-stamp install-indep-stamp install-php5-stamp [ ! -f Makefile ] || $(MAKE) distclean install-indep: install-indep-stamp install-indep-stamp: build-indep dh_testdir -i dh_testroot -i dh_installdirs -i dh_install -i touch install-indep-stamp install-arch: install-arch-stamp install-php5-stamp install-arch-stamp: build-arch dh_testdir -a dh_testroot -a dh_installdirs -a -mkdir -p debian/tmp/usr/lib/ debian/tmp/usr/include/ \ debian/tmp/usr/lib/cgi-bin/ \ debian/tmp/usr/bin # CGI mapserver install -m755 mapserv debian/tmp/usr/lib/cgi-bin/mapserv-gp # Perl mapscript cd $(CURDIR)/mapscript/perl && \ $(MAKE) install PREFIX=$(CURDIR)/debian/perl-mapscript/usr/ \ SITEPREFIX=$(CURDIR)/debian/perl-mapscript/usr/ # Python mapscript cd $(CURDIR)/mapscript/python && set -e ; \ for python in $(PYVERS); do \ $$python setup.py install --root=$(CURDIR)/debian/python-mapscript ; \ done # Ruby mapscript cd $(CURDIR)/mapscript/ruby && set -e ; \ for v in $(RUBYVERS) ; do \ ruby$$v extconf.rb ; \ $(MAKE) install sitedir=$(CURDIR)/debian/libmapscript-ruby$$v/usr/lib/ruby ; \ $(MAKE) distclean ; \ done # Mapserver Binary install -m755 legend scalebar shp2img shptree \ shptreetst shptreevis sortshp tile4ms msencrypt \ debian/tmp/usr/bin install -m755 shp2mysql.pl debian/tmp/usr/bin/shp2mysql touch install-arch-stamp install-php5-stamp: build-php5-stamp dh_testdir dh_testroot -mkdir -p debian/tmp$(PHP5DIR) # php5-mapscript install -m644 mapscript/php/php_mapscript.so \ debian/tmp$(PHP5DIR) echo 'misc:Depends=phpapi-'$(PHP5API) >> debian/php5-mapscript.substvars touch install-php5-stamp binary-indep: install-indep dh_testdir -i dh_testroot -i dh_installchangelogs -i HISTORY.TXT dh_installdocs -i dh_installexamples -i dh_installdebconf -i dh_compress -i -X.xml -X.xsd -X.xsl dh_link -i dh_lintian -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: install-arch dh_testdir -a dh_testroot -a dh_install --autodest --list-missing --sourcedir=debian/tmp dh_installchangelogs -a HISTORY.TXT dh_installdocs -a dh_installexamples -a chmod a-x debian/php*-mapscript/usr/share/doc/php*-mapscript/examples/*.phtml dh_installdebconf -a dh_pycentral -ppython-mapscript dh_compress -a dh_link -a # Overrides a mismatched error from lintian for pkg in $$(cat debian/lintian-overrides|cut -d: -f1); do \ echo "$$pkg: possible-gpl-code-linked-with-openssl" >debian/$$pkg.lintian-overrides; \ cat debian/$$pkg.lintian-overrides; \ done dh_lintian -a dh_strip -a dh_fixperms -a dh_makeshlibs -a dh_installdeb -a dh_shlibdeps -a dh_perl -pperl-mapscript dh_perl -pmapserver-bin dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary-indep binary-arch binary install install-indep install-arch include /usr/share/dpatch/dpatch.make