File: rules

package info (click to toggle)
libpgjava 9.2-1002-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,308 kB
  • ctags: 4,503
  • sloc: java: 37,623; xml: 3,376; makefile: 22; sh: 10
file content (32 lines) | stat: -rwxr-xr-x 1,219 bytes parent folder | download
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
#!/usr/bin/make -f

PACKAGE:=libpostgresql-jdbc-java
POMFILE:=debian/$(PACKAGE).pom

MAJOR_VERSION:=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: *\([^-]\+\)-.*/\1/p')
VJDBC3:=$(MAJOR_VERSION).jdbc3
VJDBC4:=$(MAJOR_VERSION).jdbc4

%:
	dh $@ --with javahelper

override_dh_auto_build:
# build JDBC 3 with java-gcj
	ant clean
	JAVA_HOME=/usr/lib/jvm/java-gcj ant -Djdbc3=true -Dtarget=1.4 -Dsource=1.4 -Dssl=true jar
	mv jars/postgresql.jar postgresql-jdbc3.jar
# build JDBC 4 with default-java
	ant clean
	JAVA_HOME=/usr/lib/jvm/default-java ant -Djdbc4=true -Dtarget=1.6 -Dsource=1.6 -Dssl=true jar publicapi
	mv jars/postgresql.jar postgresql-jdbc4.jar

override_dh_auto_install:
# install jdbc4 first so that the postgresql.jar symlink points to jdbc3
	mh_installpom -p$(PACKAGE) -e$(VJDBC4) --no-rules $(POMFILE)
	mh_installjar -p$(PACKAGE) -e$(VJDBC4) --java-lib --usj-name=postgresql-jdbc4 --usj-version=$(MAJOR_VERSION) $(POMFILE) postgresql-jdbc4.jar
	mh_installpom -p$(PACKAGE) -e$(VJDBC3) --no-rules $(POMFILE)
	mh_installjar -p$(PACKAGE) -e$(VJDBC3) --java-lib --usj-name=postgresql-jdbc3 --usj-version=$(MAJOR_VERSION) $(POMFILE) postgresql-jdbc3.jar

override_dh_auto_clean:
	dh_auto_clean
	mh_clean