Accepting request 761530 from home:embar-:branches:Base:System

further cleanup

OBS-URL: https://build.opensuse.org/request/show/761530
OBS-URL: https://build.opensuse.org/package/show/Base:System/earlyoom?expand=0&rev=3
This commit is contained in:
OBS User embar-
2020-01-07 11:06:59 +00:00
committed by Git OBS Bridge
parent 03fe6a0587
commit 7ee727b5fb
2 changed files with 6 additions and 97 deletions

View File

@@ -15,17 +15,11 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1230
%bcond_without systemd
%else
%bcond_with systemd
%endif
%global rpm_version %(rpm -q --qf %%{version} rpm)
%if ! 0%{?_fillupdir:1}
%global _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
# Common info
Name: earlyoom
Version: 1.3
Release: 0%{?extraver:0.}1%{?dist}
@@ -35,18 +29,13 @@ Group: System/Daemons
URL: https://github.com/rfjakob/earlyoom
Source0: %{name}-%{version}.tar.bz2
Source11: earlyoom.sysconfig
Source12: earlyoom.init
# Build-time parameters
# pandoc only for `pandoc MANPAGE.md -s -t man > earlyoom.1`, thus could be excluded if earlyoom.1 would be provided.
BuildRequires: pandoc
Requires(post): insserv-compat
# Install-time parameters
Conflicts: oomd
%if %{lua:print(rpm.vercmp(rpm.expand('%{rpm_version}'), '4.13'))} >= 0
Recommends: libnotify%{?suse_version:-tools}
%endif
%if %{with systemd}
BuildRequires: pkgconfig
BuildRequires: pkgconfig(systemd)
%endif
Requires(post): insserv-compat
Recommends: libnotify%{?suse_version:-tools}
Conflicts: oomd
%description
earlyoom checks the amount of available memory and free swap, and if both are
@@ -73,31 +62,20 @@ make %{?_smp_mflags} \
# Install built stuff
%install
make install DESTDIR=%{buildroot} \
%if %{with systemd}
SYSTEMDUNITDIR=%{_unitdir} \
%endif
PREFIX=%{_prefix}
PREFIX=%{_prefix}
install -D -m644 %{SOURCE11} %{buildroot}%{_fillupdir}/sysconfig.%{name}
%if ! %{with systemd}
install -D -m755 %{SOURCE12} %{buildroot}%{_initddir}/%{name}
%endif
# Files list
%files
%license LICENSE
%doc MANPAGE.md README.md
%{_bindir}/earlyoom
%if %{with systemd}
%{_unitdir}/%{name}.service
%else
%{_initddir}/%{name}
%exclude %{_sysconfdir}/systemd/system/earlyoom.service
%endif
%exclude %{_sysconfdir}/default/earlyoom
%{_fillupdir}/sysconfig.%{name}
%{_mandir}/man1/earlyoom.1%{?ext_man}
%if 0%{?_unitdir:1}
%pre
%{service_add_pre %{name}.service}