File: rules

package info (click to toggle)
josm-plugins 0.0.svn33112%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,052 kB
  • ctags: 784
  • sloc: java: 4,572; xml: 1,327; makefile: 55; python: 19
file content (65 lines) | stat: -rwxr-xr-x 2,049 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/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