#!/usr/bin/make -f export JAVA_HOME=/usr/lib/jvm/default-java export CLASSPATH=/usr/share/josm/josm.jar:/usr/share/java/metadata-extractor.jar SVNREPO := https://svn.openstreetmap.org/applications/editors/josm/plugins/ PLUGINS := colorscheme DirectUpload editgpx lakewalker measurement openvisible routing DATE := $(shell date +%Y%m%d) ifdef SVNREV VERSION := 0.0.svn${SVNREV} else VERSION := 0.0.0.${DATE} endif DESTVER := ${VERSION}+ds DESTDIR := ../tarballs/josm-plugins-${VERSION} DESTTGZ := ../tarballs/josm-plugins_${DESTVER}.orig.tar.gz %: dh $@ --parallel override_dh_auto_configure: for plugin in ${PLUGINS}; do \ python ./debian/fix_build_xml.py $$plugin/build.xml $$plugin/build.xml.bak ; \ done override_dh_auto_build: dh_auto_build -Sant -- -f $(CURDIR)/debian/master.xml build override_dh_auto_clean: dh_auto_clean -Sant -- -f $(CURDIR)/debian/master.xml for plugin in ${PLUGINS}; do \ [ -f $$plugin/build.xml.bak ] && mv $$plugin/build.xml.bak $$plugin/build.xml || true ; \ done find . -maxdepth 2 -name "data" -type d | xargs rm -rf get-orig-source: dh_testdir test -d ../tarballs/. || mkdir -p ../tarballs @echo Downloading josm-plugins from ${SVNREPO} @mkdir ${DESTDIR} @for plugin in $(PLUGINS); do \ echo "Fetching $$plugin plugin"; \ svn export -r ${SVNREV} ${SVNREPO}/"$$plugin" ${DESTDIR}/"$$plugin"; \ echo "Removing precompiled translation files"; \ rm -f ${DESTDIR}/"$$plugin"/data/*.lang; \ done svn export -r ${SVNREV} ${SVNREPO}/build-common.xml ${DESTDIR}/build-common.xml svn info --xml ${SVNREPO} > ${DESTDIR}/svn-info.xml @echo Removing jar files find ${DESTDIR} -name "*.jar" -exec rm -v {} \; @echo Building snapshot tarball tar czf ${DESTTGZ} -C `dirname ${DESTDIR}` `basename ${DESTDIR}` @echo Cleaning up rm -rf ${DESTDIR} @echo Moving tarball to parent directory mv ${DESTTGZ} ../ @echo Removing tarballs directory rmdir ../tarballs @echo . @echo To update debian/changelog type @echo dch -v ${DESTVER}-1 @echo . .PHONY: get-orig-source