From cb53118f0c1c4d40314f2fe1e80320fcabc84a4e Mon Sep 17 00:00:00 2001 From: stevejenkins Date: Wed, 25 Mar 2015 10:49:15 -0700 Subject: Still fixing global variables issues --- opendkim.spec | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/opendkim.spec b/opendkim.spec index 364f8de..df5ced1 100644 --- a/opendkim.spec +++ b/opendkim.spec @@ -1,4 +1,4 @@ -%global is_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) +%global systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -12,7 +12,7 @@ Group: System Environment/Daemons Requires: lib%{name} = %{version}-%{release} Requires (pre): shadow-utils -%if %is_systemd +%if %systemd # Required for systemd Requires (post): systemd-units Requires (preun): systemd-units @@ -36,13 +36,7 @@ BuildRequires: sendmail-devel Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -%if %is_systemd -# Define systemd patches -#Patch0: %{name}.patchname.patch -%else -# Define SysV patches Patch0: %{name}.init.patch -%endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -71,7 +65,7 @@ required for developing applications against libopendkim. %prep %setup -q -%if %is_systemd +%if %systemd # Apply systemd patches #%patch0 -p1 %else @@ -84,7 +78,7 @@ required for developing applications against libopendkim. # properly handle 32 versus 64 bit detection and settings %define LIBTOOL LIBTOOL=`which libtool` -%if %is_systemd +%if %systemd %configure --with-libmemcached --with-db %else %configure --with-db @@ -102,7 +96,7 @@ install -d %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_sysconfdir}/sysconfig install -m 0755 contrib/init/redhat/%{name}-default-keygen %{buildroot}%{_sbindir}/%{name}-default-keygen -%if %is_systemd +%if %systemd install -d -m 0755 %{buildroot}%{_unitdir} install -m 0644 contrib/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service %else @@ -364,7 +358,7 @@ getent passwd %{name} >/dev/null || \ exit 0 %post -%if %is_systemd +%if %systemd if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl enable %{name}.service >/dev/null 2>&1 || : @@ -376,7 +370,7 @@ fi %endif %preun -%if %is_systemd +%if %systemd if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || : @@ -393,7 +387,7 @@ exit 0 %endif %postun -%if %is_systemd +%if %systemd /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall @@ -408,7 +402,7 @@ fi exit 0 %endif -%if %is_systemd +%if %systemd %triggerun -- %{name} < 2.8.0-1 /bin/systemctl enable %{name}.service >/dev/null 2>&1 /sbin/chkconfig --del %{name} >/dev/null 2>&1 || : @@ -443,7 +437,7 @@ rm -rf %{buildroot} %dir %attr(750,%name,%{name}) %{_sysconfdir}/%{name}/keys %attr(0755,root,root) %{_sbindir}/%{name}-default-keygen -%if is_systemd +%if %systemd %attr(0644,root,root) %{_unitdir}/%{name}.service %else %attr(0755,root,root) %{_initrddir}/%{name} -- cgit