- Use autosetup

- Remove conditional blocks for deprecated versions

OBS-URL: https://build.opensuse.org/package/show/Base:System/watchdog?expand=0&rev=4
This commit is contained in:
Dirk Mueller 2024-06-06 08:28:26 +00:00 committed by Git OBS Bridge
parent cd1fe8ec63
commit 6b9404a290
2 changed files with 8 additions and 45 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat May 18 19:24:20 UTC 2024 - Jonas Kvinge <jonaski@opensuse.org>
- Use autosetup
- Remove conditional blocks for deprecated versions
-------------------------------------------------------------------
Fri Jun 24 09:51:53 UTC 2022 - Marcus Meissner <meissner@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package watchdog
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,18 +16,6 @@
#
%if 0%{?suse_version} >= 1220
%define with_systemd 1
%else
%define with_systemd 0
%endif
%if 0%{?suse_version} >= 1500
%define with_tirpc 1
%else
%define with_tirpc 0
%endif
Summary: Software and/or Hardware watchdog daemon
License: GPL-2.0-only
Group: System/Daemons
@ -43,15 +31,11 @@ Source5: watchdog-ping.service
Patch0: watchdog-sysconfdir.diff
Patch1: watchdog-initscript.diff
%if %{with_tirpc}
BuildRequires: libtirpc-devel
%endif
%if %{with_systemd}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
%description
The watchdog program can be used as a powerful software watchdog daemon
@ -70,71 +54,44 @@ reset (or whatever action was configured to be taken upon watchdog timer
expiration) initiated by the BMC.
%prep
%setup -q -n %{name}-%{version}
%autosetup -p1
mv README README.orig
iconv -f ISO-8859-1 -t UTF-8 < README.orig > README
%patch0 -p1
%patch1 -p1
%build
%configure \
%if %{with_tirpc}
CFLAGS="$CFLAGS -I/usr/include/tirpc" \
LIBS="$LIBS -ltirpc"
%endif
%__make %{?_smp_mflags}
%install
install -d -m0755 %{buildroot}%{_sysconfdir}
make DESTDIR=%{buildroot} install
%if %{with_systemd}
install -Dp -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/watchdog.service
install -Dp -m0644 %{SOURCE5} %{buildroot}%{_unitdir}/watchdog-ping.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcwatchdog
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcwatchdog-ping
%else
install -d -m0755 %{buildroot}%{_sysconfdir}/init.d
install -m0755 suse/rc.watchdog.suse %{buildroot}%{_sysconfdir}/init.d/watchdog
ln -sf ../../%{_sysconfdir}/init.d/watchdog %{buildroot}/%{_sbindir}/rcwatchdog
%endif
%pre
%if %{with_systemd}
%service_add_pre %{name}.service watchdog-ping.service
%endif
%post
%if %{with_systemd}
%service_add_post %{name}.service watchdog-ping.service
%endif
%preun
%if %{with_systemd}
%service_del_preun %{name}.service watchdog-ping.service
%else
%{stop_on_removal %{name}}
%endif
%postun
%if %{with_systemd}
%service_del_postun %{name}.service watchdog-ping.service
%else
%{restart_on_update %{name}}
%{insserv_cleanup}
%endif
%files
%defattr(-, root, root, -)
%doc AUTHORS ChangeLog COPYING examples/ IAFA-PACKAGE NEWS README TODO README.watchdog.ipmi
%config(noreplace) %{_sysconfdir}/watchdog.conf
%if %{with_systemd}
%{_unitdir}/watchdog.service
%{_unitdir}/watchdog-ping.service
%{_sbindir}/rcwatchdog-ping
%else
%{_sysconfdir}/init.d/watchdog
%endif
%{_sbindir}/rcwatchdog
%{_sbindir}/watchdog
%{_sbindir}/wd_keepalive