[syslog-ng] drop support for fedora/rhel versions without systemd support
Matthias Runge
mrunge at fedoraproject.org
Tue Apr 26 20:37:23 UTC 2011
commit 7a38c6846990f581fbb71f179c8ce8ffe7e1fcc0
Author: Matthias Runge <mrunge at matthias-runge.de>
Date: Tue Apr 26 22:35:43 2011 +0200
drop support for fedora/rhel versions without systemd support
syslog-ng.init.d | 123 ------------------------------------------------------
syslog-ng.spec | 61 +++++++++------------------
2 files changed, 20 insertions(+), 164 deletions(-)
---
diff --git a/syslog-ng.spec b/syslog-ng.spec
index 680defb..d4d8502 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -8,7 +8,7 @@
Name: syslog-ng
Version: 3.2.3
-Release: 0.%{gitsnapshot}.1%{?dist}
+Release: 0.%{gitsnapshot}.2%{?dist}
Summary: Next-generation syslog server
Group: System Environment/Daemons
@@ -21,10 +21,9 @@ Url: http://www.balabit.com/products/syslog_ng/
#Source0: http://www.balabit.com/downloads/files/%{name}/open-source-edition/%{version}/source/%{name}_%{version}.tar.gz
Source0: %{name}-%{version}-%{gitsnapshot}.tar.bz2
Source1: syslog-ng.conf
-Source2: syslog-ng.init.d
+Source2: syslog-ng.service
Source3: syslog-ng.sysconfig
Source4: syslog-ng.logrotate
-Source5: syslog-ng.service
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -43,10 +42,10 @@ BuildRequires: pcre-devel >= 7.3
BuildRequires: tcp_wrappers-devel
Requires: logrotate
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
+Requires(post): /bin/systemctl
+Requires(preun): /bin/systemctl
+Requires(preun): /bin/systemctl
+Requires(postun): /bin/systemctl
Provides: syslog
# merge separate syslog-vim package into one
@@ -117,15 +116,8 @@ make DESTDIR=%{buildroot} install
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
%{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf
-# install init script for fedora <=14
-%if 0%{?fedora} < 15
- %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/init.d
- %{__install} -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}
-%else
- # install systemd native file
-
- %{__install} -p -D -m 644 %{SOURCE5} %{buildroot}/%{system_service}/%{name}.service
-%endif
+# install init script
+%{__install} -p -D -m 644 %{SOURCE2} %{buildroot}/%{system_service}/%{name}.service
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
@@ -162,33 +154,19 @@ rm -rf %{buildroot}
%post
/sbin/ldconfig
-%if 0%{?fedora} < 15
- /sbin/chkconfig --add %{name}
-%else
- /bin/systemctl enable %{name}.service
-%endif
+/bin/systemctl enable %{name}.service
%preun
if [ "$1" = 0 ]; then
- %if 0%{?fedora} < 15
- /sbin/service %{name} stop > /dev/null 2>&1
- /sbin/chkconfig --del %{name}
- %else
- /bin/systemctl stop %{name}.service
- /bin/systemctl disable %{name}.service
- %endif
+/bin/systemctl stop %{name}.service
+/bin/systemctl disable %{name}.service
fi
%postun
/sbin/ldconfig
if [ "$1" -ge 1 ]; then
- %if 0%{?fedora} < 15
- /sbin/service %{name} condrestart >/dev/null 2>&1
- %else
- /bin/systemctl condrestart %{name}.service
- %endif
-
+/bin/systemctl condrestart %{name}.service
fi
@@ -225,11 +203,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{name}/scl.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
-%if 0%{?fedora} < 15
-%{_sysconfdir}/init.d/%{name}
-%else
%{system_service}/%{name}.service
-%endif
%dir %{_localstatedir}
%{_sbindir}/%{name}
@@ -244,9 +218,11 @@ fi
# uhm, some better places for those?
%{_datadir}/xsd
-%{_mandir}/man1/*
-%{_mandir}/man5/*
-%{_mandir}/man8/*
+%{_mandir}/man1/loggen.1*
+%{_mandir}/man1/pdbtool.1*
+%{_mandir}/man1/syslog-ng-ctl.1*
+%{_mandir}/man5/syslog-ng.conf.5*
+%{_mandir}/man8/syslog-ng.8*
%ghost %{_datadir}/vim/
%files devel
@@ -256,6 +232,9 @@ fi
%changelog
+* Tue Apr 26 2011 Matthias Runge <mrunge at matthias-runge.de> - 3.2.3-0.20110424.2
+- drop support for fedora without systemd
+
* Mon Apr 25 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.3-0.20110424.1
- change NVR to alert users that we have been using a syslog-ng v3.2 git snapshot
(for systemd support)
More information about the scm-commits
mailing list