%global debug_package %{nil} %global pound_user pound %global pound_group pound %global pound_home %{_localstatedir}/lib/pound %global required_systemd systemd-rpm-macros %if 0%{?rhel} %global required_systemd systemd-devel %endif Name: Pound3 Version: 3.0 Release: 1%{?dist} Epoch: 3 Summary: Reverse proxy and load balancer License: GPLv3 with exceptions URL: https://www.apsis.ch/pound.html BuildRequires: cmake # BuildRequires: gcc BuildRequires: libyaml-devel BuildRequires: nanomsg-devel BuildRequires: mbedtls-devel BuildRequires: openssl-devel, pcre-devel # We actually need the openssl binary, not just the libs and headers BuildRequires: openssl BuildRequires: systemd-units BuildRequires: autoconf, automake BuildRequires: %{required_systemd} # tcmalloc exists only on selected arches %ifarch %{ix86} aarch64 %{power64} BuildRequires: gperftools-devel %endif Requires(pre): %{_sbindir}/useradd Requires(pre): %{_sbindir}/groupadd Source0: https://www.apsis.ch/pound/Pound-3.0d.tgz Source1: pound3.service Source2: pound.yaml %description The Pound program is a reverse proxy, load balancer and HTTPS front-end for Web server(s). Pound was developed to enable distributing the load among several Web-servers and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively. Pound is distributed under the GPL - no warranty, it's free to use, copy and give away %prep %setup -q -n Pound-3.0d %build cd ./build %cmake .. \ -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \ -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" %cmake_build %install install -d %{buildroot}%{pound_home} install -p -D -m 755 %{_builddir}/Pound-3.0d/build/pound %{buildroot}%{_sbindir}/pound3 install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/pound3.service # mkdir %{buildroot}%{_sysconfdir}/pound install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pound/pound.yaml install -p -D -m 644 %{_builddir}/Pound-3.0d/man/pound.8 %{buildroot}%{_mandir}/man8/pound3.8 %check %ctest %pre %{_sbindir}/groupadd -f -r %{pound_group} id %{pound_user} >/dev/null 2>&1 || \ %{_sbindir}/useradd -r -g %{pound_group} -d %{pound_home} -s /sbin/nologin \ -c "User for the Pound reverse proxy and load balancer" %{pound_user} %post %systemd_post pound.service # generate dummy certificate exec > /dev/null 2> /dev/null if [ ! -f %{_sysconfdir}/pki/tls/certs/pound.pem ] ; then pushd %{_sysconfdir}/pki/tls/certs umask 077 cat << EOF | openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out pound.pem -- SomeState SomeCity Pound Example Certificate SomeOrganizationalUnit localhost.localdomain root@localhost.localdomain EOF cat key.pem >> pound.pem chown root:pound pound.pem chmod 640 pound.pem popd fi exit 0 %preun %systemd_preun pound.service %postun %systemd_postun_with_restart pound.service %files %doc README.md %license GPL.txt %{_mandir}/man8/pound3.8.gz %{_sbindir}/pound3 %{_unitdir}/pound3.service %config(noreplace) %{_sysconfdir}/pound # %ghost %config(noreplace) %{_sysconfdirdd}/pki/tls/certs/pound.pem %attr(-,%{pound_user},%{pound_group}) %dir %{pound_home} %changelog * Tue Sep 08 2020 Breno Brand Fernandes - 1:3.0-3 - Renamed the package name * Tue Sep 08 2020 Breno Brand Fernandes - 1:3.0-2 - Experimental build of Pound 3.0d * Thu Apr 23 2020 Breno Brand Fernandes - 1:3.0-1 - Experimental build of Pound 3.0c