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