%define short_name commons-daemon Name: apache-%{short_name} Version: 1.3.4 Release: 1%{?dist} Summary: Commons Daemon - Controlling of Java Daemons License: Apache-2.0 Group: System/Daemons URL: https://commons.apache.org/daemon/ Source0: https://archive.apache.org/dist/commons/daemon/source/%{short_name}-%{version}-src.tar.gz Source1: https://archive.apache.org/dist/commons/daemon/source/%{short_name}-%{version}-src.tar.gz.asc Source2: apache-commons-daemon.keyring Source10: build.xml #Patch: apache-commons-daemon-JAVA_OS.patch BuildRequires: ant BuildRequires: maven-local BuildRequires: autoconf BuildRequires: gcc BuildRequires: java-17-openjdk-devel BuildRequires: javapackages-local BuildRequires: libcap-devel BuildRequires: make BuildRequires: xmlto Provides: jakarta-%{short_name} = %{version} Provides: jakarta-%{short_name}-java = %{version} %description The Daemon Component contains a set of Java and native code, including a set of Java interfaces applications must implement and Unix native code to control a Java daemon from a Unix operating system. %package jsvc Summary: Java daemon launcher Group: System/Daemons Provides: jsvc = %{version}-%{release} Provides: jakarta-%{short_name}:%{_sbindir}/jsvc %description jsvc Jsvc is a set of libraries and applications for making Java applications run on UNIX more easily. It allows the application (e.g. Tomcat) to perform some privileged operations as root (e.g. bind to a port < 1024), and then switch identity to a non-privileged user. %package javadoc Summary: Commons Daemon Javadoc Group: Documentation/Other Provides: jakarta-%{short_name}-javadoc = %{version} BuildArch: noarch %description javadoc The Javadoc Documentation for Commons Daemon. %prep %autosetup -n %{short_name}-%{version}-src -p1 cp %{SOURCE10} build.xml # remove java binaries from sources rm -rf src/samples/build/ # remove files for different OS rm -rf src/samples/*.cmd # mark example files as non-executable chmod -R 0644 src/samples/* %pom_remove_parent . # build manpage for jsvc pushd src/native/unix xmlto man man/jsvc.1.xml popd %mvn_file groupId:artifactId %{name} %build # build native jsvc pushd src/native/unix sh support/buildconf.sh %configure --with-java=%{_exec_prefix}/lib/jvm/jre-17 %if 0%{?fedora} >= 40 %define _distro_extra_cflags -Wno-error=incompatible-pointer-types %endif %make_build popd # build jar %{ant} %mvn_artifact pom.xml target/%{short_name}-%{version}.jar %install # native jsvc echo "Native" install -Dpm 0755 src/native/unix/jsvc %{buildroot}%{_bindir}/jsvc install -Dpm 0644 src/native/unix/jsvc.1 %{buildroot}%{_mandir}/man1/jsvc.1 %mvn_install -J target/site/apidocs %files -f .mfiles %license LICENSE.txt NOTICE.txt %doc PROPOSAL.html RELEASE-NOTES.txt src/samples %doc src/docs/* %files jsvc %license LICENSE.txt NOTICE.txt %{_bindir}/jsvc %{_mandir}/man1/jsvc.1.gz %files javadoc -f .mfiles-javadoc %license LICENSE.txt NOTICE.txt %changelog * Sat Apr 06 2024 Jonathan Wright - 1.3.4-1 - Initial package build