diff --git a/.jna.metadata b/.jna.metadata new file mode 100644 index 0000000..18e5d24 --- /dev/null +++ b/.jna.metadata @@ -0,0 +1 @@ +3d8bf126dd75e754e3316bb9224e60644930d44c SOURCES/jna-3.5.2.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/LICENSE-2.0 b/SOURCES/LICENSE-2.0 new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/SOURCES/LICENSE-2.0 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/SOURCES/generate-tarball.sh b/SOURCES/generate-tarball.sh new file mode 100644 index 0000000..246d05f --- /dev/null +++ b/SOURCES/generate-tarball.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +version=`grep Version: *spec | sed -e 's/Version:\s*\(.*\)/\1/'` + + +wget https://github.com/twall/jna/tarball/${version} -O jna-${version}.tar.gz +rm -rf jna-${version} +tar xf jna-${version}.tar.gz +mv twall-jna-* jna-${version} +# remove bundled things with unknown licensing +rm -rvf jna-${version}/{dist/*,www,native/libffi} +# jars in lib/native subdir need to be present in tarball so +# that final jar can be built. They can be empty and then have no +# effect on resulting jar. One jar (depending on architecture) will +# be replaced with full content (containing libjnidispatch.so) +for njar in jna-${version}/lib/native/*.jar; do + rm -v $njar + jar cf $njar /dev/null 2> /dev/null +done + +find jna-${version} -iname '*jar' -size +1b -delete +find jna-${version} -name '*.class' -delete + +tar cJf jna-${version}.tar.xz jna-${version} diff --git a/SOURCES/jna-3.4.0-tests-headless.patch b/SOURCES/jna-3.4.0-tests-headless.patch new file mode 100644 index 0000000..73dba50 --- /dev/null +++ b/SOURCES/jna-3.4.0-tests-headless.patch @@ -0,0 +1,11 @@ +diff -up ./build.xml.tests-headless ./build.xml +--- ./build.xml.tests-headless 2012-03-07 11:56:41.702657823 +0100 ++++ ./build.xml 2012-03-07 11:57:12.635887659 +0100 +@@ -561,6 +561,7 @@ + + + ++ + + + diff --git a/SOURCES/jna-3.5.0-build.patch b/SOURCES/jna-3.5.0-build.patch new file mode 100644 index 0000000..0b634c0 --- /dev/null +++ b/SOURCES/jna-3.5.0-build.patch @@ -0,0 +1,20 @@ +diff -up ./native/Makefile.build ./native/Makefile +--- ./native/Makefile.build 2012-10-19 03:53:11.000000000 +0200 ++++ ./native/Makefile 2012-10-26 11:25:19.003999925 +0200 +@@ -90,7 +90,7 @@ CDEFINES=-D_REENTRANT + PCFLAGS=-W -Wall -Wno-unused -Wno-parentheses + CFLAGS=$(PCFLAGS) $(CFLAGS_EXTRA) $(COPT) $(CDEBUG) $(CDEFINES) $(CINCLUDES) \ + -DJNA_JNI_VERSION='"$(JNA_JNI_VERSION)"' -DCHECKSUM='"$(CHECKSUM)"' +-LDFLAGS=-o $@ -shared ++LDFLAGS=$(RPM_LD_FLAGS) -o $@ -shared + ifeq ($(DYNAMIC_LIBFFI),true) + CFLAGS += $(shell pkg-config --cflags libffi 2>/dev/null || echo) + LIBS += $(shell pkg-config --libs libffi 2>/dev/null || echo -lffi) +@@ -344,7 +344,6 @@ $(RSRC): $(BUILD)/jnidispatch.rc + + $(LIBRARY): $(JNIDISPATCH_OBJS) $(FFI_LIB) + $(LD) $(LDFLAGS) $(JNIDISPATCH_OBJS) $(FFI_LIB) $(LIBS) +- $(STRIP) $@ + + $(TESTLIB): $(BUILD)/testlib.o + $(LD) $(LDFLAGS) $< $(LIBS) diff --git a/SOURCES/jna-3.5.2-gcj-javadoc.patch b/SOURCES/jna-3.5.2-gcj-javadoc.patch new file mode 100644 index 0000000..477ae64 --- /dev/null +++ b/SOURCES/jna-3.5.2-gcj-javadoc.patch @@ -0,0 +1,13 @@ +diff -up ./build.xml.gcj-javadoc ./build.xml +--- ./build.xml.gcj-javadoc 2013-04-29 14:59:19.748042560 +0200 ++++ ./build.xml 2013-04-29 15:00:00.678317442 +0200 +@@ -916,8 +916,6 @@ osname=macosx;processor=x86;processor=x8 + + + +- +- + + + +diff -up ./src/com/sun/jna/Function.java.gcj-javadoc ./src/com/sun/jna/Function.java diff --git a/SOURCES/jna-3.5.2-junit.patch b/SOURCES/jna-3.5.2-junit.patch new file mode 100644 index 0000000..babd7b8 --- /dev/null +++ b/SOURCES/jna-3.5.2-junit.patch @@ -0,0 +1,48 @@ +diff -up ./build.xml.junit ./build.xml +--- ./build.xml.junit 2013-04-29 15:06:12.423790515 +0200 ++++ ./build.xml 2013-04-29 15:07:09.442166774 +0200 +@@ -250,7 +250,7 @@ + + + +- ++ + + + +@@ -441,7 +441,7 @@ osname=macosx;processor=x86;processor=x8 + + + +- ++ + + + +@@ -456,7 +456,7 @@ osname=macosx;processor=x86;processor=x8 + + + +- ++ + + + +@@ -734,7 +734,7 @@ osname=macosx;processor=x86;processor=x8 + + + +- ++ + + + +@@ -845,7 +845,7 @@ osname=macosx;processor=x86;processor=x8 + + + +- ++ + + + diff --git a/SOURCES/jna-3.5.2-loadlibrary.patch b/SOURCES/jna-3.5.2-loadlibrary.patch new file mode 100644 index 0000000..b5feb18 --- /dev/null +++ b/SOURCES/jna-3.5.2-loadlibrary.patch @@ -0,0 +1,108 @@ +diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java +--- ./src/com/sun/jna/Native.java.loadlib 2013-04-29 15:23:30.988702267 +0200 ++++ ./src/com/sun/jna/Native.java 2013-04-29 15:25:55.409671266 +0200 +@@ -670,99 +670,22 @@ public final class Native { + + /** + * Loads the JNA stub library. +- * First tries jna.boot.library.path, then the system path, then from the +- * jar file. ++ * MODIFIED FROM UPSTREAM - we rip out all sorts of gunk here that is ++ * unnecessary when JNA is properly installed with the OS. + */ + private static void loadNativeLibrary() { + removeTemporaryFiles(); + +- String libName = System.getProperty("jna.boot.library.name", "jnidispatch"); +- String bootPath = System.getProperty("jna.boot.library.path"); +- if (bootPath != null) { +- // String.split not available in 1.4 +- StringTokenizer dirs = new StringTokenizer(bootPath, File.pathSeparator); +- while (dirs.hasMoreTokens()) { +- String dir = dirs.nextToken(); +- File file = new File(new File(dir), System.mapLibraryName(libName)); +- String path = file.getAbsolutePath(); +- if (file.exists()) { +- try { +- System.load(path); +- nativeLibraryPath = path; +- return; +- } catch (UnsatisfiedLinkError ex) { +- // Not a problem if already loaded in anoteher class loader +- // Unfortunately we can't distinguish the difference... +- //System.out.println("File found at " + file + " but not loadable: " + ex.getMessage()); +- } +- } +- if (Platform.isMac()) { +- String orig, ext; +- if (path.endsWith("dylib")) { +- orig = "dylib"; +- ext = "jnilib"; +- } else { +- orig = "jnilib"; +- ext = "dylib"; +- } +- path = path.substring(0, path.lastIndexOf(orig)) + ext; +- if (new File(path).exists()) { +- try { +- System.load(path); +- nativeLibraryPath = path; +- return; +- } catch (UnsatisfiedLinkError ex) { +- System.err.println("File found at " + path + " but not loadable: " + ex.getMessage()); +- } +- } +- } +- } +- } +- if (Platform.isAndroid()) { +- // Native libraries on android must be bundled with the APK +- System.setProperty("jna.nounpack", "true"); +- } + try { +- if (!Boolean.getBoolean("jna.nosys")) { +- System.loadLibrary(libName); +- return; +- } ++ System.load("@JNIPATH@/" + System.mapLibraryName("jnidispatch")); ++ nativeLibraryPath = "@JNIPATH@/" + System.mapLibraryName("jnidispatch"); + } + catch(UnsatisfiedLinkError e) { +- if (Boolean.getBoolean("jna.nounpack")) { +- throw e; +- } +- } +- if (!Boolean.getBoolean("jna.nounpack")) { +- loadNativeLibraryFromJar(); +- return; ++ throw new RuntimeException(e); + } +- throw new UnsatisfiedLinkError("Native jnidispatch library not found"); + } + + static final String JNA_TMPLIB_PREFIX = "jna"; +- /** +- * Attempts to load the native library resource from the filesystem, +- * extracting the JNA stub library from jna.jar if not already available. +- */ +- private static void loadNativeLibraryFromJar() { +- try { +- String prefix = "com/sun/jna/" + getNativeLibraryResourcePrefix(); +- File lib = extractFromResourcePath("jnidispatch", prefix, Native.class.getClassLoader()); +- System.load(lib.getAbsolutePath()); +- nativeLibraryPath = lib.getAbsolutePath(); +- // Attempt to delete immediately once jnidispatch is successfully +- // loaded. This avoids the complexity of trying to do so on "exit", +- // which point can vary under different circumstances (native +- // compilation, dynamically loaded modules, normal application, etc). +- if (isUnpacked(lib)) { +- deleteLibrary(lib); +- } +- } +- catch(IOException e) { +- throw new UnsatisfiedLinkError(e.getMessage()); +- } +- } + + /** Identify temporary files unpacked from classpath jar files. */ + static boolean isUnpacked(File file) { diff --git a/SOURCES/package-list b/SOURCES/package-list new file mode 100644 index 0000000..fecd4d4 --- /dev/null +++ b/SOURCES/package-list @@ -0,0 +1,135 @@ +java.applet +java.awt +java.awt.color +java.awt.datatransfer +java.awt.dnd +java.awt.event +java.awt.font +java.awt.geom +java.awt.im +java.awt.im.spi +java.awt.image +java.awt.image.renderable +java.awt.print +java.beans +java.beans.beancontext +java.io +java.lang +java.lang.ref +java.lang.reflect +java.math +java.net +java.nio +java.nio.channels +java.nio.channels.spi +java.nio.charset +java.nio.charset.spi +java.rmi +java.rmi.activation +java.rmi.dgc +java.rmi.registry +java.rmi.server +java.security +java.security.acl +java.security.cert +java.security.interfaces +java.security.spec +java.sql +java.text +java.util +java.util.jar +java.util.logging +java.util.prefs +java.util.regex +java.util.zip +javax.accessibility +javax.crypto +javax.crypto.interfaces +javax.crypto.spec +javax.imageio +javax.imageio.event +javax.imageio.metadata +javax.imageio.plugins.jpeg +javax.imageio.spi +javax.imageio.stream +javax.naming +javax.naming.directory +javax.naming.event +javax.naming.ldap +javax.naming.spi +javax.net +javax.net.ssl +javax.print +javax.print.attribute +javax.print.attribute.standard +javax.print.event +javax.rmi +javax.rmi.CORBA +javax.security.auth +javax.security.auth.callback +javax.security.auth.kerberos +javax.security.auth.login +javax.security.auth.spi +javax.security.auth.x500 +javax.security.cert +javax.sound.midi +javax.sound.midi.spi +javax.sound.sampled +javax.sound.sampled.spi +javax.sql +javax.swing +javax.swing.border +javax.swing.colorchooser +javax.swing.event +javax.swing.filechooser +javax.swing.plaf +javax.swing.plaf.basic +javax.swing.plaf.metal +javax.swing.plaf.multi +javax.swing.table +javax.swing.text +javax.swing.text.html +javax.swing.text.html.parser +javax.swing.text.rtf +javax.swing.tree +javax.swing.undo +javax.transaction +javax.transaction.xa +javax.xml.parsers +javax.xml.transform +javax.xml.transform.dom +javax.xml.transform.sax +javax.xml.transform.stream +org.ietf.jgss +org.omg.CORBA +org.omg.CORBA.DynAnyPackage +org.omg.CORBA.ORBPackage +org.omg.CORBA.TypeCodePackage +org.omg.CORBA.portable +org.omg.CORBA_2_3 +org.omg.CORBA_2_3.portable +org.omg.CosNaming +org.omg.CosNaming.NamingContextExtPackage +org.omg.CosNaming.NamingContextPackage +org.omg.Dynamic +org.omg.DynamicAny +org.omg.DynamicAny.DynAnyFactoryPackage +org.omg.DynamicAny.DynAnyPackage +org.omg.IOP +org.omg.IOP.CodecFactoryPackage +org.omg.IOP.CodecPackage +org.omg.Messaging +org.omg.PortableInterceptor +org.omg.PortableInterceptor.ORBInitInfoPackage +org.omg.PortableServer +org.omg.PortableServer.CurrentPackage +org.omg.PortableServer.POAManagerPackage +org.omg.PortableServer.POAPackage +org.omg.PortableServer.ServantLocatorPackage +org.omg.PortableServer.portable +org.omg.SendingContext +org.omg.stub.java.rmi +org.w3c.dom +org.xml.sax +org.xml.sax.ext +org.xml.sax.helpers diff --git a/SPECS/jna.spec b/SPECS/jna.spec new file mode 100644 index 0000000..afd361b --- /dev/null +++ b/SPECS/jna.spec @@ -0,0 +1,316 @@ +Name: jna +Version: 3.5.2 +Release: 6%{?dist} +Summary: Pure Java access to native libraries +# src/com/sun/jna/WeakIdentityHashMap.java is from apache-cxf project +License: LGPLv2+ and ASL 2.0 +URL: https://jna.dev.java.net/ +Source0: %{name}-%{version}.tar.xz +Source1: package-list +# script used to generate clean tarball without bundled things +Source2: generate-tarball.sh +# needed for all apache licensed code +Source3: http://www.apache.org/licenses/LICENSE-2.0 +Patch0: jna-3.5.0-build.patch +# This patch is Fedora-specific for now until we get the huge +# JNI library location mess sorted upstream +Patch1: jna-3.5.2-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.4.0-tests-headless.patch +# Build using GCJ javadoc +Patch3: jna-3.5.2-gcj-javadoc.patch +# junit comes from rpm +Patch4: jna-3.5.2-junit.patch + +# We manually require libffi because find-requires doesn't work +# inside jars. +Requires: java, jpackage-utils, libffi +BuildRequires: java-devel, jpackage-utils, libffi-devel +BuildRequires: ant, ant-junit, junit +BuildRequires: libX11-devel, libXt-devel + +%description +JNA provides Java programs easy access to native shared libraries +(DLLs on Windows) without writing anything but Java code. JNA's +design aims to provide native access in a natural way with a +minimum of effort. No boilerplate or generated code is required. +While some attention is paid to performance, correctness and ease +of use take priority. + +%package javadoc +Summary: Javadocs for %{name} +BuildArch: noarch + +%description javadoc +This package contains the javadocs for %{name}. + +%package contrib +Summary: Contrib for %{name} +Requires: %{name} = %{version}-%{release} +Obsoletes: %{name}-examples +# contrib/platform/src/com/sun/jna/platform/mac/Carbon.java is LGPLv3 +# contrib/x11/src/jnacontrib/x11/api/X11KeySymDef.java is MIT +License: LGPLv2+ and LGPLv3+ and MIT +BuildArch: noarch + +%description contrib +This package contains the contributed examples for %{name}. + +%prep +%setup -q -n %{name}-%{version} +cp %{SOURCE1} %{SOURCE3} . +%patch0 -p1 -b .build +sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1 +%patch2 -p1 -b .tests-headless +chmod -Rf a+rX,u+w,g-w,o-w . +%patch3 -p0 -b .gcj-javadoc +%patch4 -p1 -b .junit + +# UnloadTest fail during build since we modify class loading +rm test/com/sun/jna/JNAUnloadTest.java +# current bug: https://jna.dev.java.net/issues/show_bug.cgi?id=155 +#rm test/com/sun/jna/DirectTest.java + +# all java binaries must be removed from the sources +find . -name '*.class' -delete + +# native directory contains empty *jar files so ant doesn't fail +find . -name '*.jar' -not -path '*lib/native/*' -print -delete + +# clean LICENSE.txt +sed -i 's/\r//' LICENSE + +chmod -c 0644 LICENSE OTHERS CHANGES.md + + +%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 compile native javadoc jar contrib-jars +#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true clean dist +# remove compiled contribs +find contrib -name build -exec rm -rf {} \; || : + +%install +# jars +install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar +install -d -m 755 %{buildroot}%{_javadir}/%{name} +find contrib -name '*.jar' -exec cp {} %{buildroot}%{_javadir}/%{name}/ \; +# 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 maven pom file +install -Dm 644 pom-%{name}.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom +install -Dm 644 pom-platform.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-platform.pom + +# ... and maven depmap +%add_maven_depmap JPP-%{name}.pom %{name}.jar +%add_maven_depmap JPP.%{name}-platform.pom -f platform %{name}/platform.jar + +# javadocs +install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name} +cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name} + + +%files +%doc LICENSE LICENSE-2.0 OTHERS README.md CHANGES.md TODO +%{_libdir}/%{name} +%{_javadir}/%{name}.jar +%{_mavenpomdir}/JPP-%{name}.pom +%{_mavendepmapfragdir}/%{name} + +%files javadoc +%doc LICENSE LICENSE-2.0 +%{_javadocdir}/%{name} + +%files contrib +%{_javadir}/%{name} +%{_mavenpomdir}/JPP.%{name}-platform.pom +%{_mavendepmapfragdir}/%{name}-platform + + +%changelog +* Tue Aug 06 2013 Stanislav Ochotnicky - 3.5.2-6 +- Add LGPLv3+ and MIT licenses to contrib subpackage + +* Mon Aug 05 2013 Stanislav Ochotnicky - 3.5.2-5 +- Add ASL 2.0 license text + +* Fri Aug 02 2013 Stanislav Ochotnicky - 3.5.2-4 +- Clean bundled jars from tarball + +* Fri Jul 12 2013 Mikolaj Izdebski - 3.5.2-3 +- Update to current packaging guidelines + +* Fri Jun 28 2013 Mikolaj Izdebski - 3.5.2-2 +- Fix ant-trax and ant-nodeps BR + +* Fri Jun 28 2013 Mikolaj Izdebski - 3.5.2-2 +- Rebuild to regenerate API documentation +- Resolves: CVE-2013-1571 + +* Thu Apr 25 2013 Levente Farkas - 3.5.2-1 +- Update to 3.5.2 + +* Thu Feb 14 2013 Fedora Release Engineering - 3.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 3.4.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jun 20 2012 Levente Farkas - 3.4.0-4 +- fix #833786 by Mary Ellen Foster + +* Wed Mar 14 2012 Juan Hernandez - 3.4.0-3 +- Generate correctly the maven dependencies map (#) + +* Sun Mar 11 2012 Ville Skyttä - 3.4.0-2 +- Don't strip binaries too early, build with $RPM_LD_FLAGS (#802020). + +* Wed Mar 7 2012 Levente Farkas - 3.4.0-1 +- Update to 3.4.0 + +* Fri Jan 13 2012 Fedora Release Engineering - 3.2.7-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 3.2.7-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 9 2010 Ville Skyttä - 3.2.7-11 +- Drop dependency on main package from -javadoc. +- Add license to -javadoc, and OTHERS and TODO to main package docs. +- Install javadocs and jars unversioned. +- Fix release-notes.html permissions. +- Make -javadoc and -contrib noarch where available. + +* Fri Dec 3 2010 Levente Farkas - 3.2.7-10 +- fix pom file name #655810 +- disable check everywhere since it seems to always fail in mock + +* Fri Nov 5 2010 Dan Horák - 3.2.7-9 +- exclude checks on s390(x) + +* Tue Oct 12 2010 Levente Farkas - 3.2.7-8 +- exclude check on ppc + +* Fri Oct 8 2010 Levente Farkas - 3.2.7-7 +- fix excludearch condition + +* Wed Oct 6 2010 Levente Farkas - 3.2.7-6 +- readd excludearch for old release fix #548099 + +* Fri Oct 01 2010 Dennis Gilmore - 3.2.7-5.1 +- remove the ExcludeArch it makes no sense + +* Sun Aug 1 2010 Levente Farkas - 3.2.7-5 +- reenable test and clean up contrib files + +* Tue Jul 27 2010 Levente Farkas - 3.2.7-4 +- add Obsoletes for jna-examples + +* Sat Jul 24 2010 Levente Farkas - 3.2.7-3 +- upstream 64bit fixes + +* Fri 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 + +* Wed Apr 21 2010 Colin Walters - 3.2.4-4 +- Fix the build by removing upstream's hardcoded md5 + +* Thu Dec 17 2009 Levente Farkas - 3.2.4-3 +- add proper ExclusiveArch + +* Thu Dec 17 2009 Alexander Kurtakov 3.2.4-2 +- Comment rhel ExclusiveArchs - not correct applies on Fedora. + +* Sat Nov 14 2009 Levente Farkas - 3.2.4-1 +- Rebase on upstream 3.2.4 + +* Thu Oct 29 2009 Lubomir Rintel - 3.0.9-6 +- Add examples subpackage + +* Fri Jul 24 2009 Fedora Release Engineering - 3.0.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 3.0.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Dec 30 2008 Colin Walters - 3.0.9-3 +- Add patch to allow opening current process + +* Sun Nov 30 2008 Colin Walters - 3.0.9-2 +- Fix library mapping, remove upstreamed patches + +* Fri Oct 31 2008 Colin Walters - 3.0.9-1 +- Rebase on upstream 3.0.9 + +* Tue Oct 14 2008 Colin Walters - 3.0.4-10.svn729 +- Add patch to support String[] returns + +* Wed Oct 01 2008 Colin Walters - 3.0.4-9.svn729 +- Add new patch to support NativeMapped[] which I want + +* Wed Oct 01 2008 Colin Walters - 3.0.4-8.svn729 +- Update to svn r729 +- drop upstreamed typemapper patch + +* Thu Sep 18 2008 Colin Walters - 3.0.4-7.svn700 +- Add patch to make typemapper always accessible +- Add patch to skip cracktastic X11 test bits which currently fail + +* Tue Sep 09 2008 Colin Walters - 3.0.4-5.svn700 +- Update to upstream SVN r700; drop all now upstreamed patches + +* Sat Sep 06 2008 Colin Walters - 3.0.4-3.svn630 +- A few more patches for JGIR + +* Thu Sep 04 2008 Colin Walters - 3.0.4-2.svn630 +- Add two (sent upstream) patches that I need for JGIR + +* Thu Jul 31 2008 Colin Walters - 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 - 3.0.2-7 +- Add patch to use JPackage-compatible JNI library path +- Do build debuginfo package +- Refactor build patch greatly so it's hopefully upstreamable +- Install .so directly to JNI directory, rather than inside jar +- Clean up Requires/BuildRequires (thanks Mamoru Tasaka) + +* Sun Mar 30 2008 Conrad Meyer - 3.0.2-6 +- -javadocs should be -javadoc. +- %%files section cleaned a bit. + +* Mon Mar 17 2008 Conrad Meyer - 3.0.2-5 +- -javadocs package should be in group "Documentation". + +* Mon Mar 17 2008 Conrad Meyer - 3.0.2-4 +- License should be LGPLv2+, not GPLv2+. +- Several minor fixes. +- Fix Requires in javadoc package. + +* Sun Mar 16 2008 Conrad Meyer - 3.0.2-3 +- Don't use internal libffi. + +* Thu Mar 6 2008 Conrad Meyer - 3.0.2-2 +- Don't pull in jars from the web. + +* Mon Mar 3 2008 Conrad Meyer - 3.0.2-1 +- Initial package.