]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without javadoc # don't build javadoc | |
4 | ||
5 | %define subver b2 | |
6 | %define rel 1 | |
7 | Summary: Collection of tasks for Ant | |
8 | Name: ant-contrib | |
9 | Version: 1.0 | |
10 | Release: 0.%{subver}.%{rel} | |
11 | License: ASL 2.0 | |
12 | Group: Development/Libraries | |
13 | URL: http://ant-contrib.sourceforge.net/ | |
14 | Source0: http://downloads.sourceforge.net/ant-contrib/%{name}-%{version}%{subver}-src.tar.gz | |
15 | # Source0-md5: 66511dddcef3dc9798db33dbaca0d3de | |
16 | Patch0: build_xml.patch | |
17 | Patch1: antservertest.patch | |
18 | BuildRequires: ant >= 1.6 | |
19 | BuildRequires: ant-junit >= 1.6.2 | |
20 | BuildRequires: java-bcel >= 5.0 | |
21 | BuildRequires: java-junit >= 3.8.0 | |
22 | BuildRequires: java-xerces | |
23 | BuildRequires: jdk >= 1.4.2 | |
24 | BuildRequires: jpackage-utils >= 1.5 | |
25 | BuildRequires: rpmbuild(macros) >= 1.553 | |
26 | Requires: ant >= 1.6.2 | |
27 | Requires: java(jaxp_parser_impl) | |
28 | Requires: java-junit >= 3.8.0 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | The Ant-Contrib project is a collection of tasks (and at one point | |
34 | maybe types and other tools) for Apache Ant. | |
35 | ||
36 | %package javadoc | |
37 | Summary: Javadoc for Ant contrib tasks | |
38 | Group: Documentation | |
39 | ||
40 | %description javadoc | |
41 | API documentation for Ant contrib tasks. | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{name} | |
45 | %patch0 | |
46 | %patch1 | |
47 | %undos manual/tasks/foreach.html manual/tasks/for.html | |
48 | ||
49 | %{__rm} -r test/src/net/sf/antcontrib/antclipse | |
50 | ||
51 | install -d test/lib | |
52 | ||
53 | %build | |
54 | junit_jar=$(find-jar junit) | |
55 | xerces_jar=$(find-jar xercesImpl) | |
56 | ln -sf $junit_jar test/lib | |
57 | ln -sf $xerces_jar lib | |
58 | ||
59 | export OPT_JAR_LIST="ant/ant-junit junit" | |
60 | CLASSPATH=build/lib/ant-contrib-%{version}.jar:$CLASSPATH | |
61 | %ant jar %{?with_javadoc:docs} \ | |
62 | -Djavac.target=1.4 \ | |
63 | -Djavac.source=1.4 \ | |
64 | -Dversion=%{version} \ | |
65 | -Dbcel.jar=file://%{_javadir}/bcel.jar | |
66 | ||
67 | %install | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | # jars | |
71 | install -d $RPM_BUILD_ROOT%{_javadir}/ant | |
72 | cp -p build/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/ant/%{name}.jar | |
73 | ||
74 | # javadoc | |
75 | install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} | |
76 | cp -pr build/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} | |
77 | ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} | |
78 | rm -rf build/docs/api | |
79 | ||
80 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/ant.d | |
81 | echo "ant/ant-contrib" > $RPM_BUILD_ROOT%{_sysconfdir}/ant.d/ant-contrib | |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %post javadoc | |
87 | ln -nfs %{name}-%{version} %{_javadocdir}/%{name} | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc build/docs/LICENSE.txt | |
92 | %doc build/docs/tasks/* | |
93 | %{_sysconfdir}/ant.d/ant-contrib | |
94 | %{_javadir}/ant/*.jar | |
95 | ||
96 | %if %{with javadoc} | |
97 | %files javadoc | |
98 | %defattr(644,root,root,755) | |
99 | %doc %{_javadocdir}/%{name}-%{version} | |
100 | %doc %{_javadocdir}/%{name} | |
101 | %endif |