From 835eb9298e83c32693ddcc66258fcdd6ffd3f980 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Thu, 13 Dec 2007 15:57:06 -0500 Subject: apply patch from Eli Criffield for running on Suse (fixing up spec and init-scripts to be suse compatible) --- func.spec | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'func.spec') diff --git a/func.spec b/func.spec index 376d17e..2586c06 100644 --- a/func.spec +++ b/func.spec @@ -1,6 +1,8 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) + Summary: Remote config, monitoring, and management api Name: func Source1: version @@ -12,11 +14,15 @@ Group: Applications/System Requires: python >= 2.3 Requires: pyOpenSSL BuildRequires: python-devel +%if %is_suse +BuildRequires: gettext-devel +%else %if 0%{?fedora} >= 8 BuildRequires: python-setuptools-devel %else BuildRequires: python-setuptools %endif +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Url: https://hosted.fedoraproject.org/projects/func/ @@ -33,7 +39,7 @@ func is a remote api for mangement, configation, and monitoring of systems. %install test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install --root=$RPM_BUILD_ROOT +%{__python} setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT %clean rm -fr $RPM_BUILD_ROOT @@ -77,18 +83,48 @@ rm -fr $RPM_BUILD_ROOT %post -/sbin/chkconfig --add funcd -/sbin/chkconfig --add certmaster +# for suse +if [ -x /usr/lib/lsb/install_initd ]; then + /usr/lib/lsb/install_initd /etc/init.d/funcd + /usr/lib/lsb/install_initd /etc/init.d/certmaster +# for red hat distros +elif [ -x /sbin/chkconfig ]; then + /sbin/chkconfig --add funcd + /sbin/chkconfig --add certmaster +# or, the old fashioned way +else + for i in 2 3 4 5; do + ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/S99funcd + ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster + done + for i in 1 6; do + ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/S99funcd + ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster + done +fi exit 0 %preun if [ "$1" = 0 ] ; then - /sbin/service funcd stop > /dev/null 2>&1 - /sbin/chkconfig --del funcd + /etc/init.d/funcd stop > /dev/null 2>&1 + /etc/init.d/certmaster stop > /dev/null 2>&1 + if [ -x /usr/lib/lsb/remove_initd ]; then + /usr/lib/lsb/remove_initd /etc/init.d/funcd + /usr/lib/lsb/remove_initd /etc/init.d/certmaster + elif [ -x /sbin/chkconfig ]; then + /sbin/chkconfig --del funcd + /sbin/chkconfig --del certmaster + else + rm -f /etc/rc.d/rc?.d/???funcd + rm -f /etc/rc.d/rc?.d/???certmaster + fi fi %changelog +* Thu Dec 13 2007 Eli Criffield - 0.0.14-4 +- changes for suse integration + * Tue Dec 11 2007 Michael DeHaan - 0.0.14-2 - python egg section added for F9 and later -- cgit