Codebase list lwjgl / 1204b27 debian / rules
1204b27

Tree @1204b27 (Download .tar.gz)

rules @1204b27raw · history · blame

#!/usr/bin/make -f

NAME    := $(shell dpkg-parsechangelog| sed -n '/^Source/{s/Source: \(.*\)/\1/p}')
VERSION := $(shell dpkg-parsechangelog| sed -n '/^Version/{s/Version: \(.*\)-[0-9]*$$/\1/;s/+dfsg//p}')
TMPDIR  := $(NAME)-$(VERSION)
TAR     := ../$(NAME)_$(VERSION).orig.tar.gz
TARDFSG := ../$(NAME)_$(VERSION)+dfsg.orig.tar.gz

export JAVA_HOME=/usr/lib/jvm/default-java
export PATH:=$(JAVA_HOME)/bin:$(PATH)

# NOTE: jutils is explicitly included here (without a depends in our control
# file) because jinput.jar lacks jutils in its own "Class-Path" (bug #626002)
# 2016-04-09: Although #626002 appears to be fixed jutils.jar is still required
# on the CLASSPATH.
export CLASSPATH=/usr/share/java/jinput.jar:/usr/share/java/jutils.jar
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --parallel --with javahelper

override_dh_auto_build:
	ant jars
	ant compile_native
	ant javadoc

override_dh_auto_install:
	jh_installjavadoc -plib$(NAME)-java-doc doc/javadoc

override_dh_auto_clean:
	find src/native/ -name '*org_lwjgl_*.h' -delete
	rm -rf src/native/generated src/generated doc bin libs dist res temp
	jh_clean

get-orig-source:
	rm -f $(TAR)
	uscan --verbose --download-version $(VERSION) \
		--force-download --repack --no-symlink --rename
	mkdir $(TMPDIR) && tar -C $(TMPDIR) -zxf $(TAR) && rm $(TAR)
	cd $(TMPDIR) && find . -type f -exec fromdos {} \;
	echo "The following files will not be included in Debian tarball:"
	cd $(TMPDIR) && find . \( -name '*.class' -o -name '*.jar' \
		-o -path './src/generated/*' -o -path './src/native/generated/*' \) \
		-print -delete
	ZIP=--best tar --exclude-vcs --exclude src/generated \
		--exclude src/native/generated -zcf $(TARDFSG) $(TMPDIR)
	rm -rf $(TMPDIR)