Install with XMvn

- Update upstream URL
- Build from github source
- Specfile cleanup
This commit is contained in:
Michael Simacek 2017-03-21 18:05:13 +01:00
parent 1ab1ce66c9
commit 5d5cb73d10
8 changed files with 180 additions and 244 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
/*.src.rpm
/noarch
/.build-*.log
/hamcrest-java-1.3.tar.gz

View File

@ -28,36 +28,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
# This option controls jarjar on qdox
# Since bundling the qdox classes prevents upgrades, we disable it by default
%bcond_with jarjar
# This option controls tests which requires ant-junit and testng
%bcond_with tests
Name: hamcrest
Version: 1.3
Release: 18%{?dist}
Release: 19%{?dist}
Epoch: 0
Summary: Library of matchers for building test expressions
License: BSD
URL: http://code.google.com/p/hamcrest/
Group: Development/Tools
Source0: http://%{name}.googlecode.com/files/%{name}-1.3.tgz
Source1: http://repo1.maven.org/maven2/org/%{name}/%{name}-parent/%{version}/%{name}-parent-%{version}.pom
Source2: http://repo1.maven.org/maven2/org/%{name}/%{name}-library/%{version}/%{name}-library-%{version}.pom
Source3: http://repo1.maven.org/maven2/org/%{name}/%{name}-integration/%{version}/%{name}-integration-%{version}.pom
Source4: http://repo1.maven.org/maven2/org/%{name}/%{name}-generator/%{version}/%{name}-generator-%{version}.pom
Source5: http://repo1.maven.org/maven2/org/%{name}/%{name}-core/%{version}/%{name}-core-%{version}.pom
Source6: http://repo1.maven.org/maven2/org/%{name}/%{name}-all/%{version}/%{name}-all-%{version}.pom
# This file was added by the maintainer for compatibility with maven dep
# solving system
Source7: %{name}-text-%{version}.pom
URL: https://github.com/hamcrest/JavaHamcrest
Source0: https://github.com/hamcrest/JavaHamcrest/archive/hamcrest-java-%{version}.tar.gz
Source8: hamcrest-core-MANIFEST.MF
Source9: hamcrest-library-MANIFEST.MF
@ -71,25 +49,17 @@ Patch3: %{name}-%{version}-javadoc.patch
Patch4: %{name}-%{version}-qdox-2.0.patch
Patch5: %{name}-%{version}-fork-javac.patch
Requires: java-headless >= 1:1.6.0
Requires: qdox
Requires: easymock >= 3.0
Requires: %{name}-core = %{epoch}:%{version}-%{release}
BuildRequires: jpackage-utils >= 0:1.7.4
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: ant >= 0:1.6.5
BuildRequires: javapackages-local
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: zip
BuildRequires: easymock >= 3.0
%if %with jarjar
BuildRequires: jarjar
%endif
BuildRequires: easymock
BuildRequires: junit
BuildRequires: qdox
%if %with tests
BuildRequires: testng
%endif
BuildArch: noarch
@ -108,34 +78,27 @@ The core API of hamcrest matcher framework to be used by third-party framework p
This includes the a foundation set of matcher implementations for common operations.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%package demo
Group: Development/Libraries
Summary: Demos for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: junit
%if %with tests
Requires: testng
%endif
%description demo
Demonstrations and samples for %{name}.
%prep
%setup -q
%setup -q -n JavaHamcrest-%{name}-java-%{version}
find . -type f -name "*.jar" | xargs -t rm
rm -fr hamcrest-integration/src/main/java/org/hamcrest/integration/JMock1Adapter.java
rm -fr hamcrest-integration/src/main/java/org/hamcrest/JMock1Matchers.java
rm -fr hamcrest-unit-test/src/main/java/org/hamcrest/integration/JMock1AdapterTest.java
# BUILD/hamcrest-%{version}/lib/generator/jarjar-1.0rc3.jar.no
%if %with jarjar
ln -sf $(build-classpath jarjar) lib/generator/
%endif
# BUILD/hamcrest-1.1/lib/generator/qdox-1.6.1.jar.no
ln -sf $(build-classpath qdox) lib/generator/
# BUILD/hamcrest-1.1/lib/integration/easymock-2.2.jar.no
@ -143,13 +106,10 @@ ln -sf $(build-classpath easymock3) lib/integration/
# BUILD/hamcrest-1.1/lib/integration/jmock-1.10RC1.jar.no
ln -sf $(build-classpath jmock) lib/integration/
# BUILD/hamcrest-1.1/lib/integration/testng-4.6-jdk15.jar.no
%if %with tests
ln -sf $(build-classpath testng-jdk15) lib/integration/
%endif
%patch0 -p1
%if %without jarjar
%patch1 -p1
%endif
%patch3 -p1
%patch4 -p1
%patch5 -p1
@ -194,64 +154,46 @@ touch META-INF/MANIFEST.MF
zip -u build/%{name}-generator-%{version}.jar META-INF/MANIFEST.MF
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-parent.pom
%add_maven_depmap JPP.%{name}-parent.pom -f core
sed -i 's/@VERSION@/%{version}/g' pom/*.pom
install -m 644 build/%{name}-all-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/all.jar
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-all.pom
%add_maven_depmap JPP.%{name}-all.pom %{name}/all.jar
%mvn_artifact pom/hamcrest-parent.pom
install -m 644 build/%{name}-core-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/core.jar
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-core.pom
%add_maven_depmap JPP.%{name}-core.pom %{name}/core.jar -f core
for mod in all core generator library integration; do
%mvn_artifact pom/hamcrest-$mod.pom build/%{name}-all-%{version}.jar
done
install -m 644 build/%{name}-generator-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/generator.jar
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-generator.pom
%add_maven_depmap JPP.%{name}-generator.pom %{name}/generator.jar
# hamcrest-text doesn't have a pom
%mvn_artifact org.hamcrest:hamcrest-text:%{version} build/%{name}-text-%{version}.jar
install -m 644 build/%{name}-library-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/library.jar
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-library.pom
%add_maven_depmap JPP.%{name}-library.pom %{name}/library.jar
%mvn_package :hamcrest-parent core
%mvn_package :hamcrest-core core
install -m 644 build/%{name}-integration-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/integration.jar
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-integration.pom
%add_maven_depmap JPP.%{name}-integration.pom %{name}/integration.jar
install -m 644 build/%{name}-text-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/text.jar
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-text.pom
%add_maven_depmap JPP.%{name}-text.pom %{name}/text.jar
%if %with tests
install -m 644 build/%{name}-unit-test-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/unit-test.jar
%endif
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/temp/hamcrest-all-1.3-javadoc.jar.contents/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%mvn_file ':hamcrest-{*}' %{name}/@1
# demo
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr %{name}-examples $RPM_BUILD_ROOT%{_datadir}/%{name}/
%mvn_install -J build/temp/hamcrest-all-1.3-javadoc.jar.contents/
%files -f .mfiles
%doc LICENSE.txt
%dir %{_javadir}/%{name}
%if %with tests
%{_javadir}/%{name}/unit-test.jar
%endif
%files core -f .mfiles-core
%license LICENSE.txt
%files javadoc
%{_javadocdir}/%{name}
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%files demo
%{_datadir}/%{name}
%changelog
* Tue Mar 21 2017 Michael Simacek <msimacek@redhat.com> - 0:1.3-19
- Install with XMvn
- Update upstream URL
- Build from github source
- Specfile cleanup
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:1.3-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -1,8 +1 @@
29b18baac02244a9b7568d5bd5bb1c42 hamcrest-all-1.3.pom
7cd680c223f3807e1ef353466b9a4b25 hamcrest-core-1.3.pom
ba3c980bbf7d7b91d63d99da503aa3f4 hamcrest-generator-1.3.pom
442fa9ad7a4dfbd6a2ab5fca6e9b36c1 hamcrest-integration-1.3.pom
f09e58cd2a1ea76816c17141db41b2e1 hamcrest-library-1.3.pom
7591ddb3581de8684c17e51741a7461d hamcrest-parent-1.3.pom
de8c4213de11a0c2f83821bb700ac5eb hamcrest-text-1.3.pom
92e91c2754d44e49b72d70c10a04cb08 hamcrest-1.3.tgz
SHA512 (hamcrest-java-1.3.tar.gz) = 4356df7b5b78f821847fde027b416b49b8456e84ab2ec98c2982adf54e2bdc01a5ca2c2b5425620c5ee34bfe3f95ea43c77190504f76ddc9f8b93b137a4ca54b