- up to 1.0.2
[packages/java-commons-daemon.git] / java-commons-daemon.spec
1 # Conditional build:
2 %bcond_without  javadoc         # don't build javadoc
3 %include        /usr/lib/rpm/macros.java
4
5 %define         srcname commons-daemon
6 Summary:        Commons Daemon - controlling of Java daemons
7 Summary(pl.UTF-8):      Commons Daemon - kontrolowanie demonów w Javie
8 Name:           java-commons-daemon
9 Version:        1.0.2
10 Release:        1
11 License:        Apache v2.0
12 Group:          Libraries/Java
13 Source0:        http://www.apache.net.pl/commons/daemon/source/commons-daemon-%{version}-src.tar.gz
14 # Source0-md5:  a6c68eed204bc9f1ef3b77488edfcfeb
15 Patch0:         jakarta-commons-daemon-link.patch
16 URL:            http://commons.apache.org/daemon/
17 BuildRequires:  ant >= 1.4.1
18 BuildRequires:  automake
19 BuildRequires:  java-junit >= 3.7
20 BuildRequires:  jdk
21 BuildRequires:  jpackage-utils
22 BuildRequires:  rpm-javaprov
23 BuildRequires:  rpmbuild(macros) >= 1.300
24 BuildRequires:  xmlto >= 0:0.0.18-1
25 Requires:       java-commons-collections >= 2.0
26 Requires:       java-commons-logging >= 1.0
27 Requires:       jpackage-utils
28 Obsoletes:      jakarta-commons-daemon
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 The Daemon Component contains a set of Java and native code, including
33 a set of Java interfaces applications must implement and Unix native
34 code to control a Java daemon from a Unix operating system.
35
36 %description -l pl.UTF-8
37 Komponent Daemon zawiera zbiór kodu w Javie i natywnego, zawierającego
38 zbiór interfejsów w Javie, które muszą być zaimplementowane w
39 aplikacjach oraz natywny kod uniksowy kontrolujący demony w Javie w
40 systemie Unix.
41
42 %package javadoc
43 Summary:        Commons Daemon documentation
44 Summary(pl.UTF-8):      Dokumentacja do Commons Daemon
45 Group:          Documentation
46 Requires:       jpackage-utils
47 Obsoletes:      jakarta-commons-daemon-doc
48 Obsoletes:      jakarta-commons-daemon-javadoc
49
50 %description javadoc
51 Commons Daemon documentation.
52
53 %description javadoc -l pl.UTF-8
54 Dokumentacja do Commons Daemon.
55
56 %prep
57 %setup -qc
58 mv daemon-%{version}/* .
59 %patch0 -p1
60
61 %build
62 # Java part
63 required_jars="junit"
64 CLASSPATH=$(build-classpath $required_jars)
65 export CLASSPATH
66 %ant jar %{?with_javadoc:javadoc}
67
68 # native part
69 cd src/native/unix
70 cp -f /usr/share/automake/config.sub support
71 %configure \
72         --with-java=%{java_home}
73 %{__make}
74 refentry2man < man/jsvc.1.xml > man/jsvc.1
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 install -d $RPM_BUILD_ROOT%{_javadir}
79
80 # jars
81 cp -a dist/%{srcname}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-%{version}.jar
82 ln -s %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}.jar
83
84 # javadoc
85 %if %{with javadoc}
86 install -d $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
87 cp -a dist/docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
88 ln -s %{srcname}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{srcname} # ghost symlink
89 %endif
90
91 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
92 install src/native/unix/jsvc $RPM_BUILD_ROOT%{_bindir}
93 cp -a src/native/unix/man/jsvc.1 $RPM_BUILD_ROOT%{_mandir}/man1
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %post javadoc
99 ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname}
100
101 %files
102 %defattr(644,root,root,755)
103 %doc PROPOSAL.html RELEASE-NOTES.txt STATUS.html
104 %attr(755,root,root) %{_bindir}/jsvc
105 %{_mandir}/man1/jsvc.1*
106 %{_javadir}/*.jar
107
108 %if %{with javadoc}
109 %files javadoc
110 %defattr(644,root,root,755)
111 %{_javadocdir}/%{srcname}-%{version}
112 %ghost %{_javadocdir}/%{srcname}
113 %endif
This page took 0.066756 seconds and 3 git commands to generate.