File: rules

package info (click to toggle)
relaxngcc 1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 1,316 kB
  • ctags: 2,124
  • sloc: java: 15,514; xml: 59; makefile: 46
file content (73 lines) | stat: -rwxr-xr-x 2,234 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export JAVA_HOME=/usr/lib/jvm/default-java

# Put depended upon jars in here
# export CLASSPATH=

VERSION = $(shell dpkg-parsechangelog |grep Version| sed 's/.*: //;s/-.*//')
ZVERSION = 20031218
ORIG_BDIR = relaxngcc-$(VERSION)
ZIP = relaxngcc-$(ZVERSION).zip

%:
	dh $@ --with javahelper

override_dh_auto_build:
	cp debian/build.xml .
	dh_auto_build -- \
		-Dant.build.javac.source=1.5 \
		-Dant.build.javac.target=1.5 \
		jar
	# copy regenerated files aside first
	test -d state-orig || cp -r src/relaxngcc/parser/state state-orig
	test -d parser-orig || cp -r src/relaxngcc/datatype/parser parser-orig

	dh_auto_build -- \
		-Dant.build.javac.source=1.5 \
		-Dant.build.javac.target=1.5 \
		ngcc
	dh_auto_build -- \
		-Dant.build.javac.source=1.5 \
		-Dant.build.javac.target=1.5 \
		jar \
		javadoc

override_dh_auto_clean:
	dh_auto_clean
	# move original files in place
	test ! -d state-orig || (mv state-orig/* src/relaxngcc/parser/state && rmdir state-orig)
	test ! -d parser-orig || (mv parser-orig/* src/relaxngcc/datatype/parser && rmdir parser-orig)
	rm -f build.xml

get-orig-source:
	wget http://prdownloads.sourceforge.net/relaxngcc/relaxngcc-$(ZVERSION).zip
	unzip relaxngcc-$(ZVERSION).zip
	mv relaxngcc-$(ZVERSION) relaxngcc-$(VERSION)

	# Remove the sources that will be generated with JavaCC:
	rm $(ORIG_BDIR)/src/relaxngcc/javabody/*.java

	# Remove to avoid dependency on commons-jelly:
	rm $(ORIG_BDIR)/src/relaxngcc/maven/ChildAntProjectTag.java

	# These will be regenerated
	rm $(ORIG_BDIR)/src/relaxngcc/parser/automata/*.gif

	# Some of the sources don't use the correct end of line encoding, so to be
	# conservative fix all of them:
	find $(ORIG_BDIR) -type f -exec dos2unix {} \;

	# Some of the source files contain characters outside of the ASCII set that
	# cause problems when compiling, so make sure that they are translated to
	# ASCII:
	native2ascii -encoding UTF8 $(ORIG_BDIR)/src/relaxngcc/builder/SwitchBlockInfo.java \
		$(ORIG_BDIR)/src/relaxngcc/builder/SwitchBlockInfo.java

	XZ_OPT=--best tar -cJf ../relaxngcc_$(VERSION).orig.tar.xz \
		--exclude '*.jar' \
		--exclude '*.class' \
		--exclude 'sample' \
		--exclude 'doc' \
		$(ORIG_BDIR)
	rm -rf $(ZIP) $(ORIG_BDIR)