Get rid of the WITH_SYSTEMD switches

This commit is contained in:
sgrubb 2015-10-23 10:56:52 -04:00
parent c89913942d
commit b431fd5163

View File

@ -1,9 +1,5 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
# Do we want systemd?
%define WITH_SYSTEMD 1
# %define snapshot .svn20140803
Summary: User space tools for 2.6 kernel auditing Summary: User space tools for 2.6 kernel auditing
Name: audit Name: audit
Version: 2.4.4 Version: 2.4.4
@ -30,14 +26,10 @@ BuildRequires: audit-libs-devel
%endif %endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%if %{WITH_SYSTEMD}
BuildRequires: systemd BuildRequires: systemd
Requires(post): systemd-units systemd-sysv chkconfig coreutils Requires(post): systemd-units systemd-sysv chkconfig coreutils
Requires(preun): systemd-units Requires(preun): systemd-units
Requires(postun): systemd-units coreutils Requires(postun): systemd-units coreutils
%else
Requires: chkconfig
%endif
%description %description
The audit package contains the user space utilities for The audit package contains the user space utilities for
@ -123,17 +115,12 @@ cp %{SOURCE1} .
%ifarch %{golang_arches} %ifarch %{golang_arches}
--with-golang \ --with-golang \
%endif %endif
%if %{WITH_SYSTEMD}
--enable-systemd --enable-systemd
%endif
make CFLAGS="%{optflags}" %{?_smp_mflags} make CFLAGS="%{optflags}" %{?_smp_mflags}
%install %install
mkdir -p $RPM_BUILD_ROOT/{sbin,etc/audispd/plugins.d} mkdir -p $RPM_BUILD_ROOT/{sbin,etc/audispd/plugins.d}
%if !%{WITH_SYSTEMD}
mkdir -p $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d}}
%endif
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man5,man8} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man5,man8}
mkdir -p $RPM_BUILD_ROOT/%{_lib} mkdir -p $RPM_BUILD_ROOT/%{_lib}
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/audit mkdir -p $RPM_BUILD_ROOT/%{_libdir}/audit
@ -181,21 +168,10 @@ rm -rf $RPM_BUILD_ROOT
if [ ! -e /etc/audit/audit.rules ] ; then if [ ! -e /etc/audit/audit.rules ] ; then
cp /etc/audit/rules.d/audit.rules /etc/audit/audit.rules cp /etc/audit/rules.d/audit.rules /etc/audit/audit.rules
fi fi
%if %{WITH_SYSTEMD}
%systemd_post auditd.service %systemd_post auditd.service
%else
/sbin/chkconfig --add auditd
%endif
%preun %preun
%if %{WITH_SYSTEMD}
%systemd_preun auditd.service %systemd_preun auditd.service
%else
if [ $1 -eq 0 ]; then
/sbin/service auditd stop > /dev/null 2>&1
/sbin/chkconfig --del auditd
fi
%endif
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
@ -277,7 +253,6 @@ fi
%attr(755,root,root) %{_bindir}/aulastlog %attr(755,root,root) %{_bindir}/aulastlog
%attr(755,root,root) %{_bindir}/ausyscall %attr(755,root,root) %{_bindir}/ausyscall
%attr(755,root,root) %{_bindir}/auvirt %attr(755,root,root) %{_bindir}/auvirt
%if %{WITH_SYSTEMD}
%attr(640,root,root) %{_unitdir}/auditd.service %attr(640,root,root) %{_unitdir}/auditd.service
%attr(750,root,root) %dir %{_libexecdir}/initscripts/legacy-actions/auditd %attr(750,root,root) %dir %{_libexecdir}/initscripts/legacy-actions/auditd
%attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/resume %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/resume
@ -285,10 +260,6 @@ fi
%attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/stop %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/stop
%attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/restart %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/restart
%attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/condrestart %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/condrestart
%else
%attr(755,root,root) /etc/rc.d/init.d/auditd
%config(noreplace) %attr(640,root,root) /etc/sysconfig/auditd
%endif
%attr(750,root,root) %dir %{_var}/log/audit %attr(750,root,root) %dir %{_var}/log/audit
%attr(750,root,root) %dir /etc/audit %attr(750,root,root) %dir /etc/audit
%attr(750,root,root) %dir /etc/audit/rules.d %attr(750,root,root) %dir /etc/audit/rules.d