diff --git a/README.md b/README.md index b4b1ded..c8f486f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ # apache-commons-daemon +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. + +Daemon is made of 2 parts. One written in C that makes the interface to the +operating system and the other in Java that provides the Daemon API + diff --git a/apache-commons-daemon-1.0.4-add_OSGi_Manifest.patch b/apache-commons-daemon-1.0.4-add_OSGi_Manifest.patch new file mode 100644 index 0000000..91d6ca7 --- /dev/null +++ b/apache-commons-daemon-1.0.4-add_OSGi_Manifest.patch @@ -0,0 +1,32 @@ +--- build.xml 2010-10-19 20:05:34.000000000 +0200 ++++ build.xml-gil 2010-12-12 06:29:33.000000000 +0100 +@@ -292,22 +292,17 @@ + tofile="${build.home}/classes/META-INF/LICENSE.txt"/> + +- +- +- +- +- +- +- +- +- +- +- +- ++ + + + + ++ ++ + + + diff --git a/apache-commons-daemon-1.0.4-execve-path-warning.patch b/apache-commons-daemon-1.0.4-execve-path-warning.patch new file mode 100644 index 0000000..da24189 --- /dev/null +++ b/apache-commons-daemon-1.0.4-execve-path-warning.patch @@ -0,0 +1,18 @@ +--- src/native/unix/native/jsvc-unix.c 2010-10-16 15:09:11.000000000 +0200 ++++ src/native/unix/native/jsvc-unix.c-gil 2010-12-12 05:55:08.000000000 +0100 +@@ -966,6 +966,15 @@ + char *tmp = NULL; + char *p1 = NULL; + char *p2 = NULL; ++ ++ /* We don't want to use a form of exec() that searches the ++ PATH, so require that argv[0] be either an absolute or ++ relative path. Error out if this isn't the case. */ ++ tmp=strchr(oldpath,'/'); ++ if (tmp==NULL) { ++ log_error("JSVC re-exec requires execution with an absolute or relative path"); ++ return(1); ++ } + + /* + * There is no need to change LD_LIBRARY_PATH diff --git a/apache-commons-daemon.spec b/apache-commons-daemon.spec new file mode 100644 index 0000000..0a36614 --- /dev/null +++ b/apache-commons-daemon.spec @@ -0,0 +1,253 @@ +%define maven 0 +%if %maven + %define target_dir target + %define api_dir %target_dir/site/apidocs +%else + %define target_dir dist + %define api_dir %target_dir/docs/api +%endif +Name: apache-commons-daemon +Version: 1.0.15 +Release: 1mamba +Summary: Apache Commons Daemon Package +Group: Development/Libraries/Java +Vendor: openmamba +Distribution: openmamba +Packager: gil +URL: http://commons.apache.org/daemon/ +Source0: http://www.apache.org/dist/commons/daemon/source/commons-daemon-%{version}-src.tar.gz +Source1: maven2-2.2.0-settings.xml +Source2: commons-daemon-1.0.5-autogeneratedfiles.tar.gz +Patch0: apache-commons-daemon-1.0.4-execve-path-warning.patch +Patch1: apache-commons-daemon-1.0.4-add_OSGi_Manifest.patch +#Patch0: jakarta-commons-daemon-1.0.1-crosslink.patch +#Patch3: jakarta-commons-daemon-1.0.1-ia64-configure.patch +License: Apache Software License 2.0 +BuildRequires: apache-ant +%if %maven +BuildRequires: apache-maven2 +BuildRequires: apache-maven2-ant-plugin +BuildRequires: apache-maven2-antrun-plugin +BuildRequires: apache-maven2-assembly-plugin +BuildRequires: apache-maven2-compiler-plugin +BuildRequires: apache-maven2-idea-plugin +BuildRequires: apache-maven2-install-plugin +BuildRequires: apache-maven2-jar-plugin +BuildRequires: apache-maven2-javadoc-plugin +BuildRequires: apache-maven2-resources-plugin +#BuildRequires: felix maven-bundle-plugin +#BuildRequires: maven-surefire-plugin +%endif +BuildRequires: docbook-utils +BuildRequires: java-junit3 +BuildRequires: jpackage-utils +BuildRequires: make +BuildRequires: java-openjdk +BuildRequires: java-openjdk-javadoc +BuildRequires: xmlto +Requires: jpackage-utils +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +## AUTOBUILDREQ-END +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%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 +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. + +Daemon is made of 2 parts. One written in C that makes the interface to the +operating system and the other in Java that provides the Daemon API + +%package jsvc +Group: System/Tools +Summary: Java daemon launcher + +%description jsvc +Jakarta Commons Daemon Package + +This package contains %{name} Java daemon launcher + +%package javadoc +Group: Documentation +Summary: Javadoc for %{name} + +%description javadoc +Jakarta Commons Daemon Package + +This package contains javadoc for %{name} + +%package source +Group: Development/Languages +Summary: %{name} source + +%description source +Jakarta Commons Daemon Package + +This package contains %{name} source. + +%prep + +%setup -q -n commons-daemon-%{version}-src +%patch0 -p0 + +for j in $(find . -name "*.jar"); do + rm -rf $j +done + +for c in $(find . -name "*.class"); do + rm -rf $c +done + +%if %maven + + cp %{SOURCE1} settings.xml + mkdir -p .m2/repository/JPP/maven2 + sed -i -e "s|__INTERNAL_REPO_PLACEHOLDER__|file://`pwd`/external_repo|g" settings.xml + sed -i -e "s|__EXTERNAL_REPOPLACEHOLDER__|file://`pwd`/.m2/repository|g" settings.xml + +%else + tar -xf %{SOURCE2} + +%patch1 -p0 + +%endif + +rm -rf src/samples/build/ +chmod 644 src/samples/* + +pushd src/native/unix/man + xmlto man jsvc.1.xml +popd + +%build + +export JAVA_HOME=/usr/lib/jvm/java +export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository + +%if %maven + mkdir external_repo + ln -s %{_javadir} external_repo/JPP + + mvn-jpp \ + -e \ + -s $(pwd)/settings.xml \ + -Dmaven.test.failure.ignore=true \ + -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ + ant:ant org.apache.felix:maven-bundle-plugin:ant install javadoc:javadoc +%else + +export CLASSPATH=$(build-classpath junit-3.8.2) +ant \ + -Dant.lib=%{_datadir}/ant/lib \ + -Dant.home=%{_datadir}/ant \ + -Dj2se.javadoc=%{_javadocdir}/java \ + -Djunit.home=%{_javadir} \ + -Djunit.jar=$(build-classpath junit-3.8.2) \ + dist test + +%endif + +cd src/native/unix + +%configure \ + --with-java=$JAVA_HOME +make clean +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +mkdir -p %{buildroot}%{_javadir} +mkdir -p %{buildroot}%{_datadir}/maven2/poms + +install -m 644 %target_dir/commons-daemon-%{version}.jar \ + %{buildroot}%{_javadir}/apache-commons-daemon-%{version}.jar + +install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-apache-commons-daemon.pom +%add_to_maven_depmap org.apache.commons commons-daemon %{version} JPP apache-commons-daemon +%add_to_maven_depmap commons-daemon commons-daemon %{version} JPP apache-commons-daemon + +#( +# cd %{buildroot}%{_javadir} +# for jar in *-%{version}.jar; do +# ln -sf ${jar} `echo $jar| sed "s|apache-||g"` +# done +#) + +( + cd %{buildroot}%{_javadir} + for jar in *-%{version}.jar; do + ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` + done +) + +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_mandir}/man1 + +install -pm 755 src/native/unix/jsvc %{buildroot}%{_bindir}/jsvc +install -pm 644 src/native/unix/man/jsvc.1 %{buildroot}%{_mandir}/man1/ + +mkdir -p %{buildroot}%{_javadocdir}/apache-commons-daemon-%{version} +cp -pr %api_dir/* %{buildroot}%{_javadocdir}/apache-commons-daemon-%{version} +ln -s apache-commons-daemon-%{version} %{buildroot}%{_javadocdir}/apache-commons-daemon + +mkdir -p %{buildroot}%{_sourcedir}/apache-commons-daemon-%{version} +cp -pr %target_dir/bin/commons-daemon-%{version}-native-src.* %{buildroot}%{_sourcedir}/apache-commons-daemon-%{version}/ + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +%update_maven_depmap + +%postun +%update_maven_depmap + +%files +%defattr(-,root,root) +%{_javadir}/apache-commons-daemon-%{version}.jar +%{_javadir}/apache-commons-daemon.jar +#%{_javadir}/commons-daemon-%{version}.jar +#%{_javadir}/commons-daemon.jar +%{_datadir}/maven2/poms +%{_mavendepmapfragdir} +%doc README *.html *.txt +%doc src/docs/* src/samples + +%files javadoc +%defattr(-,root,root) +%{_javadocdir}/apache-commons-daemon-%{version} +%{_javadocdir}/apache-commons-daemon + +%files jsvc +%defattr(-,root,root) +%{_bindir}/jsvc +%{_mandir}/man1/jsvc.1.gz +%doc LICENSE.txt + +%files source +%defattr(-,root,root) +%{_sourcedir}/apache-commons-daemon-%{version}/ + +%changelog +* Wed Mar 26 2014 Silvan Calarco 1.0.15-1mamba +- update to 1.0.15 + +* Sun Feb 27 2011 gil 1.0.5-1mamba +- update to 1.0.5 + +* Sun Dec 12 2010 gil 1.0.4-1mamba +- update to 1.0.4 + +* Thu Oct 01 2009 gil 1.0.1-3mamba +- added jsvc manual + +* Thu Jun 11 2009 gil 1.0.1-2mamba +- added sources package + +* Thu Feb 26 2009 gil 1.0.1-1mamba +- package created by autospec \ No newline at end of file diff --git a/maven2-2.2.0-settings.xml b/maven2-2.2.0-settings.xml new file mode 100644 index 0000000..0d6ad48 --- /dev/null +++ b/maven2-2.2.0-settings.xml @@ -0,0 +1,245 @@ + + + + + + __INTERNAL_REPO_PLACEHOLDER__ + + + + + + + + + + + + + + + + + + + + + + + + mirrorId + repositoryId + Human Readable Name for this Mirror. + __EXTERNAL_REPO_PLACEHOLDER__ + + + + + + + + + + + + +