java-hamcrest/java-hamcrest.spec

231 lines
8.0 KiB
RPMSpec

Name: java-hamcrest
Version: 1.1
Release: 4mamba
Summary: Hamcrest - library of matchers for building test expressions
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://code.google.com/p/hamcrest/
Source0: http://hamcrest.googlecode.com/files/hamcrest-%{version}.tgz
Source1: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-parent/%{version}/hamcrest-parent-%{version}.pom
Source2: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-library/%{version}/hamcrest-library-%{version}.pom
Source3: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-integration/%{version}/hamcrest-integration-%{version}.pom
Source4: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-generator/%{version}/hamcrest-generator-%{version}.pom
Source5: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/%{version}/hamcrest-core-%{version}.pom
Source6: http://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/%{version}/hamcrest-all-%{version}.pom
Source7: hamcrest-text-1.1.pom
Source8: hamcrest-core-1.1-MANIFEST.MF
Patch0: java-hamcrest-1.1-build.patch
License: BSD
BuildRequires: java-qdox16
BuildRequires: java-jmock1
BuildRequires: java-easymock2
# with tests
# testng 4.6 eclipse plugin
%if "%{stage1}" != "1"
BuildRequires: java-junit45
%endif
BuildRequires: java-jarjar1
BuildRequires: java-testng
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
BuildRequires: java-junit3
BuildRequires: jpackage-utils
Requires: jpackage-utils
Requires: java-easymock2
Requires: java-jmock1
Requires: java-qdox16
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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 demo
Group: Documentation
Summary: Samples for %{name}
Requires: %{name} = %{version}-%{release}
%description demo
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..
This package contains samples for %{name}.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
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.
This package contains javadoc for %{name}.
%prep
%setup -q -n hamcrest-%{version}
for j in $(find . -name "*.jar"); do
mv $j ${j}.no
done
pushd lib
pushd generator
ln -sf $(build-classpath jarjar1) jarjar.jar
ln -sf $(build-classpath qdox16) qdox.jar
popd
# with integration
pushd integration
ln -sf $(build-classpath easymock2) easymock-2.2.jar
ln -sf $(build-classpath jmock1) jmock-1.10RC1.jar
ln -sf $(build-classpath junit-3.8.2) junit-3.8.1.jar
ln -sf $(build-classpath junit45) junit-4.0.jar
ln -sf $(build-classpath testng-jdk15) testng-4.6-jdk15.jar
popd
popd
%patch0 -p1
perl -pi -e 's/\r$//g' LICENSE.txt README.txt
%build
%if "%{stage1}" != "1"
export CLASSPATH=$(build-classpath jarjar1 qdox16 ant/ant-junit):$PWD/build/hamcrest-core-%{version}.jar
%else
rm -f lib/integration/junit-4.0.jar
mv lib/integration/junit-4.0.jar.no lib/integration/junit-4.0.jar
export CLASSPATH=$(build-classpath qdox16 ant/ant-junit):$PWD/build/hamcrest-core-%{version}.jar
%endif
ant \
-Dant.build.javac.source=1.5 \
-Dversion=%{version} \
-Dbuild.sysclasspath=first \
clean package javadoc
mkdir -p META-INF
cp -p %{SOURCE8} META-INF/MANIFEST.MF
touch META-INF/MANIFEST.MF
zip -u build/hamcrest-core-%{version}.jar META-INF/MANIFEST.MF
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}/hamcrest
mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-parent.pom
%add_to_maven_depmap org.hamcrest hamcrest-parent %{version} JPP/hamcrest parent
install -m 644 build/hamcrest-all-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/all-%{version}.jar
install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-all.pom
%add_to_maven_depmap org.hamcrest hamcrest-all %{version} JPP/hamcrest all
install -m 644 build/hamcrest-core-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/core-%{version}.jar
install -m 644 %{SOURCE5} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-core.pom
%add_to_maven_depmap org.hamcrest hamcrest-core %{version} JPP/hamcrest core
install -m 644 build/hamcrest-generator-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/generator-%{version}.jar
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-generator.pom
%add_to_maven_depmap org.hamcrest hamcrest-generator %{version} JPP/hamcrest generator
install -m 644 build/hamcrest-library-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/library-%{version}.jar
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-library.pom
%add_to_maven_depmap org.hamcrest hamcrest-library %{version} JPP/hamcrest library
install -m 644 build/hamcrest-text-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/text-%{version}.jar
install -m 644 %{SOURCE7} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-text.pom
%add_to_maven_depmap org.hamcrest hamcrest-text %{version} JPP/hamcrest text
# with integration
install -m 644 build/hamcrest-integration-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/integration-%{version}.jar
install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/maven2/poms/JPP.hamcrest-integration.pom
%add_to_maven_depmap org.hamcrest hamcrest-integration %{version} JPP/hamcrest integration
# with tests
install -m 644 build/hamcrest-unit-test-%{version}.jar \
%{buildroot}%{_javadir}/hamcrest/unit-test-%{version}.jar
(
cd %{buildroot}%{_javadir}/hamcrest
for jar in *-%{version}.jar; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done
)
mkdir -p %{buildroot}%{_javadocdir}/hamcrest-%{version}
cp -pr build/javadoc/* %{buildroot}%{_javadocdir}/hamcrest-%{version}
ln -s hamcrest-%{version} %{buildroot}%{_javadocdir}/hamcrest
mkdir -p %{buildroot}%{_datadir}/hamcrest-%{version}
# with integration
install -m 644 build/hamcrest-examples-%{version}.jar \
%{buildroot}%{_datadir}/hamcrest-%{version}
cp -pr hamcrest-examples %{buildroot}%{_datadir}/hamcrest-%{version}/
ln -s hamcrest-%{version} %{buildroot}%{_datadir}/hamcrest
#%{_bindir}/aot-compile-rpm
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%dir %{_javadir}/hamcrest
%{_javadir}/hamcrest/all-%{version}.jar
%{_javadir}/hamcrest/all.jar
%{_javadir}/hamcrest/core-%{version}.jar
%{_javadir}/hamcrest/core.jar
%{_javadir}/hamcrest/generator-%{version}.jar
%{_javadir}/hamcrest/generator.jar
%{_javadir}/hamcrest/integration-%{version}.jar
%{_javadir}/hamcrest/integration.jar
%{_javadir}/hamcrest/library-%{version}.jar
%{_javadir}/hamcrest/library.jar
%{_javadir}/hamcrest/text-%{version}.jar
%{_javadir}/hamcrest/text.jar
%{_javadir}/hamcrest/unit-test-%{version}.jar
%{_javadir}/hamcrest/unit-test.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt README.txt
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/hamcrest-%{version}
%{_javadocdir}/hamcrest
%files demo
%defattr(-,root,root)
%{_datadir}/hamcrest-%{version}
%{_datadir}/hamcrest
%changelog
* Thu Nov 25 2010 gil <puntogil@libero.it> 1.1-4mamba
- rebuilt devel
* Thu Mar 18 2010 gil <puntogil@libero.it> 1.1-3mamba
- added: maven poms; hamcrest core OSGi MANIFEST
* Thu Jul 23 2009 gil <puntogil@libero.it> 1.1-2mamba
- added java-testng support
* Fri Mar 06 2009 gil <puntogil@libero.it> 1.1-1mamba
- package created by autospec