diff --git a/.cvsignore b/.cvsignore index 5bc5a3e..d0f7e8f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -jna-3.2.4.tar.bz2 +jna-3.2.7.tar.bz2 diff --git a/import.log b/import.log index 94b7487..b7653a0 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ jna-3_2_4-1_el5:HEAD:jna-3.2.4-1.el5.src.rpm:1259001126 +jna-3_2_7-2_fc12:F-13:jna-3.2.7-2.fc12.src.rpm:1279835196 diff --git a/jna-3.2.5-direct.patch b/jna-3.2.5-direct.patch new file mode 100644 index 0000000..8534f50 --- /dev/null +++ b/jna-3.2.5-direct.patch @@ -0,0 +1,12 @@ +diff -up ./native/dispatch.c.old ./native/dispatch.c +--- ./native/dispatch.c.old 2010-05-12 09:56:55.478872622 +0200 ++++ ./native/dispatch.c 2010-05-12 09:57:11.639872467 +0200 +@@ -2808,7 +2808,7 @@ Java_com_sun_jna_Native_unregister(JNIEn + free(md); + } + (*env)->ReleaseLongArrayElements(env, handles, data, 0); +- (*env)->UnregisterNatives(env, cls); ++ //(*env)->UnregisterNatives(env, cls); + } + + JNIEXPORT jlong JNICALL diff --git a/jna-3.2.5-junit.patch b/jna-3.2.5-junit.patch new file mode 100644 index 0000000..afce350 --- /dev/null +++ b/jna-3.2.5-junit.patch @@ -0,0 +1,37 @@ +diff -up ./build.xml.junit ./build.xml +--- ./build.xml.junit 2010-05-01 12:18:55.547238394 +0200 ++++ ./build.xml 2010-05-01 12:20:49.253989440 +0200 +@@ -161,9 +161,6 @@ + + + +- +- +- + + + +@@ -419,13 +416,12 @@ + + + +- + + + + + +- ++ + + + +@@ -633,7 +629,7 @@ + + + +- ++ + + + diff --git a/jna-3.2.4-loadlibrary.patch b/jna-3.2.5-loadlibrary.patch similarity index 95% rename from jna-3.2.4-loadlibrary.patch rename to jna-3.2.5-loadlibrary.patch index 47238b1..99b2798 100644 --- a/jna-3.2.4-loadlibrary.patch +++ b/jna-3.2.5-loadlibrary.patch @@ -1,7 +1,7 @@ diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java ---- ./src/com/sun/jna/Native.java.loadlib 2009-11-09 10:23:05.000000000 +0100 -+++ ./src/com/sun/jna/Native.java 2009-11-09 10:30:41.000000000 +0100 -@@ -630,131 +630,19 @@ public final class Native { +--- ./src/com/sun/jna/Native.java.loadlib 2010-05-01 10:54:09.949779524 +0200 ++++ ./src/com/sun/jna/Native.java 2010-05-01 10:55:08.405824567 +0200 +@@ -631,131 +631,19 @@ public final class Native { } /** @@ -88,7 +88,7 @@ diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java - File lib = null; - if (url.getProtocol().toLowerCase().equals("file")) { - try { -- lib = new File(url.toURI()); +- lib = new File(new URI(url.toString())); - } - catch(URISyntaxException e) { - lib = new File(url.getPath()); diff --git a/jna-3.2.4-gcj-javadoc.patch b/jna-3.2.7-gcj-javadoc.patch similarity index 60% rename from jna-3.2.4-gcj-javadoc.patch rename to jna-3.2.7-gcj-javadoc.patch index 9865c8d..f1ea6d6 100644 --- a/jna-3.2.4-gcj-javadoc.patch +++ b/jna-3.2.7-gcj-javadoc.patch @@ -1,17 +1,19 @@ ---- build.xml.orig 2010-04-22 15:22:49.082452327 -0400 -+++ build.xml 2010-04-22 15:22:54.266203934 -0400 -@@ -540,8 +540,6 @@ - - - -- +diff -up ./build.xml.gcj-javadoc ./build.xml +--- ./build.xml.gcj-javadoc 2010-07-22 11:47:35.097371333 +0200 ++++ ./build.xml 2010-07-22 11:47:56.222245622 +0200 +@@ -555,8 +555,6 @@ + + + +- - - - ---- src/com/sun/jna/Function.java.orig 2010-04-22 15:23:32.766205632 -0400 -+++ src/com/sun/jna/Function.java 2010-04-22 15:23:55.909207399 -0400 -@@ -76,7 +76,7 @@ + + +diff -up ./src/com/sun/jna/Function.java.gcj-javadoc ./src/com/sun/jna/Function.java +--- ./src/com/sun/jna/Function.java.gcj-javadoc 2010-07-22 11:48:33.732370892 +0200 ++++ ./src/com/sun/jna/Function.java 2010-07-22 11:49:25.324392691 +0200 +@@ -76,7 +76,7 @@ public class Function extends Pointer { * Library in which to find the native function * @param functionName * Name of the native function to be linked with @@ -20,7 +22,7 @@ * the given function name is not found within the library. */ public static Function getFunction(String libraryName, String functionName) { -@@ -97,7 +97,7 @@ +@@ -97,7 +97,7 @@ public class Function extends Pointer { * @param callFlags * Function call flags * @@ -29,7 +31,7 @@ * the given function name is not found within the library. */ public static Function getFunction(String libraryName, String functionName, int callFlags) { -@@ -161,7 +161,7 @@ +@@ -161,7 +161,7 @@ public class Function extends Pointer { * Name of the native function to be linked with * @param callFlags * Function call flags diff --git a/jna-pom.xml b/jna-pom.xml new file mode 100644 index 0000000..019d11a --- /dev/null +++ b/jna-pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + net.java.dev.jna + jna + jar + VERSION + Java Native Access + + + + false + java.net-maven2-repository + java-net:/maven2-repository/trunk/repository/ + + + + + + + + org.jvnet.maven-antrun-extended-plugin + maven-antrun-extended-plugin + + + package + + run + + + + + + + + + + + + + + + org.jvnet.wagon-svn + wagon-svn + 1.8 + + + + + diff --git a/jna.spec b/jna.spec index 2876c15..7ba3e03 100644 --- a/jna.spec +++ b/jna.spec @@ -1,6 +1,6 @@ Name: jna -Version: 3.2.4 -Release: 5%{?dist} +Version: 3.2.7 +Release: 2%{?dist} Summary: Pure Java access to native libraries Group: Development/Libraries @@ -9,29 +9,35 @@ URL: https://jna.dev.java.net/ # The source for this package was pulled from upstream's vcs. Use the # following commands to generate the tarball: # svn export https://jna.dev.java.net/svn/jna/tags/%{version}/jnalib/ --username guest jna-%{version} -# rm jna-%{version}/dist/* -# tar -cjf jna-%{version}.tar.bz2 jna-%{version} +# rm -rf jna-%{version}/dist/* +# tar cjf ~/rpm/SOURCES/jna-%{version}.tar.bz2 jna-%{version} Source0: %{name}-%{version}.tar.bz2 +Source1: %{name}-pom.xml # This patch is Fedora-specific for now until we get the huge # JNI library location mess sorted upstream -Patch1: jna-3.2.4-loadlibrary.patch +Patch1: jna-3.2.5-loadlibrary.patch # The X11 tests currently segfault; overall I think the X11 JNA stuff is just a # Really Bad Idea, for relying on AWT internals, using the X11 API at all, # and using a complex API like X11 through JNA just increases the potential # for problems. Patch2: jna-3.2.4-tests-headless.patch -# Upstream appears to have some sort of MD5 check on the contents of their # native jar. Carve that out so we always build it. Patch3: jna-3.2.4-build-md5.patch # Build using GCJ javadoc -Patch4: jna-3.2.4-gcj-javadoc.patch +Patch4: jna-3.2.7-gcj-javadoc.patch +# junit cames from rpm +Patch5: jna-3.2.5-junit.patch +# see: https://jna.dev.java.net/issues/show_bug.cgi?id=154 +Patch6: jna-3.2.5-direct.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: java-devel ant jpackage-utils ant-nodeps -BuildRequires: libX11-devel libXt-devel libffi-devel # We manually require libffi because find-requires doesn't work # inside jars. -Requires: java jpackage-utils libffi +Requires: java >= 1:1.6.0 jpackage-utils libffi +Requires(post): jpackage-utils +Requires(postun): jpackage-utils +BuildRequires: java-devel >= 1:1.6.0 ant jpackage-utils ant-nodeps +BuildRequires: libX11-devel libXt-devel libffi-devel # for ExcludeArch see bug: 468831 %if 0%{?rhel} < 6 && 0%{?fedora} < 10 ExcludeArch: ppc ppc64 @@ -57,26 +63,30 @@ Requires: %{name} = %{version}-%{release} This package contains the javadocs for %{name}. -%package examples -Summary: Examples for %{name} +%package contrib +Summary: Contrib for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} -%description examples -This package contains the examples for %{name}. +%description contrib +This package contains the contributed examples for %{name}. %prep %setup -q -n %{name}-%{version} sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1 %patch2 -p1 -b .tests-headless -%patch3 -p0 -R -b .md5 +#patch3 -p0 -R -b .md5 %patch4 -p0 -b .gcj-javadoc +%patch5 -p1 -b .junit +#patch6 -p1 -b .direct +cp %{SOURCE1} ./ # all java binaries must be removed from the sources -find . -name '*.jar' -exec rm -f '{}' \; -find . -name '*.class' -exec rm -f '{}' \; +#find . -name '*.jar' -delete +rm lib/junit.jar +find . -name '*.class' -delete # remove internal copy of libffi rm -rf native/libffi @@ -89,16 +99,25 @@ chmod 0644 LICENSE.txt %build # We pass -Ddynlink.native which comes from our patch because # upstream doesn't want to default to dynamic linking. -ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar examples -ant javadoc - +ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar +# dirty 64bit hack +%ifarch x86_64 +ln -s build-d64 build +%endif +ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true javadoc +# remove compiled contribs +find contrib -name build -delete || : +sed -i "s/VERSION/%{version}/" %{name}-pom.xml %install rm -rf %{buildroot} +# dirty 64bit hack +%ifarch x86_64 +rm build +%endif # jars install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar -install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-%{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, @@ -106,21 +125,43 @@ install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-% install -d -m 755 %{buildroot}%{_libdir}/%{name} install -m 755 build*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/ +# install maven pom file +install -Dm 644 %{name}-pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}.pom + +# ... and maven depmap +%add_to_maven_depmap net.java.dev.jna %{name} %{version} JPP %{name} + # javadocs install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version} cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version} +%if 0%{?fedora} >= 9 +%check +#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true test +%endif + + %clean rm -rf %{buildroot} +%post +%update_maven_depmap + + +%postun +%update_maven_depmap + + %files %defattr(-,root,root,-) %doc LICENSE.txt %{_libdir}/%{name} %{_javadir}/%{name}.jar %{_javadir}/%{name}-%{version}.jar +%{_mavenpomdir}/*.pom +%{_mavendepmapfragdir}/%{name} %files javadoc @@ -128,13 +169,21 @@ rm -rf %{buildroot} %{_javadocdir}/%{name}-%{version} -%files examples +%files contrib %defattr(-,root,root,-) -%{_javadir}/%{name}-examples.jar -%{_javadir}/%{name}-examples-%{version}.jar +%doc contrib %changelog +* Thu Jul 23 2010 Levente Farkas - 3.2.7-2 +- Temporary hack for 64bit build + +* Thu Jul 22 2010 Levente Farkas - 3.2.7-1 +- Rebase on upstream 3.2.7 + +* Wed Jul 21 2010 Stanislav Ochotnicky - 3.2.4-6 +- Add maven depmap + * Thu Apr 22 2010 Colin Walters - 3.2.4-5 - Add patches to make the build happen with gcj diff --git a/sources b/sources index 0a14343..b53151e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3e53de2ba6c9e3920ec681224114209e jna-3.2.4.tar.bz2 +59c5d5ac6b49f86b7ae701265f04a48c jna-3.2.7.tar.bz2