Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%global base_name   daemon
Stanislav Ochotnicky ca084f
%global short_name  commons-%{base_name}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Name:           apache-%{short_name}
Stanislav Ochotnicky ca084f
Version:        1.0.2
Stanislav Ochotnicky ca084f
Release:        3%{?dist}
Stanislav Ochotnicky ca084f
Summary:        Defines API to support an alternative invocation mechanism
Stanislav Ochotnicky ca084f
License:        ASL 2.0
Stanislav Ochotnicky ca084f
Group:          Applications/System
Stanislav Ochotnicky ca084f
URL:            http://commons.apache.org/%{base_name}
Stanislav Ochotnicky ca084f
Source0:        http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Stanislav Ochotnicky ca084f
Patch0:         %{name}-execve-path-warning.patch
Stanislav Ochotnicky ca084f
Patch1:         %{name}-ppc64-configure.patch
Stanislav Ochotnicky ca084f
Patch2:         %{name}-s390x-configure.patch
Stanislav Ochotnicky ca084f
BuildRequires:  java-devel >= 1:1.6.0
Stanislav Ochotnicky ca084f
BuildRequires:  jpackage-utils >= 0:1.7.2
Stanislav Ochotnicky ca084f
BuildRequires:  maven-plugin-bundle
Stanislav Ochotnicky ca084f
BuildRequires:  maven-surefire-maven-plugin
Stanislav Ochotnicky ca084f
BuildRequires:  maven-surefire-provider-junit
Stanislav Ochotnicky ca084f
BuildRequires:  maven-doxia-sitetools
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-assembly
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-antrun
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-compiler
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-idea
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-install
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-jar
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-javadoc
Stanislav Ochotnicky ca084f
BuildRequires:  maven2-plugin-resources
Stanislav Ochotnicky ca084f
BuildRequires:  xmlto
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Requires:       java >= 1:1.6.0
Stanislav Ochotnicky ca084f
Requires:       jpackage-utils >= 0:1.6
Stanislav Ochotnicky ca084f
Requires(post):    jpackage-utils
Stanislav Ochotnicky ca084f
Requires(postun):  jpackage-utils
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# This should go away with F-17
Stanislav Ochotnicky ca084f
Provides:       jakarta-%{short_name} = 1:%{version}-%{release}
Stanislav Ochotnicky ca084f
Obsoletes:      jakarta-%{short_name} <= 1:1.0.1
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%description
Stanislav Ochotnicky ca084f
The scope of this package is to define an API in line with the current
Stanislav Ochotnicky ca084f
Java Platform APIs to support an alternative invocation mechanism
Stanislav Ochotnicky ca084f
which could be used instead of the public static void main(String[])
Stanislav Ochotnicky ca084f
method.  This specification covers the behavior and life cycle of what
Stanislav Ochotnicky ca084f
we define as Java daemons, or, in other words, non interactive
Stanislav Ochotnicky ca084f
Java applications.
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%package        jsvc
Stanislav Ochotnicky ca084f
Summary:        Java daemon launcher
Stanislav Ochotnicky ca084f
Group:          Applications/System
Stanislav Ochotnicky ca084f
Provides:       jsvc = 1:%{version}-%{release}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Provides:       jakarta-%{short_name}-jsvc = 1:%{version}-%{release}
Stanislav Ochotnicky ca084f
Obsoletes:      jakarta-%{short_name}-jsvc <= 1:1.0.1
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%description    jsvc
Stanislav Ochotnicky ca084f
%{summary}.
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%package        javadoc
Stanislav Ochotnicky ca084f
Summary:        API documentation for %{name}
Stanislav Ochotnicky ca084f
Group:          Documentation
Stanislav Ochotnicky ca084f
Requires:       jpackage-utils
Stanislav Ochotnicky ca084f
BuildArch:      noarch
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Obsoletes:      jakarta-%{short_name}-javadoc <= 1:1.0.1
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%description    javadoc
Stanislav Ochotnicky ca084f
%{summary}.
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%prep
Stanislav Ochotnicky ca084f
%setup -q -n %{short_name}-%{version}-src
Stanislav Ochotnicky ca084f
%patch0 -p1 -b .execve
Stanislav Ochotnicky ca084f
%patch1 -p1 -b .ppc
Stanislav Ochotnicky ca084f
%patch2 -p1 -b .s390
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
chmod 644 src/samples/*
Stanislav Ochotnicky ca084f
cd src/native/unix
Stanislav Ochotnicky ca084f
xmlto man man/jsvc.1.xml
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%build
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# build native jsvc
Stanislav Ochotnicky ca084f
pushd src/native/unix
Stanislav Ochotnicky ca084f
%configure --with-java=%{java_home}
Stanislav Ochotnicky ca084f
# this is here because 1.0.2 archive contains old *.o
Stanislav Ochotnicky ca084f
make clean
Stanislav Ochotnicky ca084f
make %{?_smp_mflags}
Stanislav Ochotnicky ca084f
popd
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# build jars
Stanislav Ochotnicky ca084f
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
Stanislav Ochotnicky ca084f
mkdir -p $MAVEN_REPO_LOCAL
Stanislav Ochotnicky ca084f
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
Stanislav Ochotnicky ca084f
    install javadoc:javadoc
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%install
Stanislav Ochotnicky ca084f
rm -rf $RPM_BUILD_ROOT
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# install native jsvc
Stanislav Ochotnicky ca084f
install -Dpm 755 src/native/unix/jsvc $RPM_BUILD_ROOT%{_bindir}/jsvc
Stanislav Ochotnicky ca084f
install -Dpm 644 src/native/unix/jsvc.1 $RPM_BUILD_ROOT%{_mandir}/man1/jsvc.1
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# jars
Stanislav Ochotnicky ca084f
install -Dpm 644 target/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
pushd $RPM_BUILD_ROOT%{_javadir}
Stanislav Ochotnicky ca084f
for jar in *-%{version}*; do
Stanislav Ochotnicky ca084f
    ln -sf ${jar} `echo $jar| sed "s|apache-||g"`
Stanislav Ochotnicky ca084f
    ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
Stanislav Ochotnicky ca084f
    ln -sf ${jar} `echo $jar| sed "s|apache-\(.*\)-%{version}|\1|g"`
Stanislav Ochotnicky ca084f
done
Stanislav Ochotnicky ca084f
popd # come back from javadir
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# pom
Stanislav Ochotnicky ca084f
install -Dpm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{short_name}.pom
Stanislav Ochotnicky ca084f
%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# following line is only for backwards compatibility. New packages
Stanislav Ochotnicky ca084f
# should use proper groupid org.apache.commons and also artifactid
Stanislav Ochotnicky ca084f
%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
# javadoc
Stanislav Ochotnicky ca084f
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Stanislav Ochotnicky ca084f
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Stanislav Ochotnicky ca084f
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%clean
Stanislav Ochotnicky ca084f
rm -rf $RPM_BUILD_ROOT
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%post
Stanislav Ochotnicky ca084f
%update_maven_depmap
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%postun
Stanislav Ochotnicky ca084f
%update_maven_depmap
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%files
Stanislav Ochotnicky ca084f
%defattr(-,root,root,-)
Stanislav Ochotnicky ca084f
%doc LICENSE.txt PROPOSAL.html NOTICE.txt RELEASE-NOTES.txt src/samples
Stanislav Ochotnicky ca084f
%doc src/docs/*
Stanislav Ochotnicky ca084f
%{_javadir}/*
Stanislav Ochotnicky ca084f
%{_mavenpomdir}/JPP-%{short_name}.pom
Stanislav Ochotnicky ca084f
%{_mavendepmapfragdir}/*
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%files jsvc
Stanislav Ochotnicky ca084f
%defattr(-,root,root,-)
Stanislav Ochotnicky ca084f
%doc LICENSE.txt
Stanislav Ochotnicky ca084f
%{_bindir}/jsvc
Stanislav Ochotnicky ca084f
%{_mandir}/man1/jsvc.1*
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%files javadoc
Stanislav Ochotnicky ca084f
%defattr(-,root,root,-)
Stanislav Ochotnicky ca084f
%doc %{_javadocdir}/%{name}-%{version}
Stanislav Ochotnicky ca084f
%doc %{_javadocdir}/%{name}
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
%changelog
Stanislav Ochotnicky ca084f
* Fri Jun  4 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.2-3
Stanislav Ochotnicky ca084f
- Make javadoc subpackage noarch
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Tue Jun  1 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.2-2
Stanislav Ochotnicky ca084f
- Fix add_to_maven_depmap call
Stanislav Ochotnicky ca084f
- Added depmap for old groupId
Stanislav Ochotnicky ca084f
- Unified use of `install`
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Wed May 12 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.2-1
Stanislav Ochotnicky ca084f
- Rename and rebase to apache-commons-daemon
Stanislav Ochotnicky ca084f
- Get rid of gcj, native conditional compilation
Stanislav Ochotnicky ca084f
- Build with maven
Stanislav Ochotnicky ca084f
- Update patches to cleanly apply on new version, remove unneeded
Stanislav Ochotnicky ca084f
- Clean up whole spec
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0.1-8.8
Stanislav Ochotnicky ca084f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Tue Mar 03 2009 Karsten Hopp <karsten@redhat.com> 1.0.1-7.8
Stanislav Ochotnicky ca084f
- ppc needs a similar patch
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Tue Mar 03 2009 Karsten Hopp <karsten@redhat.com> 1.0.1-7.7
Stanislav Ochotnicky ca084f
- add configure patch for s390x
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.0.1-7.6
Stanislav Ochotnicky ca084f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1:1.0.1-6.6
Stanislav Ochotnicky ca084f
- drop repotag
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Fri Feb 08 2008 Permaine Cheung <pcheung@redhat.com> - 1:1.0.1-6jpp.5
Stanislav Ochotnicky ca084f
- Add configure patch for ia64 from Doug Chapman
Stanislav Ochotnicky ca084f
Stanislav Ochotnicky ca084f
* Mon Sep 24 2007 Permaine Cheung <pcheung@redhat.com> - 1:1.0.1-6jpp.4
Stanislav Ochotnicky ca084f
- Add execve path warning patch from James Ralston