# empty debuginfo
%global debug_package %nil
Name: jetty-setuid
Version: 1.0.3
Release: 1%{?dist}
Summary: Jetty :: SetUID
License: ASL 2.0 and EPL
URL: http://www.eclipse.org/jetty/
Source0: http://git.eclipse.org/c/jetty/org.eclipse.jetty.toolchain.git/snapshot/org.eclipse.jetty.toolchain-jetty-setuid-%{version}.tar.gz
# cd ~/rpmbuild/BUILD/org.eclipse.jetty.toolchain-jetty-setuid-1.0.3/jetty-setuid/jetty-setuid-java/target/
# javah -classpath jetty-setuid-java-1.0.3.jar -jni -o org_eclipse_jetty_setuid_SetUID.h org.eclipse.jetty.setuid.SetUID
Source1: org_eclipse_jetty_setuid_SetUID.h
BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.codehaus.mojo:native-maven-plugin)
BuildRequires: mvn(org.eclipse.jetty:jetty-server)
BuildRequires: mvn(org.eclipse.jetty:jetty-util)
BuildRequires: mvn(org.eclipse.jetty.toolchain:jetty-toolchain:pom:)
# jetty-test-helper deps
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.hamcrest:hamcrest-library)
Requires: %{name}-java = %{version}-%{release}
%description
Running Jetty as non-root user on port 80 in "safe" mode
This package provides Jetty :: SetUID Linux Native.
%package java
Summary: Jetty :: SetUID Java
%description java
Jetty :: SetUID Java.
%package parent
Summary: Jetty :: SetUID Parent
BuildArch: noarch
%description parent
Jetty :: SetUID Parent POM.
%package javadoc
Summary: Javadoc for %{name}
BuildArch: noarch
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n org.eclipse.jetty.toolchain-jetty-setuid-%{version}
# Copy license stuff
cp -p jetty-distribution-remote-resources/src/main/resources/* .
# Fix parent pom conflict problems
rm -r jetty-toolchain pom.xml
pushd %{name}
# Enable jetty-test-helper
%pom_xpath_inject pom:project/pom:modules "../jetty-test-helper"
# Fix jetty-test-helper version
%pom_xpath_set pom:properties/pom:jetty-test-helper-version 2.10-SNAPSHOT
# Use pre-existent package
%pom_xpath_remove -r pom:relativePath
%pom_disable_module libsetuid-osx
install -pm 644 %SOURCE1 jetty-setuid-native/src/main/resources/
# Unwanted tasks
%pom_remove_plugin -r :maven-assembly-plugin
%pom_remove_plugin :maven-javadoc-plugin ../jetty-test-helper
%pom_remove_plugin :maven-pmd-plugin ../jetty-test-helper
%pom_remove_plugin :maven-site-plugin ../jetty-test-helper
%pom_remove_plugin :maven-source-plugin ../jetty-test-helper
# Used for build JNI library
%mvn_package :%{name}-native __noinstall
# Empty artifact
%mvn_package :%{name}-test __noinstall
# NON supported extension
%mvn_package :libsetuid-linux __noinstall
# Used only for run test suites
%mvn_package :jetty-test-helper __noinstall
# Fix JAR location and add a symlink in %%{_libdir}/%%{name}
%mvn_file :%{name}-java:jar: %{name}-java %{_libdir}/%{name}/%{name}-java
%build
pushd %{name}
%mvn_build -s -- -Penv-linux
%install
pushd %{name}
%mvn_install
mkdir -p %{buildroot}%{_libdir}/%{name}
install -pm 755 libsetuid-linux/target/libsetuid-linux.so %{buildroot}%{_libdir}/%{name}
%files
%{_libdir}/%{name}
%files java -f %{name}/.mfiles-%{name}-java
%doc jetty-setuid/README.TXT
%license license-eplv10-aslv20.html notice.html
%files parent -f %{name}/.mfiles-%{name}-parent
%license license-eplv10-aslv20.html notice.html
%files javadoc -f %{name}/.mfiles-javadoc
%license license-eplv10-aslv20.html notice.html
%changelog
* Tue Apr 05 2016 gil cattaneo 1.0.3-1
- initial rpm