Switch to mvn_install

This commit is contained in:
Mat Booth 2015-06-22 09:23:00 +01:00
parent 4356aaf89e
commit 427ef030ab
2 changed files with 19 additions and 41 deletions

View File

@ -1,21 +1,6 @@
diff --git a/build.xml b/build.xml
index b24eaf0..956cd72 100644
--- a/build.xml
+++ b/build.xml
@@ -44,6 +44,12 @@
<property name="maven.repository.dir" value="${basedir}/maven/repository" />
<path id="compile.classpath">
+ <fileset dir="/usr/share/java">
+ <include name="hamcrest/core.jar" />
+ <include name="junit.jar" />
+ <include name="objenesis.jar" />
+ <include name="cglib.jar" />
+ </fileset>
<fileset dir="${lib.dir.run}" includes="*.jar" />
<fileset dir="${lib.dir.compile}" includes="*.jar" />
<fileset dir="${lib.dir.repackaged}" includes="*.jar" />
@@ -81,6 +87,7 @@
--- build.xml.orig 2014-12-31 16:43:56.000000000 +0000
+++ build.xml 2015-06-22 09:20:12.859059775 +0100
@@ -81,6 +81,7 @@
<target name="compile" depends="clean, prepare">
<javac srcdir="src" destdir="${src.classes.dir}" source="1.5" target="1.5" debug="true" deprecation="true" nowarn="true">
<classpath refid="compile.classpath" />
@ -23,7 +8,7 @@ index b24eaf0..956cd72 100644
</javac>
</target>
@@ -207,18 +214,14 @@
@@ -207,18 +208,14 @@
<delete file="${target.dir}/${jar.core.osgified}" />
</target>
@ -45,7 +30,7 @@ index b24eaf0..956cd72 100644
</target>
<target name="sources" >
@@ -319,53 +322,10 @@
@@ -319,53 +316,10 @@
<h1><a href="org/mockito/Mockito.html">Click to see examples</a>. Mockito ${version} API.</h1>
]]>
</doctitle>

View File

@ -1,6 +1,6 @@
Name: mockito
Version: 1.10.19
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A Java mocking framework
License: MIT
@ -9,14 +9,14 @@ Source0: mockito-%{version}.tar.xz
Source1: make-mockito-sourcetarball.sh
Patch0: fixup-ant-script.patch
Patch1: fix-bnd-config.patch
Patch2: %{name}-matcher.patch
Patch2: mockito-matcher.patch
# Workaround for NPE in setting NamingPolicy in cglib
Patch3: setting-naming-policy.patch
# because we have old objenesis
Patch4: fix-incompatible-types.patch
BuildArch: noarch
BuildRequires: jpackage-utils
BuildRequires: javapackages-local
BuildRequires: java-devel
BuildRequires: ant
BuildRequires: objenesis
@ -25,7 +25,6 @@ BuildRequires: junit
BuildRequires: hamcrest
BuildRequires: aqute-bnd
Requires: jpackage-utils
Requires: objenesis
Requires: cglib
Requires: junit
@ -39,14 +38,13 @@ errors.
%package javadoc
Summary: Javadocs for %{name}
Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q
%patch0 -p1
%patch0
%patch1 -p1
# Set Bundle-Version properly
sed -i 's/Bundle-Version= ${version}/Bundle-Version= %{version}/' conf/mockito-core.bnd
@ -59,38 +57,33 @@ find . -name "*.java" -exec sed -i "s|org\.mockito\.cglib|net\.sf\.cglib|g" {} +
mkdir -p lib/compile
%build
build-jar-repository lib/compile objenesis
build-jar-repository lib/compile objenesis cglib junit hamcrest/core
ant jar javadoc
# Convert to OSGi bundle
pushd target
java -jar $(build-classpath aqute-bnd) wrap -output mockito-core-%{version}.bar -properties ../conf/mockito-core.bnd mockito-core-%{version}.jar
mv mockito-core-%{version}.bar mockito-core-%{version}.jar
popd
%install
mkdir -p $RPM_BUILD_ROOT%{_javadir}
sed -i -e "s|@version@|%{version}|g" maven/mockito-core.pom
cp -p target/mockito-core-%{version}.bar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
%mvn_artifact maven/mockito-core.pom target/mockito-core-%{version}.jar
%mvn_alias org.mockito:mockito-core org.mockito:mockito-all
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 maven/mockito-core.pom \
$RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -rp target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.mockito:mockito-all"
%install
%mvn_install -J target/javadoc
%files -f .mfiles
%{_javadir}/%{name}.jar
%doc NOTICE
%doc LICENSE
%files javadoc
%{_javadocdir}/%{name}
%files javadoc -f .mfiles-javadoc
%doc LICENSE
%doc NOTICE
%changelog
* Mon Jun 22 2015 Mat Booth <mat.booth@redhat.com> - 1.10.19-3
- Switch to mvn_install
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild