Blob Blame History Raw
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 <ego.cordatus@gmail.com> - 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 <ego.cordatus@gmail.com> - 0.7-1
- build(update): 0.7

* Sun Oct  4 12:15:45 EEST 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.6-1
- Initial package