jjanco / rpms / jna

Forked from rpms/jna 5 years ago
Clone
316df79
Name:           jna
e06a9bd
Version:        3.2.4
3b3f26b
Release:        3%{?dist}
316df79
Summary:        Pure Java access to native libraries
316df79
316df79
Group:          Development/Libraries
316df79
License:        LGPLv2+
316df79
URL:            https://jna.dev.java.net/
316df79
# The source for this package was pulled from upstream's vcs. Use the
316df79
# following commands to generate the tarball:
316df79
#   svn export https://jna.dev.java.net/svn/jna/tags/%{version}/jnalib/ --username guest jna-%{version}
e06a9bd
#   rm jna-%{version}/dist/*
316df79
#   tar -cjf jna-%{version}.tar.bz2 jna-%{version}
de01bd4
Source0:        %{name}-%{version}.tar.bz2
316df79
# This patch is Fedora-specific for now until we get the huge
316df79
# JNI library location mess sorted upstream
e06a9bd
Patch1:         jna-3.2.4-loadlibrary.patch
8af8109
# The X11 tests currently segfault; overall I think the X11 JNA stuff is just a 
8af8109
# Really Bad Idea, for relying on AWT internals, using the X11 API at all,
8af8109
# and using a complex API like X11 through JNA just increases the potential
8af8109
# for problems.
e06a9bd
Patch2:         jna-3.2.4-tests-headless.patch
316df79
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
316df79
316df79
BuildRequires:  java-devel >= 1.6 ant jpackage-utils ant-nodeps
316df79
BuildRequires:  libX11-devel libXt-devel libffi-devel
316df79
# We manually require libffi because find-requires doesn't work
316df79
# inside jars.
e06a9bd
Requires:       java >= 1:1.6.0 jpackage-utils libffi
e06a9bd
# for ExcludeArch see bug: 468831
3b3f26b
%if 0%{?rhel} < 6 && 0%{?fedora} < 10
e06a9bd
ExcludeArch: ppc ppc64
e06a9bd
%endif
e06a9bd
316df79
316df79
%description
316df79
JNA provides Java programs easy access to native shared libraries
316df79
(DLLs on Windows) without writing anything but Java code. JNA's
316df79
design aims to provide native access in a natural way with a
316df79
minimum of effort. No boilerplate or generated code is required.
316df79
While some attention is paid to performance, correctness and ease
316df79
of use take priority.
316df79
316df79
316df79
%package        javadoc
316df79
Summary:        Javadocs for %{name}
316df79
Group:          Documentation
316df79
Requires:       %{name} = %{version}-%{release}
316df79
316df79
316df79
%description    javadoc
316df79
This package contains the javadocs for %{name}.
316df79
316df79
ee65463
%package        examples
ee65463
Summary:        Examples for %{name}
ee65463
Group:          Documentation
ee65463
Requires:       %{name} = %{version}-%{release}
ee65463
ee65463
ee65463
%description    examples
ee65463
This package contains the examples for %{name}.
ee65463
ee65463
316df79
%prep
de01bd4
%setup -q -n %{name}-%{version}
316df79
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
8af8109
%patch2 -p1 -b .tests-headless
316df79
316df79
# all java binaries must be removed from the sources
316df79
find . -name '*.jar' -exec rm -f '{}' \;
316df79
find . -name '*.class' -exec rm -f '{}' \;
316df79
316df79
# remove internal copy of libffi
316df79
rm -rf native/libffi
316df79
316df79
# clean LICENSE.txt
316df79
sed -i 's/\r//' LICENSE.txt
316df79
chmod 0644 LICENSE.txt
316df79
316df79
316df79
%build
316df79
# We pass -Ddynlink.native which comes from our patch because
316df79
# upstream doesn't want to default to dynamic linking.
8393d18
ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar examples
316df79
ant javadoc
316df79
316df79
316df79
%install
316df79
rm -rf %{buildroot}
316df79
316df79
# jars
8a8f307
install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
ee65463
install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-%{version}.jar
316df79
(cd %{buildroot}%{_javadir}/; for jar in `ls *-%{version}.jar`; do ln -s $jar `echo $jar | sed -e 's/-%{version}//'`; done)
316df79
# NOTE: JNA has highly custom code to look for native jars in this
316df79
# directory.  Since this roughly matches the jpackage guidelines,
316df79
# we'll leave it unchanged.
316df79
install -d -m 755 %{buildroot}%{_libdir}/%{name}
8a8f307
install -m 755 build*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
316df79
316df79
# javadocs
316df79
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
316df79
cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
316df79
316df79
316df79
%clean
316df79
rm -rf %{buildroot}
316df79
316df79
316df79
%files
316df79
%defattr(-,root,root,-)
316df79
%doc LICENSE.txt
316df79
%{_libdir}/%{name}
ee65463
%{_javadir}/%{name}.jar
ee65463
%{_javadir}/%{name}-%{version}.jar
ee65463
316df79
316df79
%files javadoc
316df79
%defattr(-,root,root,-)
316df79
%{_javadocdir}/%{name}-%{version}
316df79
316df79
ee65463
%files examples
ee65463
%defattr(-,root,root,-)
ee65463
%{_javadir}/%{name}-examples.jar
ee65463
%{_javadir}/%{name}-examples-%{version}.jar
ee65463
ee65463
316df79
%changelog
3b3f26b
* Thu Dec 17 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-3
3b3f26b
- add proper ExclusiveArch
3b3f26b
3b3f26b
* Thu Dec 17 2009 Alexander Kurtakov <akurtako@redhat.com> 3.2.4-2
3b3f26b
- Comment rhel ExclusiveArchs - not correct applies on Fedora.
3b3f26b
e06a9bd
* Sat Nov 14 2009 Levente Farkas <lfarkas@lfarkas.org> - 3.2.4-1
e06a9bd
- Rebase on upstream 3.2.4
e06a9bd
ee65463
* Thu Oct 29 2009 Lubomir Rintel <lkundrak@v3.sk> - 3.0.9-6
ee65463
- Add examples subpackage
ee65463
c835e20
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-5
c835e20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c835e20
bc1bf31
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.9-4
bc1bf31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
bc1bf31
0143857
* Tue Dec 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-3
0143857
- Add patch to allow opening current process
0143857
365bfa6
* Sun Nov 30 2008 Colin Walters <walters@redhat.com> - 3.0.9-2
365bfa6
- Fix library mapping, remove upstreamed patches
365bfa6
de01bd4
* Fri Oct 31 2008 Colin Walters <walters@redhat.com> - 3.0.9-1
de01bd4
- Rebase on upstream 3.0.9
de01bd4
6907483
* Tue Oct 14 2008 Colin Walters <walters@redhat.com> - 3.0.4-10.svn729
6907483
- Add patch to support String[] returns
6907483
920367d
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-9.svn729
920367d
- Add new patch to support NativeMapped[] which I want
920367d
cc7c003
* Wed Oct 01 2008 Colin Walters <walters@redhat.com> - 3.0.4-8.svn729
cc7c003
- Update to svn r729
cc7c003
- drop upstreamed typemapper patch
cc7c003
8af8109
* Tue Sep 18 2008 Colin Walters <walters@redhat.com> - 3.0.4-7.svn700
8af8109
- Add patch to make typemapper always accessible
8af8109
- Add patch to skip cracktastic X11 test bits which currently fail
8af8109
ec1cd2d
* Tue Sep 09 2008 Colin Walters <walters@redhat.com> - 3.0.4-5.svn700
85c51a9
- Update to upstream SVN r700; drop all now upstreamed patches
85c51a9
8e879d7
* Sat Sep 06 2008 Colin Walters <walters@redhat.com> - 3.0.4-3.svn630
8e879d7
- A few more patches for JGIR
8e879d7
e910699
* Thu Sep 04 2008 Colin Walters <walters@redhat.com> - 3.0.4-2.svn630
e910699
- Add two (sent upstream) patches that I need for JGIR
e910699
dad708b
* Thu Jul 31 2008 Colin Walters <walters@redhat.com> - 3.0.4-1.svn630
dad708b
- New upstream version, drop upstreamed patch parts
dad708b
- New patch jna-3.0.4-nomixedjar.patch which ensures that we don't
dad708b
  include the .so in the .jar
dad708b
316df79
* Fri Apr 04 2008 Colin Walters <walters@redhat.com> - 3.0.2-7
316df79
- Add patch to use JPackage-compatible JNI library path
316df79
- Do build debuginfo package
316df79
- Refactor build patch greatly so it's hopefully upstreamable
316df79
- Install .so directly to JNI directory, rather than inside jar
316df79
- Clean up Requires/BuildRequires (thanks Mamoru Tasaka)
316df79
316df79
* Sun Mar 30 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-6
316df79
- -javadocs should be -javadoc.
316df79
- %%files section cleaned a bit.
316df79
316df79
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-5
316df79
- -javadocs package should be in group "Documentation".
316df79
316df79
* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-4
316df79
- License should be LGPLv2+, not GPLv2+.
316df79
- Several minor fixes.
316df79
- Fix Requires in javadoc package.
316df79
316df79
* Sun Mar 16 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-3
316df79
- Don't use internal libffi.
316df79
316df79
* Thu Mar 6 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-2
316df79
- Don't pull in jars from the web.
316df79
316df79
* Mon Mar 3 2008 Conrad Meyer <konrad@tylerc.org> - 3.0.2-1
316df79
- Initial package.