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

#
# spec file for package jakarta-commons-daemon (Version 1.0.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# 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:        266
Summary:        Jakarta Commons Daemon Package
License:        Apache Software License ..
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
License:        Apache Software License ..
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
License:        Apache Software License ..
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}
%patch -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
openSUSE Build Service is sponsored by