#!/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)