File: rules

package info (click to toggle)
robocode 1.6.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,896 kB
  • ctags: 6,795
  • sloc: java: 35,724; xml: 408; sh: 90; makefile: 65
file content (81 lines) | stat: -rwxr-xr-x 2,044 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
74
75
76
77
78
79
80
81
#!/usr/bin/make -f

include /usr/share/quilt/quilt.make

export DH_OPTIONS
export JAVA_HOME=/usr/lib/jvm/java-gcj

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    export ANT_OPTS=-Dcompile.debug=true -Dcompile.optimize=false
else
    export ANT_OPTS=-Dcompile.debug=true -Dcompile.optimize=true
endif

get-orig-source:
	# Requires: unzip
	set -e; VERSION=`dpkg-parsechangelog | awk '/Version:/ {print $$2}' | sed 's/-[0-9]*$$//g'`; \
		REMOTE_VERSION=`echo $$VERSION | sed -e 's/+dfsg//' -e 's/beta/Beta-/' -e 's/~/-/'`; \
		TAR=robocode_$$VERSION.orig.tar; \
		ZIP=robocode-src-$$REMOTE_VERSION.zip; \
		TEMPDIR=`mktemp -d`; \
		cd $$TEMPDIR; \
		mkdir robocode; \
		cd robocode; \
		wget http://heanet.dl.sourceforge.net/sourceforge/robocode/$$ZIP; \
		unzip $$ZIP; \
		find . -depth -type d -name "CVS" | xargs rm -rf; \
		find . -type f -name "jikes*.jar" | xargs rm -rf; \
		find . -type f -name "codesize.jar" | xargs rm -rf; \
		rm $$ZIP ;\
		cd ..; \
		tar cvvf $$TAR robocode; \
		gzip -9 $$TAR; \
		rm -rf robocode/; \
		echo "Upstream tarball: $$TEMPDIR/$$TAR.gz"

build: patch build-stamp
build-stamp:
	cp -r debian/codesize robocode/
	ant -f build/build.xml
	touch $@

clean: unpatch
	dh_testdir
	dh_testroot
	rm -rf build-stamp
	ant clean -f build/build.xml
	rm -rf robocode/codesize
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs -i
	dh_install

	# Create icon for .desktop file
	mkdir -p debian/robocode/usr/share/pixmaps
	convert robocode/resources/icons/robocode-icon.png -resize 32x32 \
		debian/robocode/usr/share/pixmaps/robocode.xpm

	# Remove empty "package-list" files
	find debian/robocode-doc -type f -size 0 | xargs rm -vf

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs robocode/resources/versions.txt
	dh_installdocs
	dh_installman
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install patch unpatch get-orig-source