File easymock.spec of Package easymock
#
# spec file for package easymock
#
# Copyright (c) 2013 Peter Conrad
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: easymock
Version: 3.1
Release: 1
License: Apache-2.0
Summary: Mock object generator
Url: http://easymock.org/
Group: Development/Libraries/Java
Source: http://downloads.sourceforge.net/project/easymock/EasyMock/%{version}/%{name}-%{version}.zip
# PATCH-FIX-OPENSUSE: conrad@quisquis.de
Patch: easymock-java7.patch
Requires: cglib objenesis
BuildRequires: java-devel >= 1.6.0 unzip cglib objenesis dos2unix
%if 0%{?suse_version} > 1300 || 0%{?fedora} > 20
BuildRequires: javapackages-tools
%endif
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
EasyMock provides Mock Objects for interfaces (and objects through the class
extension) by generating them on the fly using Java's proxy mechanism. Due to
EasyMock's unique style of recording expectations, most refactorings will not
affect the Mock Objects. So EasyMock is a perfect fit for Test-Driven
Development.
%package javadoc
Summary: API documentation of easymock
Group: Development/Libraries/Java
%description javadoc
This package contains the API documentation of the easymock library.
%prep
%setup -q
dos2unix LICENSE.txt easymock.css
%__mkdir_p src
cd src
jar xf "../%{name}-%{version}-sources.jar"
%patch -p1
%build
FILES="`find src -name \*.java`"
CP="`build-classpath cglib objenesis`"
%__mkdir_p build/classes
javac -d build/classes -cp "$CP" -source 1.5 -target 1.5 -g $FILES
jar cf "build/%{name}-%{version}.jar" -C build/classes .
%__mkdir_p build/doc
javadoc -d build/doc -sourcepath src -classpath "$CP:build/classes" $FILES
%install
%__install -dm 755 "%{buildroot}%{_javadir}"
%__install -m 0644 "build/%{name}-%{version}.jar" "%{buildroot}%{_javadir}/"
%__ln_s "%{name}-%{version}.jar" "%{buildroot}%{_javadir}/%{name}.jar"
%__install -dm 755 "%{buildroot}/%{_javadocdir}/%{name}-%{version}"
cp -pr build/doc "%{buildroot}/%{_javadocdir}/%{name}-%{version}/"
%files
%defattr(-,root,root,-)
%doc LICENSE.txt Documentation.html easymock.css
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%files javadoc
%defattr(-,root,root,-)
%doc Documentation_fr.html
%{_javadocdir}/%{name}-%{version}/
%changelog