Update to upstream version 2.1

This commit is contained in:
Marian Koncek 2019-08-21 10:11:10 +02:00
parent 21d87b440a
commit f6468e545d
3 changed files with 46 additions and 94 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@
/noarch
/.build-*.log
/hamcrest-java-1.3.tar.gz
/hamcrest-2.1.tar.gz

View File

@ -29,135 +29,86 @@
#
Name: hamcrest
Version: 1.3
Release: 24%{?dist}
Version: 2.1
Release: 1%{?dist}
Summary: Library of matchers for building test expressions
License: BSD
URL: https://github.com/hamcrest/JavaHamcrest
Source0: https://github.com/hamcrest/JavaHamcrest/archive/hamcrest-java-%{version}.tar.gz
Source0: https://github.com/hamcrest/JavaHamcrest/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://repo1.maven.org/maven2/org/hamcrest/hamcrest/%{version}/hamcrest-%{version}.pom
Source8: hamcrest-core-MANIFEST.MF
Source9: hamcrest-library-MANIFEST.MF
Source11: hamcrest-integration-MANIFEST.MF
Source12: hamcrest-generator-MANIFEST.MF
Patch0: %{name}-%{version}-build.patch
Patch1: %{name}-%{version}-no-jarjar.patch
Patch3: %{name}-%{version}-javadoc.patch
Patch4: %{name}-%{version}-qdox-2.0.patch
Patch5: %{name}-%{version}-fork-javac.patch
Requires: qdox
Requires: easymock >= 3.0
Requires: %{name}-core = %{version}-%{release}
BuildRequires: javapackages-local
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: easymock
BuildRequires: junit
BuildRequires: qdox
BuildRequires: testng
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildArch: noarch
Obsoletes: hamcrest-demo < 2.1
%description
Provides a library of matcher objects (also known as constraints or predicates)
allowing 'match' rules to be defined declaratively, to be used in other
frameworks. Typical scenarios include testing frameworks, mocking libraries and
UI validation rules.
%package core
Summary: Core API of hamcrest matcher framework.
%description core
The core API of hamcrest matcher framework to be used by third-party framework providers.
This includes the a foundation set of matcher implementations for common operations.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demos for %{name}
Requires: %{name} = %{version}-%{release}
Requires: junit
Requires: testng
%description demo
Demonstrations and samples for %{name}.
%prep
%setup -q -n JavaHamcrest-%{name}-java-%{version}
%setup -q -n JavaHamcrest-%{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-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
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
ln -sf $(build-classpath testng-jdk15) lib/integration/
rm -rf docs
rm -rf *gradle*
rm -rf */*.gradle
%patch0 -p1
%patch1 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
mv hamcrest/src .
rm -rf hamcrest
rm -rf hamcrest-core
rm -rf hamcrest-integration
rm -rf hamcrest-library
cp -p %{SOURCE1} pom.xml
%pom_add_dep junit:junit
%pom_xpath_inject pom:project '
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>'
%mvn_alias org.hamcrest:hamcrest org.hamcrest:hamcrest-all
%mvn_alias org.hamcrest:hamcrest org.hamcrest:hamcrest-core
%mvn_alias org.hamcrest:hamcrest org.hamcrest:hamcrest-library
sed -i 's/\r//' LICENSE.txt
%build
export CLASSPATH=$(build-classpath qdox)
export OPT_JAR_LIST="junit ant/ant-junit"
# The unit-test goal is switched off as some tests fail with JDK 7
# see https://github.com/hamcrest/JavaHamcrest/issues/30
ant -Dant.build.javac.source=1.5 -Dversion=%{version} -Dbuild.sysclasspath=last clean core generator library bigjar javadoc
# inject OSGi manifests
jar ufm build/%{name}-core-%{version}.jar %{SOURCE8}
jar ufm build/%{name}-library-%{version}.jar %{SOURCE9}
jar ufm build/%{name}-integration-%{version}.jar %{SOURCE11}
jar ufm build/%{name}-generator-%{version}.jar %{SOURCE12}
%mvn_build
%install
sed -i 's/@VERSION@/%{version}/g' pom/*.pom
%mvn_artifact pom/hamcrest-parent.pom
for mod in all core generator library integration; do
%mvn_artifact pom/hamcrest-$mod.pom build/%{name}-$mod-%{version}.jar
done
%mvn_package :hamcrest-parent core
%mvn_package :hamcrest-core core
%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/
%mvn_install
%files -f .mfiles
%files core -f .mfiles-core
%doc README.md
%license LICENSE.txt
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%files demo
%{_datadir}/%{name}
%changelog
* Mon Aug 19 2019 Marian Koncek <mkoncek@redhat.com> - 2.1-1
- Update to upstream version 2.1
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.3-24
- Mass rebuild for javapackages-tools 201901

View File

@ -1 +1 @@
SHA512 (hamcrest-java-1.3.tar.gz) = 4356df7b5b78f821847fde027b416b49b8456e84ab2ec98c2982adf54e2bdc01a5ca2c2b5425620c5ee34bfe3f95ea43c77190504f76ddc9f8b93b137a4ca54b
SHA512 (hamcrest-2.1.tar.gz) = 15a67b040cf95141b241e201bd5ff14b913dea53fd2dc8305e8d2768e5e214457efa1eed75e66d95a0be575b6c5b611e281886c7661d75e186165c3861698abc