File: rules

package info (click to toggle)
libnanoxml2-java 2.2.3.dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 992 kB
  • sloc: java: 5,085; xml: 150; makefile: 89; sh: 59
file content (78 lines) | stat: -rwxr-xr-x 2,400 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
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/make -f
# -*- makefile -*-

# This has to be exported to make some magic below work.
export DH_OPTIONS

JAVA_HOME?=/usr/lib/jvm/default-java
JFLAGS?=-source 1.8 -nowarn

SRCDIR := $(shell echo ./$(word $(words ${MAKEFILE_LIST}), ${MAKEFILE_LIST}) | \
sed -r "s/debian\/rules$$//")
VERSION := $(shell cd ${SRCDIR} && dpkg-parsechangelog | egrep '^Version:' | \
cut -f 2 -d ' ' | sed -r 's/\.dfsg(.)*//g')

NANOXML := nanoxml.jar
LITE := nanoxml-lite.jar
SAX := nanoxml-sax.jar

%:
	dh $@ --with javahelper

override_dh_auto_build:
	jh_build --javacopts='${JFLAGS}' --no-javadoc ${LITE} Sources/Lite/
	jh_build --javacopts='${JFLAGS}' --no-javadoc ${NANOXML} Sources/Java/
	CLASSPATH=${NANOXML} jh_build --javacopts='${JFLAGS}' --no-javadoc ${SAX} Sources/SAX/
	jh_manifest -c /usr/share/java/${NANOXML} ${SAX}

	bnd wrap --bsn net.n3.nanoxml      --output $(NANOXML).tmp $(NANOXML)
	bnd wrap --bsn net.n3.nanoxml.lite --output $(LITE).tmp $(LITE)
	bnd wrap --bsn net.n3.nanoxml.sax  --output $(SAX).tmp $(SAX)
	mv $(NANOXML).tmp $(NANOXML)
	mv $(LITE).tmp $(LITE)
	mv $(SAX).tmp $(SAX)

	${JAVA_HOME}/bin/javadoc -author -quiet \
	-sourcepath Sources/Java/:Sources/Lite/:Sources/SAX/ -source 1.8 \
	nanoxml net.n3.nanoxml net.n3.nanoxml.sax -d api

override_dh_auto_test:
ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
	make -f debian/rules test
else
	echo "Disabling tests"
endif

override_dh_clean:
	jh_clean
	rm -rf Test/*/*.class
	rm -rf debian/orig.tmp || echo "No failed source fetch"

	dh_clean

test:
	set -e; \
	set -x; \
	cd Test/Lite && \
	${JAVA_HOME}/bin/javac ${JFLAGS} -cp .:../../${LITE} `find -iname *.java` && \
	for TESTFILE in *.xml; do \
		${JAVA_HOME}/bin/java -cp .:../../${LITE} DumpXML_Lite $${TESTFILE} > $${TESTFILE}.test_out ; \
		if ! diff -u -w $${TESTFILE}.out $${TESTFILE}.test_out ; \
		then	echo ${LITE} failed $${TESTFILE}; \
			exit 1; \
		fi; \
	done; \
	cd ../Java && \
	${JAVA_HOME}/bin/javac ${JFLAGS} -cp .:../../${NANOXML} $$(find -iname *.java) && \
	for TESTFILE in *.xml; do\
		${JAVA_HOME}/bin/java -cp .:../../${NANOXML} DumpXML $${TESTFILE} > $${TESTFILE}.test_out ; \
		if ! diff -u -w $${TESTFILE}.out $${TESTFILE}.test_out ; \
		then	echo ${NANOXML} failed $${TESTFILE}; \
			exit 1; \
		fi; \
	done
	touch $@

get-orig-source:
	set -e; \
	sh ${SRCDIR}/debian/origCleaner.sh thisIsIgnored ${VERSION} alsoIgnored ${SRCDIR}/debian/orig.tmp