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
|
#!/usr/bin/make -f
PKD := $(abspath $(dir $(MAKEFILE_LIST)))
VER := $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | cut -d- -f1)
PKG := robocode
COMMIT := 3286f2832c46ff86b46a260f4582ee92698b8ba8
%:
dh $@ --parallel --buildsystem=maven
override_dh_auto_build:
sed -e 's/@RCVER@/$(VER)/g' < debian/misc/robocode.in > debian/misc/robocode
sed -e 's/@RCVER@/$(VER)/g' < debian/misc/compiler.properties.in > debian/misc/compiler.properties
sed -e 's/@RCVER@/$(VER)/g' < debian/examples/roborumble.in > debian/examples/roborumble
sed -e 's/@RCVER@/$(VER)/g' < debian/maven.properties.in > debian/maven.properties
dh_auto_build
override_dh_installchangelogs:
dh_installchangelogs versions.md
override_dh_install:
$(RM) -r debian/robocode/usr/share/maven-repo
convert -resize 32x32 \
robocode.content/src/main/resources/desktop/robocode.png robocode.xpm
dh_install
.PHONY: get-orig-source
## http://wiki.debian.org/onlyjob/get-orig-source
get-orig-source: $(PKG)_$(VER).orig.tar.xz
@
$(PKG)_$(VER).orig.tar.xz:
@echo "# Cloning upstream git repository..."
git clone https://github.com/robo-code/robocode.git $(PKG)-$(VER)
@echo "# Clean-up..."
cd $(PKG)-$(VER) \
&& git checkout -b debiansource $(COMMIT) \
&& for F in $$(git ls-tree -r --name-only HEAD); \
do touch --no-dereference -d "$$(git log -1 --format="%ai" -- "$$F")" "$$F"; done \
&& $(RM) -r -v \
.git/ \
.gitignore
@echo "# Packing..."
find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
&& $(RM) -r "$(PKG)-$(VER)"
|