summaryrefslogtreecommitdiffstats
path: root/func.spec
diff options
context:
space:
mode:
authorAdrian Likins <alikins@grimlock.devel.redhat.com>2007-12-13 15:57:06 -0500
committerAdrian Likins <alikins@grimlock.devel.redhat.com>2007-12-13 15:57:06 -0500
commit835eb9298e83c32693ddcc66258fcdd6ffd3f980 (patch)
treebe6d6df45102bd35dff85e2f09283769d42f9893 /func.spec
parent9aa702e1b83bc682597a11fddb394ee87c9cdfa0 (diff)
downloadthird_party-func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.zip
third_party-func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.tar.gz
third_party-func-835eb9298e83c32693ddcc66258fcdd6ffd3f980.tar.xz
apply patch from Eli Criffield <elicriffield@gmail.com> for
running on Suse (fixing up spec and init-scripts to be suse compatible)
Diffstat (limited to 'func.spec')
-rw-r--r--func.spec46
1 files changed, 41 insertions, 5 deletions
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 <elicriffield@gmail.com> - 0.0.14-4
+- changes for suse integration
+
* Tue Dec 11 2007 Michael DeHaan <mdehaan@redhat.com> - 0.0.14-2
- python egg section added for F9 and later