Blame SPECS/jna.spec

220db9
%{?scl:%scl_package jna}
220db9
%{!?scl:%global pkg_name %{name}}
220db9
220db9
%global baserelease 5
220db9
220db9
Name:           %{?scl_prefix}jna
220db9
Version:        5.4.0
220db9
Release:        0.%{baserelease}%{?dist}
220db9
Summary:        Pure Java access to native libraries
220db9
# Most of code is dual-licensed under either LGPL 2.1+ only or Apache
220db9
# License 2.0.  WeakIdentityHashMap.java was taken from Apache CXF,
220db9
# which is pure Apache License 2.0.
220db9
License:        (LGPLv2+ or ASL 2.0) and ASL 2.0
220db9
URL:            https://github.com/java-native-access/jna/
220db9
# ./generate-tarball.sh
220db9
Source0:        %{pkg_name}-%{version}-clean.tar.xz
220db9
Source1:        package-list
220db9
Source2:        generate-tarball.sh
220db9
Patch0:         0001-Adapt-build.patch
220db9
# This patch is Fedora-specific for now until we get the huge
220db9
# JNI library location mess sorted upstream
220db9
Patch1:         0002-Load-system-library.patch
220db9
# The X11 tests currently segfault; overall I think the X11 JNA stuff is just a
220db9
# Really Bad Idea, for relying on AWT internals, using the X11 API at all,
220db9
# and using a complex API like X11 through JNA just increases the potential
220db9
# for problems.
220db9
Patch2:         0003-Tests-headless.patch
220db9
# Adds --allow-script-in-comments arg to javadoc to avoid error
220db9
Patch3:         0004-Fix-javadoc-build.patch
220db9
# Avoid generating duplicate manifest entry
220db9
# See https://bugzilla.redhat.com/show_bug.cgi?id=1469022
220db9
Patch4:         0005-Fix-duplicate-manifest-entry.patch
220db9
# We don't want newly added warnings to break our build
220db9
Patch5:         0006-Remove-Werror.patch
220db9
220db9
# We manually require libffi because find-requires doesn't work
220db9
# inside jars.
220db9
Requires:       libffi
220db9
BuildRequires:  gcc
220db9
BuildRequires:  make
220db9
BuildRequires:  %{?scl_prefix_maven}javapackages-local
220db9
BuildRequires:  libffi-devel
220db9
BuildRequires:  %{?scl_prefix_maven}ant
220db9
BuildRequires:  %{?scl_prefix_maven}ant-junit
220db9
BuildRequires:  %{?scl_prefix_maven}junit
220db9
BuildRequires:  libX11-devel
220db9
BuildRequires:  libXt-devel
220db9
220db9
%description
220db9
JNA provides Java programs easy access to native shared libraries
220db9
(DLLs on Windows) without writing anything but Java code. JNA's
220db9
design aims to provide native access in a natural way with a
220db9
minimum of effort. No boilerplate or generated code is required.
220db9
While some attention is paid to performance, correctness and ease
220db9
of use take priority.
220db9
220db9
%package        javadoc
220db9
Summary:        Javadocs for %{pkg_name}
220db9
BuildArch:      noarch
220db9
220db9
%description    javadoc
220db9
This package contains the javadocs for %{pkg_name}.
220db9
220db9
%package        contrib
220db9
Summary:        Contrib for %{pkg_name}
220db9
License:        LGPLv2+ or ASL 2.0
220db9
Requires:       %{name} = %{version}-%{release}
220db9
BuildArch:      noarch
220db9
220db9
%description    contrib
220db9
This package contains the contributed examples for %{pkg_name}.
220db9
220db9
220db9
%prep
220db9
%{?scl:scl enable %{scl_maven} %{scl} - << "EOFSCL"}
220db9
set -e -x
220db9
%setup -q -n %{pkg_name}-%{version}
220db9
cp %{SOURCE1} .
220db9
%patch0 -p1 -b .build
220db9
%patch1 -p1 -b .loadlib
220db9
%patch2 -p1 -b .tests-headless
220db9
%patch3 -p1
220db9
%patch4 -p1
220db9
%patch5 -p1
220db9
220db9
chmod -Rf a+rX,u+w,g-w,o-w .
220db9
sed -i 's|@LIBDIR@|%{_libdir}/%{pkg_name}|' src/com/sun/jna/Native.java
220db9
220db9
# clean LICENSE.txt
220db9
sed -i 's/\r//' LICENSE
220db9
220db9
chmod -c 0644 LICENSE OTHERS CHANGES.md
220db9
220db9
%if %{with reflections}
220db9
sed s,'<include name="junit.jar"/>,&<include name="reflections.jar"/>,' -i build.xml
220db9
build-jar-repository -s -p lib junit reflections
220db9
%else
220db9
build-jar-repository -s -p lib junit
220db9
rm test/com/sun/jna/StructureFieldOrderInspector.java
220db9
rm test/com/sun/jna/StructureFieldOrderInspectorTest.java
220db9
%endif
220db9
ln -s $(xmvn-resolve ant:ant:1.10.5) lib/ant.jar
220db9
220db9
cp lib/native/aix-ppc64.jar lib/clover.jar
220db9
220db9
%{?scl:EOFSCL}
220db9
220db9
%build
220db9
%{?scl:scl enable %{scl_maven} %{scl} - << "EOFSCL"}
220db9
set -e -x
220db9
# We pass -Ddynlink.native which comes from our patch because
220db9
# upstream doesn't want to default to dynamic linking.
220db9
#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true native compile javadoc jar contrib-jars
220db9
#ant -Dcompatibility=1.6 -Dplatform.compatibility=1.6 -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true native jar javadoc contrib-jars
220db9
ant -Drelease -Dcompatibility=1.6 -Dplatform.compatibility=1.6\
220db9
 -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -DCC=%{__cc} native dist
