Skip to content

Instantly share code, notes, and snippets.

@wathika-eng
Created May 6, 2026 04:39
Show Gist options
  • Select an option

  • Save wathika-eng/10b53c940ef6f856c0355377d5a76405 to your computer and use it in GitHub Desktop.

Select an option

Save wathika-eng/10b53c940ef6f856c0355377d5a76405 to your computer and use it in GitHub Desktop.
nohang rpm package
Name: nohang
Version: 0.3.0
Release: 1%{?dist}
Summary: A sophisticated low memory handler (OOM killer) for Linux
License: MIT
URL: https://github.com/hakavlad/nohang
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: make
BuildRequires: python3-devel
Requires: python3
Requires: systemd
%description
nohang is a highly configurable daemon for Linux that prevents
system out-of-memory (OOM) conditions.
%prep
%setup -q -n nohang
%build
# No compilation needed, but we could run 'make update-manpages'
# if pandoc was installed.
%install
# We use the Makefile's own 'install' target.
# We pass Fedora's standard paths into the Makefile's variables.
make install \
DESTDIR=%{buildroot} \
PREFIX=%{_prefix} \
SYSCONFDIR=%{_sysconfdir} \
SYSTEMDUNITDIR=%{_unitdir} \
MANDIR=%{_mandir}
%files
%license LICENSE
%doc README.md CHANGELOG.md
%dir %{_sysconfdir}/nohang
%config(noreplace) %{_sysconfdir}/nohang/nohang.conf
%config(noreplace) %{_sysconfdir}/nohang/nohang-desktop.conf
%{_bindir}/nohang
%{_bindir}/oom-sort
%{_bindir}/psi2log
%{_bindir}/psi-top
%{_unitdir}/nohang.service
%{_unitdir}/nohang-desktop.service
%{_sysconfdir}/logrotate.d/nohang
%{_mandir}/man1/oom-sort.1.gz
%{_mandir}/man1/psi-top.1.gz
%{_mandir}/man1/psi2log.1.gz
%{_mandir}/man8/nohang.8.gz
%{_datadir}/nohang/
# The Makefile also installs docs to a custom path, but RPM %doc handles it better.
# We exclude the Makefile's extra doc dir to avoid double-listing.
%exclude %{_datadir}/doc/nohang
%changelog
* Wed Apr 29 2026 wathi - 0.3.0-1
- Integrated Makefile variables for clean installation
@wathika-eng

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment