Add -fno-strict-aliasing, Do not ship old init script, add systemd support

This commit is contained in:
Vitezslav Crhonek 2013-05-06 14:51:58 +02:00
parent 2642426779
commit 271ebba48e
3 changed files with 52 additions and 15 deletions

12
gatherer.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=SBLIM Data Gatherer metric service
After=syslog.target
Before=reposd.service
Requires=reposd.service
[Service]
Type=forking
ExecStart=/usr/sbin/gatherd
[Install]
WantedBy=multi-user.target

12
reposd.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=SBLIM Data Gatherer repository of metrics
After=syslog.target
After=gatherer.service
Requires=gatherer.service
[Service]
Type=forking
ExecStart=/usr/sbin/reposd
[Install]
WantedBy=multi-user.target

View File

@ -4,7 +4,7 @@
Name: sblim-gather
Version: 2.2.8
Release: 1%{?dist}
Release: 2%{?dist}
Summary: SBLIM Gatherer
Group: Applications/System
@ -14,8 +14,9 @@ Source0: http://downloads.sourceforge.net/project/sblim/%{name}/%{version
Source1: gather-config.h.prepend
Source2: gather-config.h
Source3: sblim-gather.tmpfiles
Source4: missing-providers.tgz
Source5: gatherer.service
Source6: reposd.service
BuildRequires: sblim-cmpi-devel
BuildRequires: sblim-cmpi-base-devel
@ -29,6 +30,9 @@ Patch1: sblim-gather-2.2.7-missing_providers.patch
Patch2: sblim-gather-2.2.7-typos.patch
Requires: tog-pegasus >= %{tog_pegasus_version}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
Standards Based Linux Instrumentation for Manageability
@ -83,9 +87,9 @@ tar xfvz %{SOURCE4}
%build
%ifarch s390 s390x ppc ppc64
export CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
export CFLAGS="$RPM_OPT_FLAGS -fsigned-char -fno-strict-aliasing"
%else
export CFLAGS="$RPM_OPT_FLAGS"
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%endif
%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite \
CIMSERVER=pegasus \
@ -129,10 +133,17 @@ echo "%{_libdir}/cmpi" > $RPM_BUILD_ROOT/%{_sysconfdir}/ld.so.conf.d/%{name}-%{_
make install/fast DESTDIR=$RPM_BUILD_ROOT -C missing-providers/%{_target_platform}
mkdir -p $RPM_BUILD_ROOT/var/lib/gather
# remove init script, install service files
rm $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/gatherer
mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
install -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/gatherer.service
install -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/reposd.service
%files
%config(noreplace) %{_sysconfdir}/*.conf
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%config(noreplace) %{_sysconfdir}/init.d/gatherer
%{_unitdir}/gatherer.service
%{_unitdir}/reposd.service
%docdir %{_datadir}/doc/%{name}-%{version}
%{_bindir}/*
%{_sbindir}/*
@ -177,23 +188,21 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/gather
%post
install -d -m 0755 -o root -g root /var/run/gather
/sbin/ldconfig
%systemd_post gatherer.service
%systemd_post reposd.service
%preun
%systemd_preun gatherer.service
%systemd_preun reposd.service
if [ $1 -eq 0 ]; then
rm -rf /var/run/gather
rm -rf /var/lib/gather
fi
# Stop gatherd and reposd
# If $1 > 0 also restart
for daemon in gatherd reposd; do
if ps -C "$daemon" &>/dev/null
then
killall "$daemon"
[ $1 -ge 1 ] && "$daemon"
fi
done || :
%postun -p /sbin/ldconfig
%postun
/sbin/ldconfig
%systemd_postun_with_restart gatherer.service
%systemd_postun_with_restart reposd.service
%pre provider
if [ $1 -gt 1 ]
@ -227,6 +236,10 @@ fi
%postun provider -p /sbin/ldconfig
%changelog
* Mon May 06 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.8-2
- Add -fno-strict-aliasing
- Do not ship old init script, add systemd support
* Mon Mar 18 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.8-1
- Update to sblim-gather-2.2.8