4b88e4
Name:           jna
4b88e4
Version:        3.5.2
0bac9c
Release:        8%{?dist}
4b88e4
Summary:        Pure Java access to native libraries
4b88e4
# src/com/sun/jna/WeakIdentityHashMap.java is from apache-cxf project
4b88e4
License:        LGPLv2+ and ASL 2.0
4b88e4
URL:            https://jna.dev.java.net/
4b88e4
Source0:        %{name}-%{version}.tar.xz
4b88e4
Source1:        package-list
4b88e4
# script used to generate clean tarball without bundled things
4b88e4
Source2:        generate-tarball.sh
4b88e4
# needed for all apache licensed code
4b88e4
Source3:        http://www.apache.org/licenses/LICENSE-2.0
4b88e4
Patch0:         jna-3.5.0-build.patch
4b88e4
# This patch is Fedora-specific for now until we get the huge
4b88e4
# JNI library location mess sorted upstream
4b88e4
Patch1:         jna-3.5.2-loadlibrary.patch
4b88e4
# The X11 tests currently segfault; overall I think the X11 JNA stuff is just a
4b88e4
# Really Bad Idea, for relying on AWT internals, using the X11 API at all,
4b88e4
# and using a complex API like X11 through JNA just increases the potential
4b88e4
# for problems.
4b88e4
Patch2:         jna-3.4.0-tests-headless.patch
4b88e4
# Build using GCJ javadoc
4b88e4
Patch3:         jna-3.5.2-gcj-javadoc.patch
4b88e4
# junit comes from rpm
4b88e4
Patch4:         jna-3.5.2-junit.patch
4b88e4
4b88e4
# We manually require libffi because find-requires doesn't work
4b88e4
# inside jars.
4b88e4
Requires:       java, jpackage-utils, libffi
4b88e4
BuildRequires:  java-devel, jpackage-utils, libffi-devel
4b88e4
BuildRequires:  ant, ant-junit, junit
4b88e4
BuildRequires:  libX11-devel, libXt-devel
4b88e4
4b88e4
%description
4b88e4
JNA provides Java programs easy access to native shared libraries
4b88e4
(DLLs on Windows) without writing anything but Java code. JNA's
4b88e4
design aims to provide native access in a natural way with a
4b88e4
minimum of effort. No boilerplate or generated code is required.
4b88e4
While some attention is paid to performance, correctness and ease
4b88e4
of use take priority.
4b88e4
4b88e4
%package        javadoc
4b88e4
Summary:        Javadocs for %{name}
4b88e4
BuildArch:      noarch
4b88e4
4b88e4
%description    javadoc
4b88e4
This package contains the javadocs for %{name}.
4b88e4
4b88e4
%package        contrib
4b88e4
Summary:        Contrib for %{name}
4b88e4
Requires:       %{name} = %{version}-%{release}
4b88e4
Obsoletes:      %{name}-examples
4b88e4
# contrib/platform/src/com/sun/jna/platform/mac/Carbon.java is LGPLv3
4b88e4
# contrib/x11/src/jnacontrib/x11/api/X11KeySymDef.java is MIT
4b88e4
License:        LGPLv2+ and LGPLv3+ and MIT
4b88e4
BuildArch:      noarch
4b88e4
4b88e4
%description    contrib
4b88e4
This package contains the contributed examples for %{name}.
4b88e4
4b88e4
%prep
4b88e4
%setup -q -n %{name}-%{version}
4b88e4
cp %{SOURCE1} %{SOURCE3} .
4b88e4
%patch0 -p1 -b .build
4b88e4
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
4b88e4
%patch2 -p1 -b .tests-headless
4b88e4
chmod -Rf a+rX,u+w,g-w,o-w .
4b88e4
%patch3 -p0 -b .gcj-javadoc
4b88e4
%patch4 -p1 -b .junit
4b88e4
4b88e4
# UnloadTest fail during build since we modify class loading
4b88e4
rm test/com/sun/jna/JNAUnloadTest.java
4b88e4
# current bug: https://jna.dev.java.net/issues/show_bug.cgi?id=155
4b88e4
#rm test/com/sun/jna/DirectTest.java
4b88e4
4b88e4
# all java binaries must be removed from the sources
4b88e4
find . -name '*.class' -delete
4b88e4
4b88e4
# native directory contains empty *jar files so ant doesn't fail
4b88e4
find . -name '*.jar' -not -path '*lib/native/*' -print -delete
4b88e4
4b88e4
# clean LICENSE.txt
4b88e4
sed -i 's/\r//' LICENSE
4b88e4
4b88e4
chmod -c 0644 LICENSE OTHERS CHANGES.md
4b88e4
4b88e4
4b88e4
%build
4b88e4
# We pass -Ddynlink.native which comes from our patch because
4b88e4
# upstream doesn't want to default to dynamic linking.
4b88e4
ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true compile native javadoc jar contrib-jars
4b88e4
#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true clean dist
4b88e4
# remove compiled contribs
4b88e4
find contrib -name build -exec rm -rf {} \; || :
4b88e4
4b88e4
%install
4b88e4
# jars
4b88e4
install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar
4b88e4
install -d -m 755 %{buildroot}%{_javadir}/%{name}
4b88e4
find contrib -name '*.jar' -exec cp {} %{buildroot}%{_javadir}/%{name}/ \;
4b88e4
# NOTE: JNA has highly custom code to look for native jars in this
4b88e4
# directory.  Since this roughly matches the jpackage guidelines,
4b88e4
# we'll leave it unchanged.
4b88e4
install -d -m 755 %{buildroot}%{_libdir}/%{name}
4b88e4
install -m 755 build*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
4b88e4
4b88e4
# install maven pom file
4b88e4
install -Dm 644 pom-%{name}.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
4b88e4
install -Dm 644 pom-platform.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-platform.pom
4b88e4
4b88e4
# ... and maven depmap
4b88e4
%add_maven_depmap JPP-%{name}.pom %{name}.jar
4b88e4
%add_maven_depmap JPP.%{name}-platform.pom -f platform %{name}/platform.jar
4b88e4
4b88e4
# javadocs
4b88e4
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}
4b88e4
cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
4b88e4
4b88e4
4b88e4
%files
4b88e4
%doc LICENSE LICENSE-2.0 OTHERS README.md CHANGES.md TODO
4b88e4
%{_libdir}/%{name}
4b88e4
%{_javadir}/%{name}.jar
4b88e4
%{_mavenpomdir}/JPP-%{name}.pom
4b88e4
%{_mavendepmapfragdir}/%{name}
4b88e4
4b88e4
%files javadoc
4b88e4
%doc LICENSE LICENSE-2.0
4b88e4
%{_javadocdir}/%{name}
4b88e4
4b88e4
%files contrib
4b88e4
%{_javadir}/%{name}
4b88e4
%{_mavenpomdir}/JPP.%{name}-platform.pom
4b88e4
%{_mavendepmapfragdir}/%{name}-platform
4b88e4
4b88e4
4b88e4
%changelog
0bac9c
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.5.2-8
0bac9c
- Mass rebuild 2014-01-24
0bac9c
0bac9c
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.5.2-7
0bac9c
- Mass rebuild 2013-12-27
0bac9c
4b88e4
* Tue Aug 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.5.2-6
4b88e4
- Add LGPLv3+ and MIT licenses to contrib subpackage
4b88e4
4b88e4
* Mon Aug 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.5.2-5
4b88e4
- Add ASL 2.0 license text
4b88e4
4b88e4
* Fri Aug 02 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.5.2-4
4b88e4
- Clean bundled jars from tarball
4b88e4
4b88e4
* Fri Jul 12 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.5.2-3
4b88e4
- Update to current packaging guidelines
4b88e4
4b88e4
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.5.2-2
4b88e4
- Fix ant-trax and ant-nodeps BR
4b88e4
4b88e4
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.5.2-2
4b88e4
- Rebuild to regenerate API documentation
4b88e4
- Resolves: CVE-2013-1571
4b88e4
4b88e4
* Thu Apr 25 2013 Levente Farkas <lfarkas@lfarkas.org> - 3.5.2-1
4b88e4
- Update to 3.5.2
4b88e4
4b88e4
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.0-2
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4b88e4
4b88e4
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-5
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4b88e4
4b88e4
* Wed Jun 20 2012 Levente Farkas <lfarkas@lfarkas.org> - 3.4.0-4
4b88e4
- fix #833786 by Mary Ellen Foster
4b88e4
4b88e4
* Wed Mar 14 2012 Juan Hernandez <juan.hernandez@redhat.com> - 3.4.0-3
4b88e4
- Generate correctly the maven dependencies map (#)
4b88e4
4b88e4
* Sun Mar 11 2012 Ville Skyttä <ville.skytta@iki.fi> - 3.4.0-2
4b88e4
- Don't strip binaries too early, build with $RPM_LD_FLAGS (#802020).
4b88e4
4b88e4
* Wed Mar  7 2012 Levente Farkas <lfarkas@lfarkas.org> - 3.4.0-1
4b88e4
- Update to 3.4.0
4b88e4
4b88e4
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.7-13
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4b88e4
4b88e4
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.7-12
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4b88e4
4b88e4
* Thu Dec  9 2010 Ville Skyttä <ville.skytta@iki.fi> - 3.2.7-11
4b88e4
- Drop dependency on main package from -javadoc.
4b88e4
- Add license to -javadoc, and OTHERS and TODO to main package docs.
4b88e4
- Install javadocs and jars unversioned.
4b88e4
- Fix release-notes.html permissions.
4b88e4
- Make -javadoc and -contrib noarch where available.
4b88e4
4b88e4
* Fri Dec  3 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-10
4b88e4
- fix pom file name #655810
4b88e4
- disable check everywhere since it seems to always fail in mock
4b88e4
4b88e4
* Fri Nov  5 2010 Dan HorĂ¡k <dan[at]danny.cz> - 3.2.7-9
4b88e4
- exclude checks on s390(x)
4b88e4
4b88e4
* Tue Oct 12 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-8
4b88e4
- exclude check on ppc
4b88e4
4b88e4
* Fri Oct  8 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-7
4b88e4
- fix excludearch condition
4b88e4
4b88e4
* Wed Oct  6 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-6
4b88e4
- readd excludearch for old release fix #548099
4b88e4
4b88e4
* Fri Oct 01 2010 Dennis Gilmore <dennis@ausil.us> - 3.2.7-5.1
4b88e4
- remove the ExcludeArch it makes no sense
4b88e4
4b88e4
* Sun Aug  1 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-5
4b88e4
- reenable test and clean up contrib files
4b88e4
4b88e4
* Tue Jul 27 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-4
4b88e4
- add Obsoletes for jna-examples
4b88e4
4b88e4
* Sat Jul 24 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-3
4b88e4
- upstream 64bit fixes
4b88e4
4b88e4
* Fri Jul 23 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-2
4b88e4
- Temporary hack for 64bit build
4b88e4
4b88e4
* Thu Jul 22 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-1
4b88e4
- Rebase on upstream 3.2.7
4b88e4
4b88e4
* Wed Jul 21 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.2.4-6
4b88e4
- Add maven depmap
4b88e4
4b88e4
* Thu Apr 22 2010 Colin Walters <walters@verbum.org> - 3.2.4-5
4b88e4
- Add patches to make the build happen with gcj
4b88e4
4b88e4
* Wed Apr 21 2010 Colin Walters <walters@verbum.org> - 3.2.4-4
4b88e4
- Fix the build by removing upstream's hardcoded md5
4b88e4
4b88e4
* Thu Dec 17 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-3
4b88e4
- add proper ExclusiveArch
4b88e4
4b88e4
* Thu Dec 17 2009 Alexander Kurtakov <akurtako@redhat.com> 3.2.4-2
4b88e4
- Comment rhel ExclusiveArchs - not correct applies on Fedora.
4b88e4
4b88e4
* Sat Nov 14 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-1
4b88e4
- Rebase on upstream 3.2.4
4b88e4
4b88e4
* Thu Oct 29 2009 Lubomir Rintel <lkundrak@v3.sk> - 3.0.9-6
4b88e4
- Add examples subpackage
4b88e4
4b88e4
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-5
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
4b88e4
4b88e4
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-4
4b88e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
4b88e4
4b88e4
* Tue Dec 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-3
4b88e4
- Add patch to allow opening current process
4b88e4
4b88e4
* Sun Nov 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-2
4b88e4
- Fix library mapping, remove upstreamed patches
4b88e4
4b88e4
* Fri Oct 31 2008 Colin Walters <walters@redhat.com> - 3.0.9-1
4b88e4
- Rebase on upstream 3.0.9
4b88e4
4b88e4
* Tue Oct 14 2008 Colin Walters <walters@redhat.com> - 3.0.4-10.svn729
4b88e4
- Add patch to support String[] returns
4b88e4
4b88e4
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-9.svn729
4b88e4
- Add new patch to support NativeMapped[] which I want
4b88e4
4b88e4
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-8.svn729
4b88e4
- Update to svn r729
4b88e4
- drop upstreamed typemapper patch
4b88e4
4b88e4
* Thu Sep 18 2008 Colin Walters <walters@redhat.com> - 3.0.4-7.svn700
4b88e4
- Add patch to make typemapper always accessible
4b88e4
- Add patch to skip cracktastic X11 test bits which currently fail
4b88e4
4b88e4
* Tue Sep 09 2008 Colin Walters <walters@redhat.com> - 3.0.4-5.svn700
4b88e4
- Update to upstream SVN r700; drop all now upstreamed patches
4b88e4
4b88e4
* Sat Sep 06 2008 Colin Walters <walters@redhat.com> - 3.0.4-3.svn630
4b88e4
- A few more patches for JGIR
4b88e4
4b88e4
* Thu Sep 04 2008 Colin Walters <walters@redhat.com> - 3.0.4-2.svn630
4b88e4
- Add two (sent upstream) patches that I need for JGIR
4b88e4
4b88e4
* Thu Jul 31 2008 Colin Walters <walters@redhat.com> - 3.0.4-1.svn630
4b88e4
- New upstream version, drop upstreamed patch parts
4b88e4
- New patch jna-3.0.4-nomixedjar.patch which ensures that we don't
4b88e4
  include the .so in the .jar
4b88e4
4b88e4
* Fri Apr 04 2008 Colin Walters <walters@redhat.com> - 3.0.2-7
4b88e4
- Add patch to use JPackage-compatible JNI library path
4b88e4
- Do build debuginfo package
4b88e4
- Refactor build patch greatly so it's hopefully upstreamable
4b88e4
- Install .so directly to JNI directory, rather than inside jar
4b88e4
- Clean up Requires/BuildRequires (thanks Mamoru Tasaka)
4b88e4
4b88e4
* Sun Mar 30 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-6
4b88e4
- -javadocs should be -javadoc.
4b88e4
- %%files section cleaned a bit.
4b88e4
4b88e4
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-5
4b88e4
- -javadocs package should be in group "Documentation".
4b88e4
4b88e4
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-4
4b88e4
- License should be LGPLv2+, not GPLv2+.
4b88e4
- Several minor fixes.
4b88e4
- Fix Requires in javadoc package.
4b88e4
4b88e4
* Sun Mar 16 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-3
4b88e4
- Don't use internal libffi.
4b88e4
4b88e4
* Thu Mar 6 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-2
4b88e4
- Don't pull in jars from the web.
4b88e4
4b88e4
* Mon Mar 3 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-1
4b88e4
- Initial package.