- New upstream version, drop upstreamed patch parts

- New patch jna-3.0.4-nomixedjar.patch which ensures that we don't include
    the .so in the .jar
This commit is contained in:
Colin Walters 2008-07-31 18:33:15 +00:00
parent 316df79523
commit dad708bc2f
4 changed files with 16 additions and 139 deletions

View File

@ -1 +1 @@
jna-3.0.2.tar.bz2
jna-3.0.4.svn630.tar.bz2

View File

@ -1,128 +0,0 @@
--- jna-3.0.2.default/build.xml 2008-02-28 14:34:44.000000000 -0500
+++ jna-3.0.2/build.xml 2008-04-03 23:20:07.000000000 -0400
@@ -17,6 +17,8 @@
<property name="jar" value="${name}.jar"/>
<property name="debug" value="true"/>
<property name="debug.native" value="false"/>
+ <property name="cflags_extra.native" value=""/>
+ <property name="dynlink.native" value="false"/>
<property name="native" location="native"/>
<property name="src" location="src"/>
<property name="dist" location="dist"/>
@@ -311,6 +313,8 @@
<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}"/>
@@ -319,6 +323,19 @@
<arg value="VERSION=${jni.version}"/>
<arg value="CHECKSUM=${jni.md5}"/>
</exec>
+ <antcall target="native-mixedjar"/>
+ <!-- For web start, native libraries may be provided in the root of -->
+ <!-- an included jar file -->
+ <jar jarfile="${build}/${native.jar}">
+ <fileset dir="${build.native}" includes="jnidispatch.dll,libjnidispatch.*"/>
+ <manifest>
+ <attribute name="Implementation-Version" value="${jni.version} b${jni.build}"/>
+ <attribute name="Specification-Version" value="${jni.version}"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="native-mixedjar" unless="nomixedjar.native">
<mkdir dir="${classes}/com/sun/jna/${os.prefix}"/>
<copy todir="${classes}/com/sun/jna/${os.prefix}">
<fileset dir="${build.native}"
@@ -330,15 +347,6 @@
<fileset dir="${build.native}"
includes="jnidispatch.dll,libjnidispatch.*"/>
</copy>
- <!-- For web start, native libraries may be provided in the root of -->
- <!-- an included jar file -->
- <jar jarfile="${build}/${native.jar}">
- <fileset dir="${build.native}" includes="jnidispatch.dll,libjnidispatch.*"/>
- <manifest>
- <attribute name="Implementation-Version" value="${jni.version} b${jni.build}"/>
- <attribute name="Specification-Version" value="${jni.version}"/>
- </manifest>
- </jar>
</target>
<target name="compile-tests" depends="compile,native"
--- jna-3.0.2.default/native/Makefile 2008-02-27 23:28:13.000000000 -0500
+++ jna-3.0.2/native/Makefile 2008-04-03 21:45:21.000000000 -0400
@@ -38,10 +38,12 @@
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
LIBRARY=$(BUILD)/$(LIBPFX)jnidispatch$(JNISFX)
TESTLIB=$(BUILD)/$(LIBPFX)testlib$(LIBSFX)
@@ -51,6 +53,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 +61,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 -Wl,-soname,$@
+ifneq ($(DYNAMIC_LINK),true)
# -static-libgcc avoids gcc library incompatibilities across linux systems
-LDFLAGS=-o $@ -shared -Wl,-soname,$@ -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
@@ -187,6 +198,7 @@
$(CC) $(CFLAGS) -c $< $(COUT)
endif
+
all: $(LIBRARY) $(TESTLIB)
install:
@@ -202,6 +214,7 @@
$(TESTLIB): $(BUILD)/testlib.o
$(LD) $(LDFLAGS) $< $(TESTDEF)
+ifneq ($(DYNAMIC_LINK),true)
$(FFI_LIB):
@mkdir -p $(FFI_BUILD)
@if [ ! -f $(FFI_BUILD)/Makefile ]; then \
@@ -225,6 +238,7 @@
/usr/bin/libtool -static -o $@.tmp $(FFI_BUILD)/.libs/${@F} $(BUILD)/libffi.*/.libs/${@F}
mv $@.tmp $@
endif
+endif
clean:
$(RM) -rf $(BUILD)

View File

@ -1,6 +1,6 @@
Name: jna
Version: 3.0.2
Release: 7%{?dist}
Version: 3.0.4
Release: 1.svn630%{?dist}
Summary: Pure Java access to native libraries
Group: Development/Libraries
@ -10,12 +10,12 @@ URL: https://jna.dev.java.net/
# following commands to generate the tarball:
# svn export https://jna.dev.java.net/svn/jna/tags/%{version}/jnalib/ --username guest jna-%{version}
# tar -cjf jna-%{version}.tar.bz2 jna-%{version}
Source0: %{name}-%{version}.tar.bz2
# https://jna.dev.java.net/issues/show_bug.cgi?id=60
Patch0: jna-3.0.2-dynlink-and-cflags.patch
Source0: %{name}-%{version}.svn630.tar.bz2
# This patch is Fedora-specific for now until we get the huge
# JNI library location mess sorted upstream
Patch1: jna-3.0.2-loadlibrary.patch
# Will send upstream...
Patch2: jna-3.0.4-nomixedjar.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: java-devel >= 1.6 ant jpackage-utils ant-nodeps
@ -44,9 +44,9 @@ This package contains the javadocs for %{name}.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%setup -q -n %{name}-%{version}-svn630
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
%patch2 -p1
# all java binaries must be removed from the sources
find . -name '*.jar' -exec rm -f '{}' \;
@ -74,13 +74,13 @@ ant javadoc
rm -rf %{buildroot}
# jars
install -D -m 644 build/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
install -D -m 644 build-*/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir}/; for jar in `ls *-%{version}.jar`; do ln -s $jar `echo $jar | sed -e 's/-%{version}//'`; done)
# NOTE: JNA has highly custom code to look for native jars in this
# directory. Since this roughly matches the jpackage guidelines,
# we'll leave it unchanged.
install -d -m 755 %{buildroot}%{_libdir}/%{name}
install -m 755 build/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
install -m 755 build-*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
# javadocs
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
@ -103,6 +103,11 @@ rm -rf %{buildroot}
%changelog
* Thu Jul 31 2008 Colin Walters <walters@redhat.com> - 3.0.4-1.svn630
- New upstream version, drop upstreamed patch parts
- New patch jna-3.0.4-nomixedjar.patch which ensures that we don't
include the .so in the .jar
* Fri Apr 04 2008 Colin Walters <walters@redhat.com> - 3.0.2-7
- Add patch to use JPackage-compatible JNI library path
- Do build debuginfo package

View File

@ -1 +1 @@
4f177e179adfdb3c2289c6f36445809f jna-3.0.2.tar.bz2
2a90fbade80d2a86d5cc967c5529cd34 jna-3.0.4.svn630.tar.bz2