Bug#480074: ITP: libjna-java -- Dynamically access native libraries from Java without JNI.
block 510442 by 480074
thanks
Hi,
Rene Engelhard wrote:
> Daniel Baumann wrote:
> > Tiago Saboga wrote:
> > > I have prepared a package and uploaded it to mentors for some weeks
> > > now [1] , but in the meantime I had to take some personal decisions and I
> > > think I am not the right person to maintain this package, as I am
> > > abandoning for now any java development... I am cc'ing Yulia, who has
> > > made a package for ubuntu and contacted me earlier.
> >
> > thanks for letting us know; she will take over as she said earlier
> > today. i'm taking the liberty to retitle/setting owner..
>
> Any status of this? This is now ~ 3 months old right now. Can we expect
> a libjna-java package soon? (I also need it via some deps for
> libfmj-java/ffmpeg-java/theora-java - which in turn I do need for
> OOo)
Also I reprted #510442 today, which need this uploaded to fix that bug.
> (I have a package here right now, too, because I oversaw the ITP on the first
> visit to wnpp)
I dismissed my initial package and based on Yulias. My diff for reference is
attached.
Regards,
Rene
reverted:
--- libjna-java-3.0.4/debian/README.source
+++ libjna-java-3.0.4.orig/debian/README.source
@@ -1,12 +0,0 @@
-jna
--------
-
-The upstream supplied source package contains binary jar files
-and internal copy of libffi.
-Currently no clean source distribution exists. Therefore, the upstream
-sources were modified to comply with the Debian Free Software
-Guidelines.
-
-Use the rules/get-orig-source target to create the orig.tar.gz.
-
- -- Yulia Novozhilova <Yulia.Novozhilova@sun.com> Wed, 18 Jun 2008 15:44:48 +0400
diff -u libjna-java-3.0.4/debian/rules libjna-java-3.0.9/debian/rules
--- libjna-java-3.0.4/debian/rules
+++ libjna-java-3.0.9/debian/rules
@@ -5,7 +5,7 @@
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/debhelper.mk
-export JAVA_HOME=/usr/lib/jvm/default-java
+export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
# package name
p_jna := libjna-java
@@ -14,7 +14,7 @@
d_jna := debian/$(p_jna)
#for get-orig-sources
-VERSION := 3.0.4
+VERSION := 3.0.9
GOS_TMP := $(CURDIR)/get-orig-source-tmp
PKG_DIR := $(p_jna)-$(VERSION)
ZIP_NAME := src.zip
@@ -42,7 +42,6 @@
clean::
ant -f $(DEB_SRCDIR)/build.xml clean
rm -f $(DEB_SRCDIR)/build.number
- rm -f $(DEB_SRCDIR)/lib/junit.jar
# these files are left by cdbs (a bug?)
rm -f $(DEB_SRCDIR)/*.cdbs-config_list
rm -f $(DEB_SRCDIR)/stamp-build-$(p_jna)
@@ -54,12 +53,6 @@
rm -rf $(GOS_TMP) && mkdir $(GOS_TMP);
cd $(GOS_TMP);\
wget --user guest --password "" $(URL_ZIP) && unzip $(ZIP_NAME) -d $(PKG_DIR); \
- #remove internal copy of libffi \
- rm -rf $(PKG_DIR)/native/libffi; \
- rm -rf $(PKG_DIR)/lib/junit.jar
- #remove .* files
- find $(GOS_TMP)/$(PKG_DIR) -name '.*' -exec rm -f '{}' \;
- #remove .jar files
#repack
cd $(GOS_TMP) && GZIP=-9 tar -czf ../$(p_jna)_$(VERSION).orig.tar.gz $(PKG_DIR)
#clean
diff -u libjna-java-3.0.4/debian/control libjna-java-3.0.9/debian/control
--- libjna-java-3.0.4/debian/control
+++ libjna-java-3.0.9/debian/control
@@ -1,9 +1,9 @@
Source: libjna-java
Section: libs
Priority: optional
-Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
-XSBC-Original-Maintainer: Yulia Novozhilova <Yulia.Novozhilova@sun.com>
-Build-Depends: cdbs, debhelper (>= 7), ant (>=1.7.0), ant-optional(>= 1.7.0), default-jdk, libx11-dev, libxt-dev, libffi-dev(>=3.0.5), pkg-config
+Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
+Uploaders: Rene Engelhard <rene@debian.org>, Yulia Novozhilova <Yulia.Novozhilova@sun.com>
+Build-Depends: cdbs, debhelper (>= 7), ant (>=1.7.0), ant-optional(>= 1.7.0), openjdk-6-jdk, libx11-dev, libxt-dev, libffi-dev(>=3.0.5), pkg-config
Standards-Version: 3.8.0
Homepage: http://jna.dev.java.net
diff -u libjna-java-3.0.4/debian/changelog libjna-java-3.0.9/debian/changelog
--- libjna-java-3.0.4/debian/changelog
+++ libjna-java-3.0.9/debian/changelog
@@ -1,3 +1,18 @@
+libjna-java (3.0.9-1) unstable; urgency=low
+
+ * New upstream release. Upload to Debian (closes: #480074)
+ * Change Maintainer to Debian Java Maintainers; myself as Uploaders:; keep
+ Yulia
+ * fix build.xml to remove nbproject usage as we don't have it. It would
+ be better if you didn't use cdbs in the first place, then you could
+ have done it cleanly in a patch, so it has to be in the diff
+ * use openjdk, as gcj fails in both the native-api-check the javadoc build
+ and thus the build/install fails
+ * remove README.source as we now have (and base on) a src.zip without
+ binary stuff
+
+ -- Rene Engelhard <rene@debian.org> Fri, 02 Jan 2009 01:22:55 +0100
+
libjna-java (3.0.4-0ubuntu2) intrepid; urgency=low
* Move architecure-dependent Build Dependencies to Build-Depends
diff -u libjna-java-3.0.4/debian/patches/30-no-special-build-dir-for-d64.patch libjna-java-3.0.9/debian/patches/30-no-special-build-dir-for-d64.patch
--- libjna-java-3.0.4/debian/patches/30-no-special-build-dir-for-d64.patch
+++ libjna-java-3.0.9/debian/patches/30-no-special-build-dir-for-d64.patch
@@ -13,10 +12,0 @@
-@@ -396,9 +396,6 @@
- <condition property="vmopt.arch" value="-d64" else="-Dignore">
- <equals arg1="${vm.arch}" arg2="-d64" trim="true"/>
- </condition>
-- <condition property="dir.build.suffix" value="-d64" else="">
-- <equals arg1="${vm.arch}" arg2="-d64" trim="true"/>
-- </condition>
- <property name="tests.platform" value=""/>
- <junit printsummary="yes" fork="${test.fork}" failureproperty="testfailure">
- <jvmarg value="-Djna.library.path=${build.native}"/>
diff -u libjna-java-3.0.4/debian/patches/10-dynlink-and-cflags.patch libjna-java-3.0.9/debian/patches/10-dynlink-and-cflags.patch
--- libjna-java-3.0.4/debian/patches/10-dynlink-and-cflags.patch
+++ libjna-java-3.0.9/debian/patches/10-dynlink-and-cflags.patch
@@ -1,30 +1,6 @@
diff -Nur -x '*.orig' -x '*~' libjna-java-3.0.4/build.xml libjna-java-3.0.4.new/build.xml
--- libjna-java-3.0.4/build.xml 2008-08-04 16:45:01.000000000 +0400
+++ libjna-java-3.0.4.new/build.xml 2008-08-04 16:53:17.000000000 +0400
-@@ -18,6 +18,8 @@
- <property name="debug" value="true"/>
- <property name="debug.native" value="false"/>
- <property name="native" location="native"/>
-+ <property name="cflags_extra.native" value=""/>
-+ <property name="dynlink.native" value="false"/>
- <property name="src" location="src"/>
- <property name="dist" location="dist"/>
- <property name="test.src" location="test"/>
-@@ -321,11 +323,13 @@
- </condition>
- <!-- Default make program -->
- <property name="make" value="make"/>
--
-+
- <exec executable="${make}" dir="${native}" failonerror="true">
- <arg value="JAVA_HOME=${jdk.home}"/>
- <arg value="JAVAH=${build.native}"/>
- <arg value="DEBUG=${debug.native}"/>
-+ <arg value="CFLAGS_EXTRA=${cflags_extra.native}"/>
-+ <arg value="DYNAMIC_LINK=${dynlink.native}"/>
- <arg value="${make.CC}"/>
- <arg value="${make.BUILD}"/>
- <arg value="${make.SDKROOT}"/>
@@ -334,6 +338,19 @@
<arg value="VERSION=${jni.version}"/>
<arg value="CHECKSUM=${jni.md5}"/>
@@ -64,86 +39,0 @@
-diff -Nur -x '*.orig' -x '*~' libjna-java-3.0.4/native/Makefile libjna-java-3.0.4.new/native/Makefile
---- libjna-java-3.0.4/native/Makefile 2008-08-04 16:10:43.000000000 +0400
-+++ libjna-java-3.0.4.new/native/Makefile 2008-08-04 16:55:10.000000000 +0400
-@@ -38,10 +38,13 @@
- INSTALLDIR=../build/$(OS)
- JNIDISPATCH_OBJS=$(BUILD)/dispatch.o $(BUILD)/callback.o $(EXTRAOBJS)
- RSRC=$(BUILD)/rsrc.o
-+ifneq ($(DYNAMIC_LINK),true)
- FFI_SRC=$(shell pwd)/libffi
- FFI_BUILD=$(BUILD)/libffi
- FFI_LIB=$(FFI_BUILD)/.libs/libffi_convenience.a
- FFI_CONFIG=--disable-static --with-pic=yes
-+endif
-+SONAME=$(LIBPFX)jnidispatch$(JNISFX)
- LIBRARY=$(BUILD)/$(LIBPFX)jnidispatch$(JNISFX)
- TESTLIB=$(BUILD)/$(LIBPFX)testlib$(LIBSFX)
-
-@@ -51,6 +54,7 @@
- JNISFX=$(LIBSFX)
- CC=gcc
- LD=gcc
-+LIBS=
- # Default to Sun recommendations for JNI compilation
- #COPT=-O2 -fomit-frame-pointer
- COPT=-fno-omit-frame-pointer -fno-strict-aliasing
-@@ -58,14 +62,22 @@
- ifeq ($(DEBUG),true)
- CDEBUG=-g
- endif
-+CFLAGS_EXTRA=
- COUT=-o $@
- CINCLUDES=$(JAVA_INCLUDES) -I"$(JAVAH)" -I$(FFI_BUILD)/include
- CDEFINES=-D_REENTRANT
- PCFLAGS=-W -Wall -Wno-unused -Wno-parentheses
--CFLAGS=$(PCFLAGS) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \
-+CFLAGS=$(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \
- -DVERSION='"$(VERSION)"' -DCHECKSUM='"$(CHECKSUM)"'
-+ifeq ($(DYNAMIC_LINK),true)
-+CFLAGS += `pkg-config --cflags libffi`
-+LIBS += `pkg-config --libs libffi`
-+endif
-+LDFLAGS=-o $@ -shared
-+ifneq ($(DYNAMIC_LINK),true)
- # -static-libgcc avoids gcc library incompatibilities across linux systems
--LDFLAGS=-o $@ -shared -static-libgcc
-+LDFLAGS += -static-libgcc
-+endif
- # Avoid bug in X11-based 1.5/1.6 VMs; dynamically load instead of linking
- # See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6539705
- #LIBS=-L"$(LIBDIR)" -ljawt
-@@ -110,7 +122,7 @@
- ARCH=$(shell uname -m | sed 's/i.86/i386/g')
- PCFLAGS+=-fPIC
- CDEFINES+=-DHAVE_PROTECTION
--LDFLAGS+=-Wl,-soname,$@
-+LDFLAGS+=-Wl,-soname,$(SONAME)
- endif
-
- ifeq ($(OS),freebsd)
-@@ -202,14 +214,16 @@
- $(TESTLIB): $(BUILD)/testlib.o
- $(LD) $(LDFLAGS) $< $(TESTDEF)
-
-+ifneq ($(DYNAMIK_LINK), true)
- $(FFI_LIB):
- @mkdir -p $(FFI_BUILD)
- @if [ ! -f $(FFI_BUILD)/Makefile ]; then \
- echo "Configuring libffi ($(ARCH))"; \
- (cd $(FFI_BUILD) \
- && CC="$(CC)" CFLAGS="$(CDEBUG)" CPPFLAGS="$(CDEFINES)" $(FFI_SRC)/configure $(FFI_CONFIG)); \
-- fi
-+ fi
- $(MAKE) -C $(FFI_BUILD)
-+
- ifneq ($(SDKROOT),)
- @for arch in $(ALT_ARCHS); do \
- mkdir -p $(BUILD)/libffi.$$arch; \
-@@ -225,7 +239,7 @@
- /usr/bin/libtool -static -o $@.tmp $(FFI_BUILD)/.libs/${@F} $(BUILD)/libffi.*/.libs/${@F}
- mv $@.tmp $@
- endif
--
-+endif
- clean:
- $(RM) -rf $(BUILD)
-
only in patch2:
unchanged:
--- libjna-java-3.0.9.orig/build.xml
+++ libjna-java-3.0.9/build.xml
@@ -58,7 +58,6 @@
<target name="default" depends="test" description="Build and Test."/>
- <import file="nbproject/profiler-build-impl.xml"/>
<target name="init" depends="-setup"/>
<target name="compile-test-single" depends="compile-tests"/>
<target name="compile-single" depends="compile"/>
@@ -579,7 +578,6 @@
<zipfileset src="${dist}/src.zip"/>
<zipfileset dir="lib" includes="junit.jar" prefix="lib"/>
<zipfileset dir="." includes=".classpath,.project"/>
- <zipfileset dir="nbproject" includes="**/*" prefix="nbproject"/>
<zipfileset dir="${native}" includes="libffi,libffi/**/*" prefix="native"/>
</zip>
</target>
Reply to: