| 1 |
|
| 2 |
|
| 3 |
PYTHON3S:=$(shell py3versions -vr 2>/dev/null) |
| 4 |
|
| 5 |
include /usr/share/dpkg/pkg-info.mk |
| 6 |
include /usr/share/java/java_defaults.mk |
| 7 |
|
| 8 |
%: |
| 9 |
dh $@ --with maven-repo-helper --with python3 |
| 10 |
|
| 11 |
override_dh_auto_configure: |
| 12 |
cp /usr/share/misc/config.* scripts |
| 13 |
JAVAC='/usr/lib/jvm/default-java/bin/javac -source $(java_compat_level)' CLASSPATH=`pwd` JAVA=/usr/lib/jvm/default-java/bin/java \ |
| 14 |
./configure --prefix=/usr --mandir=\$${prefix}/share/man |
| 15 |
|
| 16 |
override_dh_auto_build-indep: |
| 17 |
mkdir -p target/classes |
| 18 |
javac -source $(java_compat_level) -target $(java_compat_level) -d target/classes $(shell find antlr -name '*.java') |
| 19 |
jar cvf antlr.jar -C target/classes . |
| 20 |
|
| 21 |
cp bin/antlr target/runantlr |
| 22 |
|
| 23 |
override_dh_auto_build-arch: |
| 24 |
$(MAKE) -C lib/cpp CXXFLAGS="+ -fPIC -DPIC" |
| 25 |
mv -f lib/cpp/src/libantlr.a debian/libantlr-pic.a |
| 26 |
|
| 27 |
$(MAKE) -C lib/cpp clean all |
| 28 |
|
| 29 |
override_dh_auto_test: |
| 30 |
|
| 31 |
override_dh_auto_install-indep: |
| 32 |
set -e && cd lib/python && for pyvers in $(PYTHON3S); do \ |
| 33 |
python$$pyvers setup.py install --install-layout=deb --root $(CURDIR)/debian/python3-antlr ; \ |
| 34 |
done && cd .. |
| 35 |
|
| 36 |
override_dh_auto_install-arch: |
| 37 |
$(MAKE) -C lib/cpp install prefix=`pwd`/debian/libantlr-dev/usr |
| 38 |
|
| 39 |
override_dh_installchangelogs: |
| 40 |
dh_installchangelogs -- CHANGES.txt |
| 41 |
|
| 42 |
override_dh_installdocs: |
| 43 |
dh_installdocs |
| 44 |
rm -f debian/antlr-doc/usr/share/doc/antlr/csharp-runtime.html |
| 45 |
rm -f debian/antlr-doc/usr/share/doc/antlr/Makefile* |
| 46 |
|
| 47 |
override_dh_installexamples: |
| 48 |
dh_installexamples |
| 49 |
find debian/antlr-doc/usr/share/doc/antlr/examples -type f -print | xargs -r chmod 0644 |
| 50 |
|
| 51 |
test ! -d debian/antlr-doc/usr/share/doc/antlr/examples || find debian/antlr-doc/usr/share/doc/antlr/examples -name Makefile -print -delete |
| 52 |
rm -rf debian/antlr-doc/usr/share/doc/antlr/examples/csharp |
| 53 |
|
| 54 |
override_dh_auto_clean: |
| 55 |
-cd lib/cpp; $(MAKE) clean |
| 56 |
-find -name Makefile | xargs rm -f |
| 57 |
-rm -rf lib/python/build |
| 58 |
-rm -rf lib/python/antlr.egg-info |
| 59 |
-rm -rf scripts/run-antlr |
| 60 |
|
| 61 |
get-orig-pom: |
| 62 |
wget -O debian/pom.xml http://repository.sonatype.org/service/local/repositories/central/content/antlr/antlr/$(DEB_VERSION_UPSTREAM)/antlr-$(DEB_VERSION_UPSTREAM).pom |