summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevejenkins <steve@stevejenkins.com>2015-03-25 10:49:15 -0700
committerstevejenkins <steve@stevejenkins.com>2015-03-25 10:49:15 -0700
commitcb53118f0c1c4d40314f2fe1e80320fcabc84a4e (patch)
treebfc8d7631b61b5f8c7cdeb0a85b898c127eb987c
parentf10bbf46850a0219b65992e26573f6db12f920fc (diff)
downloadopendkim_EL6-cb53118f0c1c4d40314f2fe1e80320fcabc84a4e.tar.gz
Still fixing global variables issues
-rw-r--r--opendkim.spec26
1 files 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}