Accepting request 204927 from home:posophe:branches:systemsmanagement

Add systemd support for openSUSE >= 12.3

OBS-URL: https://build.opensuse.org/request/show/204927
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/freeipmi?expand=0&rev=32
This commit is contained in:
Klaus Kämpf 2013-10-28 11:50:59 +00:00 committed by Git OBS Bridge
parent ae604da92b
commit 048a3aff6d
5 changed files with 85 additions and 4 deletions

12
bmc-watchdog.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=BMC Watchdog Timer Daemon
After=network.target
[Service]
Type=forking
PIDFile=/run/bmc-watchdog.pid
EnvironmentFile=-/etc/sysconfig/bmc-watchdog
ExecStart=/usr/sbin/bmc-watchdog $OPTIONS
[Install]
WantedBy=multi-user.target

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Oct 27 19:14:16 UTC 2013 - p.drouand@gmail.com
- Add systemd support for openSUSE >= 12.3
-------------------------------------------------------------------
Fri Oct 4 07:56:38 UTC 2013 - kkaempf@suse.com

View File

@ -31,7 +31,10 @@ Name: %{name}
Version: %{version}
Release: %{release}
Url: http://www.gnu.org/software/freeipmi/
Source: %{name}-%{version}.tar.bz2
Source0: %{name}-%{version}.tar.bz2
Source1: bmc-watchdog.service
Source2: ipmidetectd.service
Source3: ipmiseld.service
Summary: FreeIPMI
License: GPL-3.0+
Group: System/Management
@ -43,6 +46,9 @@ BuildRequires: texinfo
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
%if 0%{?suse_version} >=1230
BuildRequires: pkgconfig(systemd)
%endif
Obsoletes: freeipmi-ipmimonitoring
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -70,6 +76,9 @@ Summary: FreeIPMI BMC watchdog
Group: System/Management
%if 0%{?suse_version}
Requires(pre): %fillup_prereq
%if 0%{?suse_version} >=1230
%{?systemd_requires}
%endif
%endif
Requires: freeipmi = %{version}
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
@ -89,6 +98,9 @@ Requires: freeipmi = %{version}
Requires(post): chkconfig
Requires(preun): chkconfig
%endif
%if 0%{?suse_version} >=1230
%{?systemd_requires}
%endif
%description ipmidetectd
This service detects and monitors IPMI nodes.
@ -143,6 +155,13 @@ rm -f %{buildroot}%{_datadir}/doc/packages/freeipmi/INSTALL
(cd %{buildroot}/%{_sysconfdir}; rm init.d)
%endif
# Add systemd support for openSUSE >= 12.3
%if 0%{?suse_version} >=1230
mkdir -p %{buildroot}%{_unitdir}
%{__install} -m 0755 %{S:1} %{S:2} %{S:3} %{buildroot}%{_unitdir}/
rm -r %{buildroot}%{_initddir}
%endif
# fix coherance problems with associated script filenames
rm -f %{buildroot}%{_infodir}/dir
# kludge to get around rpmlint complaining about 0 length semephore file
@ -160,9 +179,6 @@ mv %{buildroot}%{_sysconfdir}/sysconfig/bmc-watchdog %{buildroot}%{_localstatedi
%fdupes $RPM_BUILD_ROOT
%endif
%clean
rm -rf %{buildroot}
%post
if [ -x /sbin/install-info ]; then
#/sbin/install-info %{_infodir}/freeipmi.info.gz %{_infodir}/dir
@ -184,6 +200,9 @@ fi
%if 0%{?suse_version}
%{fillup_only}
%endif
%if 0%{?suse_version} >=1230
%service_add_post bmc-watchdog.service
%else
if [ "$1" = 1 ]; then
if [ -x %{_initddir}/bmc-watchdog ]; then
/sbin/chkconfig --add bmc-watchdog
@ -199,8 +218,12 @@ if [ $1 -ge 1 ]; then
fi
fi
fi
%endif
%preun bmc-watchdog
%if 0%{?suse_version} >=1230
%service_del_preun bmc-watchdog.service
%else
#
# Stop bmc-watchdog if it is running
#
@ -212,8 +235,12 @@ if [ "$1" = 0 ]; then
/sbin/chkconfig --del bmc-watchdog
fi
fi
%endif
%post ipmidetectd
%if 0%{?suse_version} >=1230
%service_add_post ipmidetectd.service
%else
if [ "$1" = 1 ]; then
if [ -x %{_initddir}/ipmidetectd ]; then
/sbin/chkconfig --add ipmidetectd
@ -229,8 +256,12 @@ if [ $1 -ge 1 ]; then
fi
fi
fi
%endif
%preun ipmidetectd
%if 0%{?suse_version} >=1230
%service_del_preun ipmidetectd.service
%else
#
# Stop ipmidetectd if it is running
#
@ -242,6 +273,7 @@ if [ "$1" = 0 ]; then
/sbin/chkconfig --del ipmidetectd
fi
fi
%endif
%files
%defattr(-,root,root)
@ -292,7 +324,11 @@ fi
#%{_docdir}
#%endif
%config %{_sysconfdir}/freeipmi/ipmiseld.conf
%if 0%{?suse_version} >=1230
%{_unitdir}/ipmiseld.service
%else
%{_initddir}/ipmiseld
%endif
%{_libdir}/libipmiconsole*so.*
%{_libdir}/libipmidetect*so.*
%{_libdir}/libfreeipmi*so.*
@ -426,7 +462,11 @@ fi
%doc COPYING.bmc-watchdog
%doc DISCLAIMER.bmc-watchdog
%doc DISCLAIMER.bmc-watchdog.UC
%if 0%{?suse_version} >=1230
%{_unitdir}/bmc-watchdog.service
%else
%config(noreplace) %{_initddir}/bmc-watchdog
%endif
%if 0%{?suse_version}
%attr(0444,root,root) %config(noreplace) %{_localstatedir}/adm/fillup-templates/sysconfig.bmc-watchdog
%else
@ -439,7 +479,11 @@ fi
%files ipmidetectd
%defattr(-,root,root)
%if 0%{?suse_version} >=1230
%{_unitdir}/ipmidetectd.service
%else
%config(noreplace) %{_initddir}/ipmidetectd
%endif
%attr(0444,root,root) %config(noreplace) %{_sysconfdir}/freeipmi/ipmidetectd.conf
%{_sbindir}/ipmidetectd
%{_mandir}/man5/ipmidetectd.conf.5*

10
ipmidetectd.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=IPMI Node Detection Monitoring Daemon
After=network.target
[Service]
Type=forking
ExecStart=/usr/sbin/ipmidetectd
[Install]
WantedBy=multi-user.target

10
ipmiseld.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=IPMI SEL syslog logging daemon
After=network.target
[Service]
Type=forking
ExecStart=/usr/sbin/ipmiseld
[Install]
WantedBy=multi-user.target