#!/usr/bin/make -f # -*- makefile -*- # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEBIAN_DIR := $(shell echo ${MAKEFILE_LIST} | awk '{print $$1}' | xargs dirname ) USVERSION := $(shell uscan --dehs | sed -n 's/.*\(.*\)<\/upstream-version>.*/\1/p') configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build: build-stamp dpatch apply-all build-stamp: configure-stamp dh_testdir touch $@ unpatch: dpatch deapply-all clean: unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp rm -f $(CURDIR)/doc/index.html dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Useful index to docs cp $(CURDIR)/debian/openlayers-doc-index.html $(CURDIR)/doc/index.html # apache site for allowing users to turn on OpenLayers easily cp $(CURDIR)/debian/openlayers-apache-conf $(CURDIR)/debian/openlayers-apache/etc/apache2/sites-available/openlayers # The actual library + supporting files cd $(CURDIR)/build/ && python build.py full $(CURDIR)/debian/openlayers/usr/share/openlayers/www/OpenLayers.js cp -r $(CURDIR)/img/* $(CURDIR)/debian/openlayers/usr/share/openlayers/www/img cp -r $(CURDIR)/theme/* $(CURDIR)/debian/openlayers/usr/share/openlayers/www/theme # Uncompressed files -- used by openlayers_build in openlayers-utils, # also essentially provide the 'source' form rather than a solely # compressed form. cp -r $(CURDIR)/lib/* $(CURDIR)/debian/openlayers/usr/share/openlayers/lib # License file accomodated for in copyright rm $(CURDIR)/debian/openlayers/usr/share/openlayers/lib/Firebug/license.txt # Needed for openlayers_build cp $(CURDIR)/tools/minimize.py $(CURDIR)/debian/openlayers-utils/usr/lib/openlayers-utils cp $(CURDIR)/tools/mergejs.py $(CURDIR)/debian/openlayers-utils/usr/lib/openlayers-utils chmod -x $(CURDIR)/debian/openlayers-utils/usr/lib/openlayers-utils/mergejs.py sed -i -e 's?#!/usr/bin/env python??' $(CURDIR)/debian/openlayers-utils/usr/lib/openlayers-utils/mergejs.py cp $(CURDIR)/tools/toposort.py $(CURDIR)/debian/openlayers-utils/usr/lib/openlayers-utils cp $(CURDIR)/build/license.txt $(CURDIR)/debian/openlayers-utils/usr/share/openlayers-utils/build cp $(CURDIR)/build/lite.cfg $(CURDIR)/debian/openlayers-utils/usr/share/openlayers-utils/build cp $(CURDIR)/build/full.cfg $(CURDIR)/debian/openlayers-utils/usr/share/openlayers-utils/build cp $(CURDIR)/build/build.py $(CURDIR)/debian/openlayers-utils/usr/bin/openlayers_build sed -i -e 's!../lib!/usr/share/openlayers-utils/lib!' \ -e 's!../tools!/usr/lib/openlayers-utils!' \ -e 's!license.txt!/usr/share/openlayers-utils/build/license.txt!' \ -e 's!library.cfg!/usr/share/openlayers-utils/build/lite.cfg!' \ $(CURDIR)/debian/openlayers-utils/usr/bin/openlayers_build binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # Clean up examples: fix references to library path, and remove unneccesary files find $(CURDIR)/debian/openlayers/usr/share/doc/openlayers/examples -name '*.html' | \ xargs sed -i -e 's!\.\./lib/OpenLayers.js!/openlayers/OpenLayers.js!' rm $(CURDIR)/debian/openlayers/usr/share/doc/openlayers/examples/proxy.cgi rm $(CURDIR)/debian/openlayers/usr/share/doc/openlayers/examples/kamap.txt dh_installman dh_link dh_strip dh_compress -X.js -Xexamples dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install # nothing is architecture dependent binary: binary-indep binary-arch get-orig-source: cd ${DEBIAN_DIR}/.. @test -d tarballs || mkdir -p tarballs wget -O tarballs/OpenLayers-$(USVERSION).tar.gz http://openlayers.org/download/OpenLayers-$(USVERSION).tar.gz tar -zxf tarballs/OpenLayers-$(USVERSION).tar.gz -C tarballs rm tarballs/OpenLayers-$(USVERSION)/tools/jsmin.* rm tarballs/OpenLayers-$(USVERSION)/OpenLayers.js mv tarballs/OpenLayers-$(USVERSION) tarballs/OpenLayers-$(USVERSION).orig cd tarballs && tar -czf openlayers_$(USVERSION).dfsg.orig.tar.gz OpenLayers-$(USVERSION).orig unpack: get-orig-source cp tarballs/openlayers_$(USVERSION).dfsg.orig.tar.gz . rm -rf OpenLayers-$(USVERSION).orig tar -zvxf openlayers_$(USVERSION).dfsg.orig.tar.gz pre-build: unpack cd OpenLayers-$(USVERSION).orig && \ svn export http://svn.openlayers.org/sandbox/crschmidt/debian/ .PHONY: build clean binary-indep binary-arch binary install configure