-%define release %{rpm_release}%{?dist}
-
-Summary: Application Server for hosting Ruby code on any capable middleware
-Name: mcollective
-Version: %{version}
-Release: %{release}
-Group: System Environment/Daemons
-License: ASL 2.0
-URL: http://puppetlabs.com/mcollective/introduction/
-Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{version}.tgz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: mcollective-common = %{version}-%{release}
-Packager: R.I.Pienaar <rip@devco.net>
-BuildArch: noarch
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
+%global _with_systemd 1
+%else
+%global _with_systemd 0
+%endif
+
+# VERSION is subbed out during rake package:srpm process
+%global realversion 2.3.3
+%global rpmversion 2.3.3
+
+Summary: Application Server for hosting Ruby code on any capable middleware
+Name: mcollective
+Version: %{rpmversion}
+Release: 1%{?dist}
+Group: System Environment/Daemons
+License: ASL 2.0
+URL: http://puppetlabs.com/mcollective/introduction/
+Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{realversion}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: ruby >= 1.8
+Requires: mcollective-common = %{version}-%{release}
+Packager: Puppet Labs <info@puppetlabs.com>
+BuildArch: noarch
+
+%if 0%{?_with_systemd}
+# Required for %%post, %%preun, %%postun
+Requires: systemd
+%if 0%{?fedora} >= 18
+BuildRequires: systemd
+%else
+BuildRequires: systemd-units
+%endif
+%else
+# Required for %%post and %%preun
+Requires: chkconfig
+# Required for %%preun and %%postun
+Requires: initscripts
+%endif
+
+%description
+The Marionette Collective:
+
+Server for the mcollective Application Server