220db9
# remove compiled contribs
220db9
find contrib -name build -exec rm -rf {} \; || :
220db9
%{?scl:EOFSCL}
220db9
220db9
%install
220db9
%{?scl:scl enable %{scl_maven} %{scl} - << "EOFSCL"}
220db9
set -e -x
220db9
# NOTE: JNA has highly custom code to look for native jars in this
220db9
# directory.  Since this roughly matches the jpackage guidelines,
220db9
# we'll leave it unchanged.
220db9
install -d -m 755 %{buildroot}%{_libdir}/%{pkg_name}
220db9
install -m 755 build/native*/libjnidispatch*.so %{buildroot}%{_libdir}/%{pkg_name}/
220db9
220db9
%mvn_file :jna jna jna/jna %{_javadir}/jna
220db9
220db9
%mvn_package :jna-platform contrib
220db9
%mvn_alias :jna-platform :platform
220db9
220db9
%mvn_artifact pom-jna.xml build/jna-min.jar
220db9
%mvn_artifact pom-jna-platform.xml contrib/platform/dist/jna-platform.jar
220db9
220db9
%mvn_install -J doc/javadoc
220db9
220db9
%{?scl:EOFSCL}
220db9
220db9
%files -f .mfiles
220db9
%doc OTHERS README.md CHANGES.md TODO
220db9
%license LICENSE LGPL2.1 AL2.0
220db9
%{_libdir}/%{pkg_name}
220db9
220db9
%files javadoc -f .mfiles-javadoc
220db9
%license LICENSE LGPL2.1 AL2.0
220db9
220db9
%files contrib -f .mfiles-contrib
220db9
220db9
220db9
%changelog
220db9
* Thu Dec 10 2020 Honza Horak <hhorak@redhat.com> - 5.4.0-0.5
220db9
- Rebase to 5.4.0
220db9
220db9
* Tue May 21 2019 Jakub Janco <jjanco@redhat.com> - 4.5.1-4.4
220db9
- Rebuild against java fixed meta pkg
220db9
220db9
* Thu Apr 18 2019 Jakub Janco <jjanco@redhat.com> - 4.5.1-4.3
220db9
- scl-ize for rh-mariadb103
220db9
220db9
* Tue Aug 21 2018 Mat Booth <mat.booth@redhat.com> - 4.5.1-4.2
220db9
- Remove dep on reflections library
220db9
220db9
* Tue Aug 21 2018 Mat Booth <mat.booth@redhat.com> - 4.5.1-4.1
220db9
- Auto SCL-ise package for rh-eclipse collection
220db9
220db9
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.1-4
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
220db9
220db9
* Thu Feb 22 2018 Michael Simacek <msimacek@redhat.com> - 4.5.1-3
220db9
- Disable -Werror
220db9
220db9
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.1-2
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
220db9
220db9
* Fri Jan 05 2018 Michael Simacek <msimacek@redhat.com> - 4.5.1-1
220db9
- Update to upstream version 4.5.1
220db9
220db9
* Tue Sep 19 2017 Michael Simacek <msimacek@redhat.com> - 4.5.0-1
220db9
- Update to upstream version 4.5.0
220db9
220db9
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.0-7
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
220db9
220db9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.0-6
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
220db9
220db9
* Wed Jul 19 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.4.0-5
220db9
- Fix generation of JAR manifest
220db9
- Resolves: rhbz#1472494
220db9
220db9
* Mon Jul 10 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.4.0-4
220db9
- Fix duplicate manifest bug
220db9
- Resolves: rhbz#1469022
220db9
220db9
* Fri Jul 07 2017 Michael Simacek <msimacek@redhat.com> - 4.4.0-3
220db9
- Temporarily add symlink to javadir
220db9
220db9
* Mon Jul 03 2017 Michael Simacek <msimacek@redhat.com> - 4.4.0-2
220db9
- Install with XMvn
220db9
220db9
* Tue Mar 28 2017 Michael Simacek <msimacek@redhat.com> - 4.4.0-1
220db9
- Update to upstream version 4.4.0
220db9
220db9
* Tue Feb 07 2017 Michael Simacek <msimacek@redhat.com> - 4.3.0-4
220db9
- Use --allow-script-in-comments on all arches
220db9
220db9
* Wed Feb  1 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.3.0-3
220db9
- Add missing build-requires on GCC
220db9
220db9
* Tue Jan 31 2017 Michael Simacek <msimacek@redhat.com> - 4.3.0-2
220db9
- Try to fix javadoc generation
220db9
220db9
* Mon Jan 16 2017 Michael Simacek <msimacek@redhat.com> - 4.3.0-1
220db9
- Update to upstream version 4.3.0
220db9
- Cleanup rhel macros, because packages was retired in EPEL
220db9
220db9
* Thu Mar 24 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.2-1
220db9
- Update to upstream version 4.2.2
220db9
220db9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-2
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
220db9
220db9
* Tue Oct 20 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.1-1
220db9
- Update to upstream version 4.2.1
220db9
220db9
* Thu Sep 17 2015 Levente Farkas <lfarkas@lfarkas.org> - 4.2.0-1
220db9
- Update to 4.2.0
220db9
220db9
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-9
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
220db9
220db9
* Thu Jun 11 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1.0-8
220db9
- Force Java 1.6 source/target (rhbz#842609)
220db9
- Fix licensing headers (rhbz#988808)
220db9
220db9
* Wed Oct 01 2014 Michal Srb <msrb@redhat.com> - 4.1.0-7
220db9
- Fix for 32-bit systems (Resolves: rhbz#1148349)
220db9
- Fix FTBFS (Resolves: rhbz#1106955)
220db9
220db9
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-6
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
220db9
220db9
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-5
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
220db9
220db9
* Fri Jan 10 2014 Roland Grunberg <rgrunber@redhat.com> - 4.0.0-4
220db9
- fix updated depmap
220db9
220db9
* Fri Jan 10 2014 Roland Grunberg <rgrunber@redhat.com> - 4.0.0-3
220db9
- Update depmap calls and fix tests compilation issue.
220db9
220db9
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
220db9
220db9
* Sat Jul  6 2013 Levente Farkas <lfarkas@lfarkas.org> - 4.0-1
220db9
- Update to 4.0
220db9
220db9
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.5.2-2
220db9
- Fix ant-trax and ant-nodeps BR on RHEL
220db9
220db9
* Thu Apr 25 2013 Levente Farkas <lfarkas@lfarkas.org> - 3.5.2-1
220db9
- Update to 3.5.2
220db9
220db9
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.0-2
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
220db9
220db9
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-5
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
220db9
220db9
* Wed Jun 20 2012 Levente Farkas <lfarkas@lfarkas.org> - 3.4.0-4
220db9
- fix #833786 by Mary Ellen Foster 
220db9
220db9
* Wed Mar 14 2012 Juan Hernandez <juan.hernandez@redhat.com> - 3.4.0-3
220db9
- Generate correctly the maven dependencies map (#)
220db9
220db9
* Sun Mar 11 2012 Ville Skyttä <ville.skytta@iki.fi> - 3.4.0-2
220db9
- Don't strip binaries too early, build with $RPM_LD_FLAGS (#802020).
220db9
220db9
* Wed Mar  7 2012 Levente Farkas <lfarkas@lfarkas.org> - 3.4.0-1
220db9
- Update to 3.4.0
220db9
220db9
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.7-13
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
220db9
220db9
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.7-12
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
220db9
220db9
* Thu Dec  9 2010 Ville Skyttä <ville.skytta@iki.fi> - 3.2.7-11
220db9
- Drop dependency on main package from -javadoc.
220db9
- Add license to -javadoc, and OTHERS and TODO to main package docs.
220db9
- Install javadocs and jars unversioned.
220db9
- Fix release-notes.html permissions.
220db9
- Make -javadoc and -contrib noarch where available.
220db9
220db9
* Fri Dec  3 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-10
220db9
- fix pom file name #655810
220db9
- disable check everywhere since it seems to always fail in mock
220db9
220db9
* Fri Nov  5 2010 Dan Horák <dan[at]danny.cz> - 3.2.7-9
220db9
- exclude checks on s390(x)
220db9
220db9
* Tue Oct 12 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-8
220db9
- exclude check on ppc
220db9
220db9
* Fri Oct  8 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-7
220db9
- fix excludearch condition
220db9
220db9
* Wed Oct  6 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-6
220db9
- readd excludearch for old release fix #548099
220db9
220db9
* Fri Oct 01 2010 Dennis Gilmore <dennis@ausil.us> - 3.2.7-5.1
220db9
- remove the ExcludeArch it makes no sense
220db9
220db9
* Sun Aug  1 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-5
220db9
- reenable test and clean up contrib files
220db9
220db9
* Tue Jul 27 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-4
220db9
- add Obsoletes for jna-examples
220db9
220db9
* Sat Jul 24 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-3
220db9
- upstream 64bit fixes
220db9
220db9
* Fri Jul 23 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-2
220db9
- Temporary hack for 64bit build
220db9
220db9
* Thu Jul 22 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-1
220db9
- Rebase on upstream 3.2.7
220db9
220db9
* Wed Jul 21 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.2.4-6
220db9
- Add maven depmap
220db9
220db9
* Thu Apr 22 2010 Colin Walters <walters@verbum.org> - 3.2.4-5
220db9
- Add patches to make the build happen with gcj
220db9
220db9
* Wed Apr 21 2010 Colin Walters <walters@verbum.org> - 3.2.4-4
220db9
- Fix the build by removing upstream's hardcoded md5
220db9
220db9
* Thu Dec 17 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-3
220db9
- add proper ExclusiveArch
220db9
220db9
* Thu Dec 17 2009 Alexander Kurtakov <akurtako@redhat.com> 3.2.4-2
220db9
- Comment rhel ExclusiveArchs - not correct applies on Fedora.
220db9
220db9
* Sat Nov 14 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-1
220db9
- Rebase on upstream 3.2.4
220db9
220db9
* Thu Oct 29 2009 Lubomir Rintel <lkundrak@v3.sk> - 3.0.9-6
220db9
- Add examples subpackage
220db9
220db9
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-5
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
220db9
220db9
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-4
220db9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
220db9
220db9
* Tue Dec 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-3
220db9
- Add patch to allow opening current process
220db9
220db9
* Sun Nov 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-2
220db9
- Fix library mapping, remove upstreamed patches
220db9
220db9
* Fri Oct 31 2008 Colin Walters <walters@redhat.com> - 3.0.9-1
220db9
- Rebase on upstream 3.0.9
220db9
220db9
* Tue Oct 14 2008 Colin Walters <walters@redhat.com> - 3.0.4-10.svn729
220db9
- Add patch to support String[] returns
220db9
220db9
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-9.svn729
220db9
- Add new patch to support NativeMapped[] which I want
220db9
220db9
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-8.svn729
220db9
- Update to svn r729
220db9
- drop upstreamed typemapper patch
220db9
220db9
* Thu Sep 18 2008 Colin Walters <walters@redhat.com> - 3.0.4-7.svn700
220db9
- Add patch to make typemapper always accessible
220db9
- Add patch to skip cracktastic X11 test bits which currently fail
220db9
220db9
* Tue Sep 09 2008 Colin Walters <walters@redhat.com> - 3.0.4-5.svn700
220db9
- Update to upstream SVN r700; drop all now upstreamed patches
220db9
220db9
* Sat Sep 06 2008 Colin Walters <walters@redhat.com> - 3.0.4-3.svn630
220db9
- A few more patches for JGIR
220db9
220db9
* Thu Sep 04 2008 Colin Walters <walters@redhat.com> - 3.0.4-2.svn630
220db9
- Add two (sent upstream) patches that I need for JGIR
220db9
220db9
* Thu Jul 31 2008 Colin Walters <walters@redhat.com> - 3.0.4-1.svn630
220db9
- New upstream version, drop upstreamed patch parts
220db9
- New patch jna-3.0.4-nomixedjar.patch which ensures that we don't
220db9
  include the .so in the .jar
220db9
220db9
* Fri Apr 04 2008 Colin Walters <walters@redhat.com> - 3.0.2-7
220db9
- Add patch to use JPackage-compatible JNI library path
220db9
- Do build debuginfo package
220db9
- Refactor build patch greatly so it's hopefully upstreamable
220db9
- Install .so directly to JNI directory, rather than inside jar
220db9
- Clean up Requires/BuildRequires (thanks Mamoru Tasaka)
220db9
220db9
* Sun Mar 30 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-6
220db9
- -javadocs should be -javadoc.
220db9
- %%files section cleaned a bit.
220db9
220db9
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-5
220db9
- -javadocs package should be in group "Documentation".
220db9
220db9
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-4
220db9
- License should be LGPLv2+, not GPLv2+.
220db9
- Several minor fixes.
220db9
- Fix Requires in javadoc package.
220db9
220db9
* Sun Mar 16 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-3
220db9
- Don't use internal libffi.
220db9
220db9
* Thu Mar 6 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-2
220db9
- Don't pull in jars from the web.
220db9
220db9
* Mon Mar 3 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-1
220db9
- Initial package.