File mockito.spec of Package mockito (Revision 3e81aa18908f9f6bc10e9c62e1f35732)
Currently displaying revision 3e81aa18908f9f6bc10e9c62e1f35732 , Show latest
xxxxxxxxxx
1
#
2
# spec file for package mockito
3
#
4
# Copyright (c) 2022 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
Name: mockito
20
Version: 1.10.19
21
Release: 0
22
Summary: A Java mocking framework
23
License: MIT
24
Group: Development/Libraries/Java
25
URL: http://%{name}.org
26
Source0: %{name}-%{version}.tar.xz
27
Patch0: fixup-ant-script.patch
28
Patch1: fix-bnd-config.patch
29
Patch2: %{name}-matcher.patch
30
# Workaround for NPE in setting NamingPolicy in cglib
31
Patch3: setting-naming-policy.patch
32
# because we have old objenesis
33
Patch4: fix-incompatible-types.patch
34
Patch5: remove-hardcoded-source-target.patch
35
BuildRequires: ant
36
BuildRequires: aqute-bnd
37
BuildRequires: cglib
38
BuildRequires: dos2unix
39
BuildRequires: fdupes
40
BuildRequires: hamcrest
41
BuildRequires: java-devel >= 1.8
42
BuildRequires: javapackages-local
43
BuildRequires: junit
44
BuildRequires: objenesis
45
BuildRequires: unzip
46
Requires: cglib
47
Requires: hamcrest
48
Requires: junit
49
Requires: objenesis
50
BuildArch: noarch
51
52
%description
53
Mockito is a mocking framework. It lets you write tests. Tests
54
produce clean verification errors.
55
56
%package javadoc
57
Summary: Javadocs for %{name}
58
Group: Documentation/HTML
59
60
%description javadoc
61
This package contains the API documentation for %{name}.
62
63
%prep
64
%setup -q
65
dos2unix `find -name *.java`
66
%patch0
67
%patch1
68
%patch2 -p1
69
%patch3 -p1
70
%patch4 -p1
71
%patch5 -p1
72
73
%pom_add_dep net.sf.cglib:cglib:3.1 maven/mockito-core.pom
74
find . -name "*.java" -exec sed -i "s|org\.%{name}\.cglib|net\.sf\.cglib|g" {} +
75
mkdir -p lib/compile lib/build lib/run lib/repackaged
76
77
%pom_xpath_remove 'target[@name="javadoc"]/copy' build.xml
78
79
%build
80
build-jar-repository lib/compile objenesis cglib junit hamcrest/core
81
ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 jar javadoc prepare.poms
82
83
# Convert to OSGi bundle
84
bnd wrap \
85
--version %{version} \
86
--output target/%{name}-core-%{version}.bar \
87
--properties conf/%{name}-core.bnd \
88
target/%{name}-core-%{version}.jar
89
mv target/%{name}-core-%{version}.bar target/%{name}-core-%{version}.jar
90
91
%{mvn_artifact} target/%{name}-core.pom target/%{name}-core-%{version}.jar
92
%{mvn_alias} org.%{name}:%{name}-core org.%{name}:%{name}-all
93
94
%install
95
# jar
96
install -dm 0755 %{buildroot}%{_javadir}/%{name}
97
install -pm 0644 target/%{name}-core-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-core.jar
98
# pom
99
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
100
install -pm 0644 target/%{name}-core.pom %{buildroot}%{_mavenpomdir}/%{name}/%{name}-core.pom
101
%add_maven_depmap %{name}/%{name}-core.pom %{name}/%{name}-core.jar -a org.%{name}:%{name}-all
102
# javadoc
103
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
104
cp -pr target/javadoc/* %{buildroot}%{_javadocdir}/%{name}/
105
%fdupes -s %{buildroot}%{_javadocdir}
106
107
%files -f .mfiles
108
%license LICENSE NOTICE
109
110
%files javadoc
111
%{_javadocdir}/%{name}
112
%license LICENSE NOTICE
113
114
%changelog
115