commit 397db4e06591fd8b273e83e5bdac518c69d05c00 Author: James Antill Date: Mon Feb 27 15:01:53 2023 -0500 Import rpm: c8s diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbb4d7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/portreserve-0.0.5.tar.bz2 +/portreserve-0.0.5.tar.bz2 diff --git a/portreserve-pid-file.patch b/portreserve-pid-file.patch new file mode 100644 index 0000000..c865712 --- /dev/null +++ b/portreserve-pid-file.patch @@ -0,0 +1,13 @@ +diff -up portreserve-0.0.5/src/portreserve.c.pid-file portreserve-0.0.5/src/portreserve.c +--- portreserve-0.0.5/src/portreserve.c.pid-file 2011-06-23 16:50:21.000000000 +0100 ++++ portreserve-0.0.5/src/portreserve.c 2013-11-27 09:48:01.073647566 +0000 +@@ -314,6 +314,9 @@ portreserve (void) + + free (cfgfile); + ++ /* Give init a chance to spot our PID file (bug #901988). */ ++ sleep (1); ++ + return 0; + } + diff --git a/portreserve.service b/portreserve.service new file mode 100644 index 0000000..284c9b8 --- /dev/null +++ b/portreserve.service @@ -0,0 +1,15 @@ +[Unit] +Description=Port reservation utility +After=sockets.target +Before=basic.target shutdown.target +Conflicts=shutdown.target +DefaultDependencies=no + +[Service] +Type=forking +PIDFile=/var/run/portreserve.pid +ExecStart=/sbin/portreserve +Restart=no + +[Install] +WantedBy=multi-user.target diff --git a/portreserve.spec b/portreserve.spec new file mode 100644 index 0000000..f908b1e --- /dev/null +++ b/portreserve.spec @@ -0,0 +1,204 @@ +%define _hardened_build 1 + +Summary: TCP port reservation utility +Name: portreserve +Version: 0.0.5 +Release: 19%{?dist} +License: GPLv2+ +Group: System Environment/Daemons +URL: http://cyberelk.net/tim/portreserve/ +Source0: http://cyberelk.net/tim/data/portreserve/stable/%{name}-%{version}.tar.bz2 +Source1: portreserve.service +Patch1: portreserve-pid-file.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + +# This is actually needed for the %triggerun script but Requires(triggerun) +# is not valid. We can use %post because this particular %triggerun script +# should fire just after this package is installed. +Requires(post): systemd-sysv + +BuildRequires: xmlto +BuildRequires: systemd-units +Obsoletes: portreserve-selinux < 0.0.3-3 + +%description +The portreserve program aims to help services with well-known ports that +lie in the portmap range. It prevents portmap from a real service's port +by occupying it itself, until the real service tells it to release the +port (generally in the init script). + +%prep +%setup -q + +# Avoid a race during start-up if there are no configured ports (bug #1034139). +%patch1 -p1 -b .pid-file + +%build +%configure --sbindir=/sbin +make + +%install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} install +mkdir -p %{buildroot}%{_localstatedir}/run/portreserve +mkdir -p %{buildroot}%{_unitdir} +install -m644 %{SOURCE1} %{buildroot}%{_unitdir}/portreserve.service +mkdir -p %{buildroot}%{_sysconfdir}/portreserve +mkdir -p %{buildroot}%{_tmpfilesdir} +cat < %{buildroot}%{_tmpfilesdir}/portreserve.conf +d %{_localstatedir}/run/portreserve 0755 root root 10d +EOF + +%clean +rm -rf %{buildroot} + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%triggerun -- portreserve < 0.0.5-3 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply portreserve +# to migrate them to systemd targets +%{_bindir}/systemd-sysv-convert --save portreserve >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del portreserve >/dev/null 2>&1 || : +/bin/systemctl try-restart portreserve.service >/dev/null 2>&1 || : + +%files +%defattr(-,root,root) +%doc ChangeLog README COPYING NEWS +%dir %{_localstatedir}/run/portreserve +%dir %{_sysconfdir}/portreserve +%config %{_tmpfilesdir}/portreserve.conf +%{_unitdir}/portreserve.service +/sbin/* +%{_mandir}/*/* + +%changelog +* Fri Feb 09 2018 Igor Gnatenko - 0.0.5-19 +- Escape macros in %%changelog + +* Fri Feb 09 2018 Fedora Release Engineering - 0.0.5-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 0.0.5-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.0.5-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.0.5-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jun 30 2016 Tim Waugh - 0.0.5-14 +- Enable hardened build. + +* Thu Feb 04 2016 Fedora Release Engineering - 0.0.5-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 0.0.5-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 0.0.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.0.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Nov 26 2013 Tim Waugh - 0.0.5-9 +- Avoid a race during start-up if there are no configured ports (bug #901988). +- Moved tmpfiles configuration file to correct location. +- Don't use %%ghost in manifest for state directory, in order to make + sure it is ready to use after installation. + +* Sun Aug 04 2013 Fedora Release Engineering - 0.0.5-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 0.0.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Aug 21 2012 Tim Waugh 0.0.5-6 +- Use macroized systemd scriptlets (bug #850275). + +* Sat Jul 21 2012 Fedora Release Engineering - 0.0.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 0.0.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Jul 12 2011 Tim Waugh 0.0.5-3 +- Converted initscript to systemd service file (bug #617331). + +* Fri Jul 1 2011 Tim Waugh 0.0.5-2 +- Requires chkconfig (bug #718173). + +* Fri Jun 24 2011 Tim Waugh 0.0.5-1 +- 0.0.5 (bug #619089, bug #704567). + +* Wed Feb 09 2011 Fedora Release Engineering - 0.0.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 2 2010 Tim Waugh 0.0.4-7 +- /var/run changes for systemd (bug #656670). + +* Thu Nov 18 2010 Tim Waugh 0.0.4-6 +- Fixed initscript exit code for "status" action (bug #619089). + +* Thu Mar 4 2010 Tim Waugh 0.0.4-5 +- Added comments to all patches. + +* Fri Jan 22 2010 Tim Waugh 0.0.4-4 +- Walk the list of newmaps correctly (bug #557781). + +* Sun Jul 26 2009 Fedora Release Engineering - 0.0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Feb 27 2009 Tim Waugh 0.0.4-1 +- 0.0.4: + - Fixed initscript so that it will not be reordered to start after + rpcbind (bug #487250). + +* Thu Feb 26 2009 Fedora Release Engineering - 0.0.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 4 2009 Tim Waugh 0.0.3-3 +- No longer need SELinux policy as it is now part of the + selinux-policy package. + +* Wed Oct 15 2008 Tim Waugh 0.0.3-2 +- New selinux sub-package for SELinux policy. Policy contributed by + Miroslav Grepl (thanks!). + +* Tue Jul 1 2008 Tim Waugh 0.0.3-1 +- 0.0.3: + - Allow multiple services to be defined in a single configuration + file. + - Allow protocol specifications, e.g. ipp/udp. + +* Mon Jun 30 2008 Tim Waugh 0.0.2-1 +- 0.0.2. + +* Fri May 9 2008 Tim Waugh 0.0.1-2 +- More consistent use of macros. +- Build requires xmlto. +- Don't use %%makeinstall. +- No need to run make check. + +* Thu May 8 2008 Tim Waugh 0.0.1-1 +- Default permissions for directories. +- Initscript should not be marked config. +- Fixed license tag. +- Better buildroot tag. + +* Wed Sep 3 2003 Tim Waugh +- Initial spec file. diff --git a/sources b/sources new file mode 100644 index 0000000..5e6f4dc --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (portreserve-0.0.5.tar.bz2) = e5e4b5da1c79897357e87ebe44051e74a629f50a87901a9393d58fdd3cd5880d59af03d87f1cd238662a744963d48a96d75bae5586e48e71387e0f51a9b886be