diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16ed381 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/prelockd-0.7.tar.gz diff --git a/prelockd.spec b/prelockd.spec new file mode 100644 index 0000000..2028b21 --- /dev/null +++ b/prelockd.spec @@ -0,0 +1,72 @@ +Name: prelockd +Version: 0.7 +Release: 2%{?dist} +Summary: Lock binaries and libraries in memory to improve system responsiveness +BuildArch: noarch + +License: MIT +URL: https://github.com/hakavlad/prelockd +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: systemd-rpm-macros + +Requires: python3 >= 3.3 + +%description +prelockd is a daemon that locks memory mapped binaries and libraries in memory +to improve system responsiveness under low-memory conditions. + + +%prep +%autosetup -p1 + +# Drop non-RPM stuff from Makefile install stage +sed -i 's|base units useradd chcon daemon-reload|base units|' Makefile + +sed -i 's|/env python3|/python3|' %{name} + + +%install +%make_install \ + DOCDIR=%{_pkgdocdir} \ + PREFIX=%{_prefix} \ + SYSCONFDIR=%{_sysconfdir} \ + SYSTEMDUNITDIR=%{_unitdir} + +%pre +# Create prelockd user +getent passwd %{name} >/dev/null || \ + useradd -r -s /sbin/nologin \ + -c "Lock binaries and libraries in memory to improve system responsiveness" %{name} +exit 0 + + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + + +%files +%license LICENSE +%{_pkgdocdir}/ +%{_sbindir}/%{name} +%{_sharedstatedir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}.conf +%{_unitdir}/%{name}.service + + +%changelog +* Tue Oct 6 18:59:34 EEST 2020 Artem Polishchuk - 0.7-2 +- build: drop %{?systemd_requires} macros +- build: drop custom patch in favour of sed + +* Tue Oct 6 17:07:06 EEST 2020 Artem Polishchuk - 0.7-1 +- build(update): 0.7 + +* Sun Oct 4 12:15:45 EEST 2020 Artem Polishchuk - 0.6-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..2656470 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (prelockd-0.7.tar.gz) = e39f30aa0a0b465f62f72c485bc003b362900831341e538909ff2cc4c848106f723abdfb195ad7cfd7a735e368a8834a811a357d7a429c513e1cb96ae4408b92