]>
Commit | Line | Data |
---|---|---|
55c630e0 | 1 | # TODO: |
31de4089 | 2 | # - some tests fail, but it seems to be an error in tests, not in log4j |
55c630e0 | 3 | # |
953f3539 | 4 | # NOTE: |
5 | # - javamail is provided by java-gnu-mail | |
a05864ec | 6 | # - jmx,jndi by java-sun-jre |
3f42ed13 JB |
7 | # |
8 | # Conditional build: | |
8240ab67 | 9 | %bcond_without dist # build components which can't be distributed |
149946d4 JB |
10 | %bcond_with jms # JMS interface (org.apache.log4j.or.jms) |
11 | %bcond_with jmx # JMX interface (org.apache.log4j.jmx) | |
31de4089 | 12 | %bcond_with tests # tun tests |
149946d4 JB |
13 | # |
14 | %if %{without dist} | |
15 | %define with_jms 1 | |
16 | %define with_jmx 1 | |
8240ab67 | 17 | %endif |
04fb6d50 SP |
18 | %if "%{pld_release}" == "ti" |
19 | %bcond_without java_sun # build with gcj | |
20 | %else | |
21 | %bcond_with java_sun # build with java-sun | |
22 | %endif | |
3f42ed13 | 23 | # |
265a63b6 SP |
24 | %define srcname log4j |
25 | # | |
6996f2e6 | 26 | %include /usr/lib/rpm/macros.java |
a9eea00b | 27 | Summary: log4j - logging for Java |
f9f52620 | 28 | Summary(pl.UTF-8): log4j - zapis logów dla Javy |
265a63b6 | 29 | Name: java-%{srcname} |
8b195f22 | 30 | Version: 1.2.15 |
817c2b97 | 31 | Release: 6 |
81bec039 | 32 | License: Apache v2.0 |
265a63b6 SP |
33 | Group: Development/Languages/Java |
34 | Source0: http://www.apache.org/dist/logging/log4j/%{version}/apache-%{srcname}-%{version}.tar.gz | |
8b195f22 | 35 | # Source0-md5: 10f04abe4d68d5a89e8eb167e4e45e1a |
3bffd5e3 | 36 | URL: http://logging.apache.org/log4j/ |
8240ab67 | 37 | Patch0: apache-log4j-javadoc.patch |
265a63b6 | 38 | Patch1: logging-%{srcname}-sourcetarget.patch |
31de4089 | 39 | BuildRequires: ant >= 1.7.1-4 |
40 | %{?with_tests:BuildRequires: ant-junit} | |
04fb6d50 SP |
41 | %{!?with_java_sun:BuildRequires: java-gcj-compat-devel} |
42 | %{?with_java_sun:BuildRequires: java-sun} | |
122ede73 | 43 | BuildRequires: javamail >= 1.2 |
3f42ed13 | 44 | BuildRequires: jaxp_parser_impl |
3f42ed13 | 45 | %{?with_jms:BuildRequires: jms >= 1.1} |
3f42ed13 | 46 | %{?with_jmx:BuildRequires: jmx-tools >= 1.2.1} |
8240ab67 | 47 | %{?with_jmx:BuildRequires: jmx >= 1.2.1} |
3f42ed13 | 48 | %{?with_jmx:BuildRequires: jndi} |
606bae28 | 49 | BuildRequires: jpackage-utils |
31de4089 | 50 | %{?with_tests:BuildRequires: junit >= 3.8} |
5f58d9a5 | 51 | BuildRequires: rpmbuild(macros) >= 1.300 |
31de4089 | 52 | Suggests: java-mail >= 1.2 |
3f42ed13 JB |
53 | %{?with_jms:Suggests: jms >= 1.1} |
54 | %{?with_jmx:Suggests: jmx-tools >= 1.2.1} | |
606bae28 | 55 | Provides: log4j = %{version} |
1832db1e | 56 | Obsoletes: jakarta-log4j |
c9bdb1e4 | 57 | Obsoletes: log4j |
fe28ab7c | 58 | BuildArch: noarch |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
fe28ab7c | 61 | %description |
423e347d JB |
62 | With log4j it is possible to enable logging at runtime without |
63 | modifying the application binary. | |
64 | ||
4c93720a JR |
65 | %description -l pl.UTF-8 |
66 | Przy użyciu log4j można włączyć zapis do logów przy uruchamianiu bez | |
423e347d | 67 | modyfikowania binarnej aplikacji. |
fe28ab7c | 68 | |
69 | %package doc | |
a9eea00b | 70 | Summary: Online manual for log4j |
f9f52620 | 71 | Summary(pl.UTF-8): Dokumentacja online do log4j |
6996f2e6 | 72 | Group: Documentation |
1832db1e | 73 | Obsoletes: jakarta-log4j-doc |
fe28ab7c | 74 | |
75 | %description doc | |
423e347d JB |
76 | Online manual for log4j. |
77 | ||
4c93720a | 78 | %description doc -l pl.UTF-8 |
423e347d | 79 | Dokumentacja online do log4j. |
fe28ab7c | 80 | |
606bae28 JK |
81 | %package javadoc |
82 | Summary: API documentation for log4j | |
f9f52620 | 83 | Summary(pl.UTF-8): Dokumentacja API log4j |
6996f2e6 | 84 | Group: Documentation |
122ede73 | 85 | Requires: jpackage-utils |
1832db1e | 86 | Obsoletes: jakarta-log4j-doc |
606bae28 JK |
87 | |
88 | %description javadoc | |
89 | API documentation for log4j. | |
90 | ||
4c93720a | 91 | %description javadoc -l pl.UTF-8 |
606bae28 JK |
92 | Dokumentacja API log4j. |
93 | ||
fe28ab7c | 94 | %prep |
8b195f22 | 95 | %setup -q -n apache-log4j-%{version} |
8240ab67 | 96 | %patch0 -p1 |
31de4089 | 97 | %patch1 -p1 |
fe28ab7c | 98 | |
99 | %build | |
31de4089 | 100 | required_jars="mail activation %{?with_jms:jms} %{?with_jmx:jmx jmxtools}" |
8240ab67 | 101 | CLASSPATH=$(build-classpath $required_jars); export CLASSPATH |
b83cac24 | 102 | %ant jar javadoc |
31de4089 | 103 | |
104 | %if %{with tests} | |
105 | cd tests | |
106 | CLASSPATH=$(build-classpath junit) | |
107 | export CLASSPATH | |
b83cac24 | 108 | %ant build runAll |
31de4089 | 109 | %endif |
fe28ab7c | 110 | |
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
265a63b6 SP |
113 | install -d $RPM_BUILD_ROOT{%{_javadir},%{_javadocdir}/%{srcname}-%{version}} |
114 | cp -a dist/lib/%{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-%{version}.jar | |
115 | ln -s %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}.jar | |
6996f2e6 | 116 | |
265a63b6 SP |
117 | cp -a docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version} |
118 | ln -s %{srcname}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{srcname} # ghost symlink | |
fe28ab7c | 119 | |
fe28ab7c | 120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
a05864ec | 123 | %post javadoc |
265a63b6 | 124 | ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname} |
a05864ec | 125 | |
fe28ab7c | 126 | %files |
127 | %defattr(644,root,root,755) | |
3f42ed13 JB |
128 | %doc LICENSE NOTICE |
129 | %{_javadir}/log4j-%{version}.jar | |
130 | %{_javadir}/log4j.jar | |
fe28ab7c | 131 | |
132 | %files doc | |
a9eea00b | 133 | %defattr(644,root,root,755) |
8240ab67 | 134 | %doc site/{css,images,xref,xref-test,*.html} |
606bae28 JK |
135 | |
136 | %files javadoc | |
137 | %defattr(644,root,root,755) | |
265a63b6 SP |
138 | %{_javadocdir}/%{srcname}-%{version} |
139 | %ghost %{_javadocdir}/%{srcname} |