Make mockito an OSGi bundle using upstream bnd config.
This commit is contained in:
parent
f5831b6878
commit
4213781c4d
27
fix-bnd-config.patch
Normal file
27
fix-bnd-config.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
--- conf/mockito-core.bnd.orig 2012-08-31 17:38:35.605728658 +0200
|
||||||
|
+++ conf/mockito-core.bnd 2012-08-31 17:39:06.490980938 +0200
|
||||||
|
@@ -1,8 +1,3 @@
|
||||||
|
--classpath= lib/run/com.springsource.org.junit-4.5.0.jar, \
|
||||||
|
- lib/run/com.springsource.org.hamcrest.core-1.1.0.jar, \
|
||||||
|
- lib/run/com.springsource.org.objenesis-1.0.0.jar
|
||||||
|
--versionpolicy=[${version;==;${@}},${version;+;${@}})
|
||||||
|
-
|
||||||
|
Bundle-Name= Mockito Mock Library for Java. Core bundle requires Hamcrest-core and Objenesis.
|
||||||
|
Bundle-SymbolicName= org.mockito.mockito-core
|
||||||
|
Bundle-Version= 1.9.0
|
||||||
|
@@ -10,7 +5,7 @@
|
||||||
|
Export-Package= !org.mockito.asm.*, \
|
||||||
|
!org.mockito.cglib.*, \
|
||||||
|
!org.mockito.internal.*, \
|
||||||
|
- org.mockito.*;version=${version}
|
||||||
|
+ org.mockito.*
|
||||||
|
|
||||||
|
Import-Package= junit.*;resolution:=optional, \
|
||||||
|
org.junit.*;resolution:=optional, \
|
||||||
|
@@ -21,4 +16,4 @@
|
||||||
|
|
||||||
|
Private-Package: org.mockito.*
|
||||||
|
|
||||||
|
--removeheaders: Private-Package
|
||||||
|
\ No newline at end of file
|
||||||
|
+-removeheaders: Private-Package
|
@ -4,10 +4,16 @@ VERSION=1.9.0
|
|||||||
SRCDIR=mockito-${VERSION}
|
SRCDIR=mockito-${VERSION}
|
||||||
|
|
||||||
hg clone https://code.google.com/p/mockito/ ${SRCDIR}
|
hg clone https://code.google.com/p/mockito/ ${SRCDIR}
|
||||||
cd $SRCDIR
|
pushd $SRCDIR
|
||||||
hg update ${VERSION}
|
hg archive --prefix ${SRCDIR} -t tar -r ${VERSION} ../${SRCDIR}.tar
|
||||||
rm -rf `find -name *.jar` build.gradle cglib-and-asm conf doc gradle gradlew gradlew.bat
|
popd
|
||||||
|
|
||||||
|
rm -rf ${SRCDIR}
|
||||||
|
|
||||||
|
tar -xf ${SRCDIR}.tar
|
||||||
|
pushd ${SRCDIR}
|
||||||
|
rm -rf `find -name *.jar` build.gradle cglib-and-asm doc gradle gradlew gradlew.bat
|
||||||
dos2unix `find -name *.java`
|
dos2unix `find -name *.java`
|
||||||
cd ..
|
popd
|
||||||
|
|
||||||
tar -cvJf mockito-${VERSION}.tar.xz ${SRCDIR}
|
tar -cvJf mockito-${VERSION}.tar.xz ${SRCDIR}
|
||||||
|
15
mockito.spec
15
mockito.spec
@ -1,6 +1,6 @@
|
|||||||
Name: mockito
|
Name: mockito
|
||||||
Version: 1.9.0
|
Version: 1.9.0
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
Summary: A Java mocking framework
|
Summary: A Java mocking framework
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -10,6 +10,7 @@ Source1: make-mockito-sourcetarball.sh
|
|||||||
Patch0: fixup-ant-script.patch
|
Patch0: fixup-ant-script.patch
|
||||||
Patch1: fix-cglib-refs.patch
|
Patch1: fix-cglib-refs.patch
|
||||||
Patch2: maven-cglib-dependency.patch
|
Patch2: maven-cglib-dependency.patch
|
||||||
|
Patch3: fix-bnd-config.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: jpackage-utils
|
BuildRequires: jpackage-utils
|
||||||
@ -46,14 +47,21 @@ This package contains the API documentation for %{name}.
|
|||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
# Set Bundle-Version properly
|
||||||
|
sed -i 's/Bundle-Version= ${version}/Bundle-Version= %{version}/' conf/mockito-core.bnd
|
||||||
|
%patch3
|
||||||
|
|
||||||
%build
|
%build
|
||||||
ant jar javadoc
|
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
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_javadir}
|
mkdir -p $RPM_BUILD_ROOT%{_javadir}
|
||||||
sed -i -e "s|@version@|%{version}|g" maven/mockito-core.pom
|
sed -i -e "s|@version@|%{version}|g" maven/mockito-core.pom
|
||||||
cp -p target/mockito-core-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
|
cp -p target/mockito-core-%{version}.bar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
|
||||||
|
|
||||||
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
|
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
|
||||||
install -pm 644 maven/mockito-core.pom \
|
install -pm 644 maven/mockito-core.pom \
|
||||||
@ -77,6 +85,9 @@ cp -rp target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
|
|||||||
%doc NOTICE
|
%doc NOTICE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 27 2012 Severin Gehwolf <sgehwolf@redhat.com> 1.9.0-8
|
||||||
|
- Add aqute bnd instructions for OSGi metadata
|
||||||
|
|
||||||
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-7
|
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-7
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user