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
|
#!/usr/bin/make -f
export JAVA_HOME = /usr/lib/jvm/default-java
DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
NATIVE_SRCS = $(wildcard src/native/*.c)
NATIVE_FILES = $(subst src/native,target/native,$(patsubst %.c,%,$(NATIVE_SRCS)))
NATIVE_OBJECTS = $(subst src/native,target/native,$(patsubst %.c,%.o,$(NATIVE_SRCS)))
VERSION = $(shell dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*$$/\1/p')
%:
dh $@
override_dh_auto_build:
ant -f debian/build.xml -Dicedtea.version=$(VERSION) jar
cp src/native/* target/native
for f in $(NATIVE_FILES); do \
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -I$(JAVA_HOME)/include/linux -I$(JAVA_HOME)/include -Itarget/native -o $$f.o -c $$f.c ; \
done
$(CC) $(LDFLAGS) -shared -lpulse $(NATIVE_OBJECTS) -o target/libpulse-java.so
override_dh_auto_install:
dh_auto_install
dh_install -plibpulse-java target/pulse-java-$(VERSION).jar usr/share/java
dh_link -plibpulse-java /usr/share/java/pulse-java-$(VERSION).jar usr/share/java/pulse-java.jar
dh_install -plibpulse-jni target/libpulse-java.so usr/lib/$(DEB_HOST_MULTIARCH)/jni
override_dh_auto_clean:
dh_auto_clean
ant -f debian/build.xml clean
get-orig-source:
uscan --download-current-version --rename
|