#!/usr/bin/make -f # debian/rules for gpsdrive # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 include /usr/share/dpatch/dpatch.make DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_VERSION := $(shell dpkg-parsechangelog |egrep '^Version:' | cut -f 2 -d ' ') DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-) DEB_UPSTREAM_VERSION := 2.10~pre4-6.dfsg UPSTREAM_VERSION := 2.10pre4 DESTDIR := ${CURDIR}/debian/tmp # MAPNIK_PATH = $(shell mapnik-plugin-base) CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif CFLAGS += -DMAPNIK_PATH=$(MAPNIK_PATH) get-orig-source: dh_testdir test -d ../tarballs/. || mkdir -p ../tarballs @echo Downloading gpsdrive-${UPSTREAM_VERSION} /usr/bin/wget -P ../tarballs/ -N http://gpsdrive.de/packages/gpsdrive-${UPSTREAM_VERSION}.tar.gz tar xzf ../tarballs/gpsdrive-${UPSTREAM_VERSION}.tar.gz -C ../tarballs/ @echo Removing upstream debian/ dir rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/debian/ @echo Remove gpsfetchmap.pl script. rm -f ../tarballs/gpsdrive-${UPSTREAM_VERSION}/scripts/gpsfetchmap.pl @echo Removing icons. rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/data/map-icons/japan/ rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION}/data/map-icons/nickw/ @echo Building tarball tar czf ../tarballs/gpsdrive_${DEB_UPSTREAM_VERSION}.orig.tar.gz -C ../tarballs gpsdrive-${UPSTREAM_VERSION} @echo Cleaning up rm -rf ../tarballs/gpsdrive-${UPSTREAM_VERSION} rm -f ../tarballs/gpsdrive-${UPSTREAM_VERSION}.tar.gz config.status: configure patch-stamp dh_testdir aclocal -I m4 --force automake --add-missing autoconf libtoolize -i -f ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --disable-mapnik \ --enable-dbus \ CFLAGS="$(CFLAGS)" build: build-arch build-indep build-arch: config.status build-arch-stamp build-arch-stamp: config.status dh_testdir $(MAKE) touch $@ build-indep: config.status build-indep-stamp build-indep-stamp: touch $@ clean: clean-patched unpatch clean-patched: dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp [ ! -f Makefile ] || $(MAKE) distclean dh_clean install: install-arch install-indep dh_prep install-arch: build-arch dh_testdir dh_testroot dh_installdirs -a $(MAKE) -C data/ \ install-appsDATA \ install-cfg_filesDATA \ install-pixmapDATA \ install-poiDATA \ install-mapsDATA \ DESTDIR=$(DESTDIR) # install -d $(CURDIR)/debian/tmp/usr/share/gpsdrive/mapnik # install -m 644 $(CURDIR)/scripts/mapnik/osm.xml $(CURDIR)/debian/tmp/usr/share/gpsdrive/mapnik/osm.xml install -d $(CURDIR)/debian/tmp/usr/share/map-icons install -m 644 $(CURDIR)/data/map-icons/icons.xml $(CURDIR)/debian/tmp/usr/share/map-icons/icons.xml # $(MAKE) -C scripts/mapnik/ install DESTDIR=$(DESTDIR) $(MAKE) -C src/ install DESTDIR=$(DESTDIR) install-indep: build-indep dh_testdir dh_testroot dh_installdirs -i $(MAKE) -C scripts/ install DESTDIR=$(DESTDIR) binary-indep: build-indep install-indep dh_testdir dh_testroot dh_installchangelogs -i ChangeLog dh_installdocs -i -Xdebian/TODO dh_installman -i --language=C dh_install -i --sourcedir=$(DESTDIR) dh_compress -i dh_fixperms -i dh_installdeb -i # strip language extensions mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/convert-waypoints.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/convert-waypoints mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/geoinfo.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/geoinfo # mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsdrive_mapnik_gentiles.py $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsdrive_mapnik_gentiles mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpspoint2gpsdrive.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpspoint2gpsdrive mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/bin/poi-manager.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/poi-manager mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/convert-waypoints.pl.1.gz \ $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/convert-waypoints.1.gz mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/geoinfo.pl.1.gz \ $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/geoinfo.1.gz mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/gpspoint2gpsdrive.pl.1.gz \ $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/gpspoint2gpsdrive.1.gz mv -f $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/poi-manager.pl.1.gz \ $(CURDIR)/debian/gpsdrive-scripts/usr/share/man/man1/poi-manager.1.gz # install gpsfetchmap from debian/scripts install -m 755 $(CURDIR)/debian/scripts/gpsfetchmap.pl $(CURDIR)/debian/gpsdrive-scripts/usr/bin/gpsfetchmap dh_perl -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: build-arch install-arch dh_testdir dh_testroot dh_installchangelogs -a ChangeLog dh_installdocs -a -Xdebian/TODO dh_installman -a --language=C dh_installman -a --language=de -pgpsdrive man/de/gpsdrive.1 dh_installman -a --language=es -pgpsdrive man/es/gpsdrive.1 dh_installexamples -a dh_install -a --sourcedir=$(DESTDIR) dh_strip -a dh_compress -a dh_fixperms -a dh_makeshlibs -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install-arch install-indep install