88 lines
2.7 KiB
RPMSpec
88 lines
2.7 KiB
RPMSpec
%global cluster jnr
|
|
%global sover 1.2
|
|
Name: jffi
|
|
Version: 1.2.13
|
|
Release: 1
|
|
Summary: Java Foreign Function Interface
|
|
License: LGPL-3.0-or-later OR Apache-2.0
|
|
URL: http://github.com/jnr/jffi
|
|
Source0: https://github.com/%{cluster}/%{name}/archive/%{name}-%{version}.tar.gz
|
|
Source3: p2.inf
|
|
Patch0: jffi-fix-dependencies-in-build-xml.patch
|
|
Patch1: jffi-add-built-jar-to-test-classpath.patch
|
|
Patch2: jffi-fix-compilation-flags.patch
|
|
Patch3: jffi-1.2.12-no_javah.patch
|
|
Patch4: jffi-fix-system-ffi.patch
|
|
BuildRequires: ant ant-junit fdupes gcc libffi-devel make maven-local unzip mvn(junit:junit)
|
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
|
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
|
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
|
|
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
|
|
%description
|
|
An optimized Java interface to libffi.
|
|
|
|
%package native
|
|
Summary: The %{name} JAR with native bits
|
|
%description native
|
|
This package contains %{name} JAR with native bits.
|
|
|
|
%package javadoc
|
|
Summary: Javadoc for %{name}
|
|
BuildArch: noarch
|
|
%description javadoc
|
|
This package contains the API documentation for %{name}.
|
|
|
|
%prep
|
|
%setup -q -n %{name}-%{name}-%{version}
|
|
%patch0
|
|
%patch1
|
|
%patch2
|
|
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 1.8}%{!?pkg_vcmp:0}
|
|
%patch3 -p1
|
|
%endif
|
|
%patch4
|
|
sed -i.cpu -e '/m\$(MODEL)/d' jni/GNUmakefile libtest/GNUmakefile
|
|
rm -rf archive/* jni/libffi/ jni/win32/ lib/CopyLibs/ lib/junit*
|
|
find ./ -name '*.jar' -exec rm -f '{}' \;
|
|
find ./ -name '*.class' -exec rm -f '{}' \;
|
|
build-jar-repository -s -p lib/ junit hamcrest/core
|
|
%{mvn_package} 'com.github.jnr:jffi::native:' native
|
|
%{mvn_file} ':{*}' %{name}/@1 @1
|
|
|
|
%build
|
|
ant jar build-native -Duse.system.libffi=1
|
|
cp -p dist/jffi-*-Linux.jar archive/
|
|
%{mvn_build}
|
|
|
|
%install
|
|
%mvn_install
|
|
%fdupes -s %{buildroot}%{_javadocdir}
|
|
mkdir -p META-INF/
|
|
cp %{SOURCE3} META-INF/
|
|
jar uf %{buildroot}%{_jnidir}/%{name}/%{name}.jar META-INF/p2.inf
|
|
install -dm 755 %{buildroot}%{_libdir}/%{name}
|
|
unzip dist/jffi-*-Linux.jar
|
|
mv jni/*-Linux %{buildroot}%{_libdir}/%{name}/
|
|
pushd %{buildroot}%{_libdir}/%{name}/*
|
|
chmod +x lib%{name}-%{sover}.so
|
|
ln -s lib%{name}-%{sover}.so lib%{name}.so
|
|
popd
|
|
|
|
%check
|
|
sed -i 's|-Werror||' libtest/GNUmakefile
|
|
ant -Duse.system.libffi=1 test
|
|
|
|
%files -f .mfiles
|
|
%doc COPYING.GPL COPYING.LESSER LICENSE
|
|
|
|
%files native -f .mfiles-native
|
|
%{_libdir}/%{name}
|
|
%doc COPYING.GPL COPYING.LESSER LICENSE
|
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
%doc COPYING.GPL COPYING.LESSER LICENSE
|
|
|
|
%changelog
|
|
* Thu Jul 30 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.2.13-1
|
|
- Package init
|