update for epel too

This commit is contained in:
Levente Farkas 2015-09-17 22:43:53 +02:00
parent 41d3e20910
commit 9f817761ec
3 changed files with 57 additions and 58 deletions

28
generate-tarball-rhel.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -e
version=`grep Version: *spec | sed -e 's/Version:\s*\(.*\)/\1/'`
wget https://github.com/java-native-access/jna/archive/${version}.tar.gz -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
touch empty
jar cf $njar empty
rm -f empty
done
find jna-${version} -iname '*jar' ! -iname 'reflections*.jar' -size +1b -delete
find jna-${version} -name '*.class' -delete
tar cf jna-${version}-clean.tar jna-${version}
xz -9 jna-${version}-clean.tar

View File

@ -1,48 +0,0 @@
diff -up ./build.xml.junit ./build.xml
--- ./build.xml.junit 2014-03-07 12:52:05.899899902 +0100
+++ ./build.xml 2014-03-07 12:58:14.956255306 +0100
@@ -290,7 +290,7 @@
<target name="-setup" depends="-dynamic-properties">
<path id="compile-test.path">
<path id="test.libs">
- <fileset dir="lib">
+ <fileset dir="/usr/share/java">
<include name="junit.jar"/>
</fileset>
<fileset dir="lib/test"/>
@@ -486,7 +486,7 @@ osname=macosx;processor=x86;processor=x8
<subant target="jar" failonerror="true">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
- <property name="libs.junit.classpath" location="lib/junit.jar"/>
+ <property name="libs.junit.classpath" location="/usr/share/java/junit.jar"/>
<property name="javac.source" value="${platform.compatibility}"/>
<property name="javac.target" value="${platform.compatibility}"/>
<!-- OSGi manifest properties -->
@@ -509,7 +509,7 @@ osname=macosx;processor=x86;processor=x8
<subant target="jar" failonerror="true">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
- <property name="libs.junit.classpath" location="lib/junit.jar"/>
+ <property name="libs.junit.classpath" location="/usr/share/java/junit.jar"/>
<fileset dir="${contrib}" includes="*/build.xml" excludes="platform/build.xml"/>
</subant>
</target>
@@ -822,7 +822,7 @@ osname=macosx;processor=x86;processor=x8
<mkdir dir="${build}/jws"/>
<copy todir="${build}/jws" file="${build}/${jar}"/>
<copy todir="${build}/jws" file="${build}/${testjar}"/>
- <copy todir="${build}/jws" file="lib/junit.jar"/>
+ <copy todir="${build}/jws" file="/usr/share/java/junit.jar"/>
<copy todir="${build}/jws" file="lib/clover.jar"/>
<jar jarfile="${build}/jws/jnidispatch.jar">
<fileset dir="${build.native}" includes="*jnidispatch.*"/>
@@ -933,7 +933,7 @@ osname=macosx;processor=x86;processor=x8
<subant target="test" failonerror="true" inheritall="true" inheritrefs="true">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
- <property name="libs.junit.classpath" location="lib/junit.jar"/>
+ <property name="libs.junit.classpath" location="/usr/share/java/junit.jar"/>
<property name="javac.source" value="${test.compatibility}"/>
<property name="javac.target" value="${test.compatibility}"/>
<fileset dir="${contrib}" includes="platform/build.xml"/>

View File

@ -1,6 +1,6 @@
Name: jna
Version: 4.2.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Pure Java access to native libraries
# Most of code is dual-licensed under either LGPL 2.1 only or Apache
# License 2.0. WeakIdentityHashMap.java was taken from Apache CXF,
@ -10,7 +10,11 @@ URL: https://github.com/java-native-access/jna/
# ./generate-tarball.sh
Source0: %{name}-%{version}-clean.tar.xz
Source1: package-list
%if 0%{?fedora}
Source2: generate-tarball.sh
%else
Source2: generate-tarball-rhel.sh
%endif
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
@ -20,8 +24,6 @@ Patch1: jna-4.2.0-loadlibrary.patch
# and using a complex API like X11 through JNA just increases the potential
# for problems.
Patch2: jna-4.0.0-tests-headless.patch
# junit cames from rpm
Patch4: jna-4.1.0-junit.patch
# We manually require libffi because find-requires doesn't work
# inside jars.
@ -32,6 +34,7 @@ BuildRequires: libX11-devel, libXt-devel
%if 0%{?fedora}
BuildRequires: reflections
%endif
# no
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: ant-nodeps, ant-trax
%endif
@ -87,7 +90,7 @@ sed -i 's/\r//' LICENSE
chmod -c 0644 LICENSE OTHERS CHANGES.md
%if 0%{?rhel}
%patch4 -p1 -b .junit
sed s,'<include name="junit.jar"/>,&<include name="reflections-0.9.8.jar"/>,' -i build.xml
build-jar-repository -s -p lib junit
%else
sed s,'<include name="junit.jar"/>,&<include name="reflections.jar"/>,' -i build.xml
@ -116,18 +119,14 @@ find contrib -name '*.jar' -exec cp {} %{buildroot}%{_javadir}/%{name}/ \;
install -d -m 755 %{buildroot}%{_libdir}/%{name}
install -m 755 build/native*/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
%if 0%{?fedora}
# install maven pom file
install -Dm 644 pom-%{name}.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
install -Dm 644 pom-%{name}-platform.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-platform.pom
# ... and maven depmap
%if 0%{?fedora} >= 9 || 0%{?rhel} > 6
%add_maven_depmap JPP-%{name}.pom %{name}.jar
%add_maven_depmap JPP.%{name}-%{name}-platform.pom -f platform %{name}/%{name}-platform.jar -a "net.java.dev.jna:platform"
%else
%add_to_maven_depmap net.java.dev.jna jna-platform %{version} JPP jna-platform
mv %{buildroot}%{_mavendepmapfragdir}/%{name} %{buildroot}%{_mavendepmapfragdir}/%{name}-platform
%add_to_maven_depmap net.java.dev.jna %{name} %{version} JPP %{name}
%endif
# javadocs
@ -135,7 +134,7 @@ install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
#if 0%{?rhel} >= 6 || 0%{?fedora} >= 9
#if 0%{?rhel} >= 6 || 0%{?fedora}
#ifnarch ppc s390 s390x
#check
#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true test
@ -143,22 +142,42 @@ cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
#endif
%if 0%{?fedora}
%files -f .mfiles
%else
%files
%{_javadir}/%{name}.jar
%endif
%doc OTHERS README.md CHANGES.md TODO
%if 0%{?fedora}
%license LICENSE LGPL2.1 ASL2.0
%else
%doc LICENSE LGPL2.1 ASL2.0
%endif
%{_libdir}/%{name}
%files javadoc
%if 0%{?fedora}
%license LICENSE LGPL2.1 ASL2.0
%else
%doc LICENSE LGPL2.1 ASL2.0
%endif
%{_javadocdir}/%{name}
%if 0%{?fedora}
%files contrib -f .mfiles-platform
%else
%files contrib
%endif
%{_javadir}/%{name}
%changelog
* Thu Sep 17 2015 Levente Farkas <lfarkas@lfarkas.org> - 4.2.0-1
- Update to 4.2.0
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild