File jakarta-commons-daemon.spec of Package jakarta-commons-daemon

#
# spec file for package jakarta-commons-daemon (Version 1.0.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild
# icecream 0

Name:           jakarta-commons-daemon
BuildRequires:  ant java2-devel-packages xml-commons-apis
%define native      %{?_with_native:1}%{!?_with_native:0}
%define base_name   daemon
%define short_name  commons-%{base_name}
%define name        jakarta-%{short_name}
%define section     free
Version:        1.0.1
Release:        19
Summary:        Jakarta Commons Daemon Package
License:        Apache
Group:          Development/Libraries/Java
URL:            http://jakarta.apache.org/commons/daemon/
Source0:        http://www.apache.org/dist/jakarta/commons/daemon/source/daemon-1.0.1.tar.gz
Patch:          %{name}-crosslink.patch
Patch1:         %{name}-java14compat.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{native}
%else
BuildArch:      noarch
%endif
Provides:       %{short_name}
Obsoletes:      %{short_name}

%description
The scope of this package is to define an API in line with the current
Java(tm) Platform APIs to support an alternative invocation mechanism
that could be used instead of the public static void main(String[])
method.  This specification covers the behavior and life cycle of what
is defined as Java(tm) daemons or, in other words, noninteractive
Java(tm) applications.



%package        jsvc
Summary:        Java daemon launcher
Group:          Development/Libraries/Java
Provides:       jsvc = %{version}-%{release}

%description    jsvc
The scope of this package is to define an API in line with the current
Java(tm) Platform APIs to support an alternative invocation mechanism
which could be used instead of the above mentioned public static void
main(String[]) method.	This specification cover the behavior and life
cycle of what we define as Java(tm) daemons, or, in other words, non
interactive Java(tm) applications.

This package contains the Java daemon launcher.



%{summary}.
%package        javadoc
PreReq:         coreutils
Summary:        Javadoc for jakarta-commons-daemon
Group:          Development/Libraries/Java

%description    javadoc
The scope of this package is to define an API in line with the current
Java(tm) Platform APIs to support an alternative invocation mechanism
which could be used instead of the above mentioned public static void
main(String[]) method.	This specification cover the behavior and life
cycle of what we define as Java(tm) daemons, or, in other words, non
interactive Java(tm) applications.

This package contains the javadoc documentation for
jakarta-commons-daemon.



%prep
%setup -q -n %{base_name}-%{version}
%patch0 -p0
%patch1
chmod 644 src/samples/*

%build
%if %{native}
cd src/native/unix
%configure --with-java=%{java_home}
make %{?_smp_mflags}
%else
ant -Dant.lib=%{_javadir} -Dj2se.javadoc=%{_javadocdir}/java dist
%endif

%install
%if %{native}
install -Dpm 755 src/native/unix/jsvc $RPM_BUILD_ROOT%{_sbindir}/jsvc
%else
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -pm 644 dist/%{short_name}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|jakarta-||g"`; done)
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%if %{native}

%files jsvc
%defattr(-,root,root,-)
%doc LICENSE*
%{_sbindir}/jsvc
%else

%files
%defattr(-,root,root,-)
%doc LICENSE* PROPOSAL.html RELEASE-NOTES.txt STATUS.html src/samples
%doc src/docs/*
%{_javadir}/*

%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}
%endif

%changelog -n jakarta-commons-daemon
* Mon Sep 25 2006 - skh@suse.de
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 16 2006 - jsmeix@suse.de
- Current version 1.0.1 from JPackage.org
* Wed Jul 27 2005 - jsmeix@suse.de
- Adjustments in the spec file.
* Wed Jul 20 2005 - jsmeix@suse.de
- Current version 1.0 from JPackage.org
* Mon Jul 18 2005 - jsmeix@suse.de
- Current version 1.0 from JPackage.org
* Thu Sep 16 2004 - skh@suse.de
- Fix prerequires of javadoc subpackage
* Thu Sep 02 2004 - skh@suse.de
- Initial package created with version 1.0 (JPackage 1.5)
openSUSE Build Service is sponsored by