--- old/func.spec	2010-05-26 10:40:59.332906925 +0200
+++ new/func.spec	2010-05-26 10:44:14.275666226 +0200
@@ -4,52 +4,80 @@
 %define python python%{?__python_ver}
 %define __python /usr/bin/%{python}
 
-%{!?python_version: %define python_version %(%{__python} -c "from distutils.sysconfig import get_python_version; print get_python_version()")}
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
 
 %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
 
-Summary: Remote management framework
-Name: func
-Version: 0.25
-Release: 2%{?dist}
-Source0: %{name}-%{version}.tar.gz
-License: GPLv2+
-Group: Applications/System
+%define long_hash  ce3a1a67452fdb7b907e2e5e9716c4943c281eb7
+%define short_hash ce3a1a674
+%define today %(date +%Y%m%d)
+
+
+Summary:	Remote management framework
+Name:		func
+Version:	0.26
+Release:	0.%{today}.git%{short_hash}%{?dist}
+# download source:
+# git clone git://git.fedorahosted.org/func.git
+# cd func
+# git reset --hard %{long_hash}
+# python setup.py sdist
+# func-%{version}.tar.gz is in dist/
+Source0:	%{name}-%{version}.tar.gz
+License:	GPLv2+
+Group:		Applications/System
 %if 0%{?rhel} == 3
-Requires: %{python}
-Requires: pyOpenSSL-py23
+Requires:	%{python}
+Requires:	pyOpenSSL-py23
 %else
-Requires: python >= 2.3
-Requires: pyOpenSSL
+Requires:	python >= 2.3
+Requires:	pyOpenSSL
 %endif
-Requires: %{python}-simplejson
-Requires: certmaster >= %{version}
-Requires: logrotate
-BuildRequires: %{python}-devel
+Requires:	%{python}-simplejson
+Requires:	certmaster >= %{version}
+Requires:	logrotate
+BuildRequires:	%{python}-devel
 %if %is_suse
-BuildRequires: gettext-devel
+BuildRequires:	gettext-devel
 %else
 %if 0%{?fedora} >= 8
-BuildRequires: python-setuptools-devel
+BuildRequires:	python-setuptools-devel
 %else
 %if 0%{?rhel} >= 5
-BuildRequires: python-setuptools
+BuildRequires:	python-setuptools
 %endif
 %endif
 %endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-BuildArch: noarch
-Url: https://fedorahosted.org/func/
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
+BuildArch:	noarch
+Url:		https://fedorahosted.org/func/
 
 %description
-func is a remote api for mangement, configuration, and monitoring of systems.
+func is a remote api for management, configuration, and monitoring of systems.
 
 %prep
 %setup -q
 %if 0%{?rhel} == 3
 %patch0 -p1
 %endif
+# etc/version is missing(?) so don't include it in setup.py
+sed -i 's:"etc/version"::' setup.py
+# move manpage files from .pod to .1 so rpm can handle them
+for f in $(ls docs/*.pod); do
+  nf=$(echo $f | sed 's/pod/1/')
+  mv $f $nf && gzip $nf
+done
+# logrotate files should be installed as /etc/logrotate.d/<pkg-name>
+mv etc/func_rotate etc/func
+sed -i 's:func_rotate:func:' setup.py
+# some files have an unnecessary shebang that should be removed
+sed -i 1d func/minion/modules/confmgt_augeas.py
+sed -i 1d func/minion/modules/pullfile.py
+sed -i 1d func/overlord/test_func.py
+sed -i 1d func/minion/modules/bridge.py
 
 %build
 %{__python} setup.py build
@@ -57,8 +85,9 @@
 %install
 test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
 %{__python} setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT
-touch $RPM_BUILD_ROOT/var/log/func/func.log
-touch $RPM_BUILD_ROOT/var/log/func/audit.log
+# create (almost) empty logfiles
+echo " " > $RPM_BUILD_ROOT/var/log/func/func.log
+echo " " > $RPM_BUILD_ROOT/var/log/func/audit.log
 
 %clean
 rm -fr $RPM_BUILD_ROOT
@@ -74,6 +103,7 @@
 %{_bindir}/func-create-module
 %{_bindir}/func-transmit
 %{_bindir}/func-build-map
+%{_bindir}/func-group
 #%{_bindir}/update-func
 /etc/init.d/funcd
 %dir %{_sysconfdir}/%{name}
@@ -82,18 +112,24 @@
 %config(noreplace) /etc/func/minion.conf
 %config(noreplace) /etc/func/async_methods.conf
 %config(noreplace) /etc/func/overlord.conf
-%config(noreplace) /etc/logrotate.d/func_rotate
+%config(noreplace) /etc/logrotate.d/func
 %config(noreplace) /etc/func/modules/Test.conf
 %config(noreplace) /etc/func/modules/Bridge.conf
 %config(noreplace) /etc/func/modules/Vlan.conf
 %dir %{python_sitelib}/func
 %dir %{python_sitelib}/func/minion
+%dir %{python_sitelib}/func/minion/facts
+%dir %{python_sitelib}/func/minion/facts/modules
 %dir %{python_sitelib}/func/overlord
+%dir %{python_sitelib}/func/overlord/group
 %dir %{python_sitelib}/func/overlord/cmd_modules
 %dir %{python_sitelib}/func/overlord/modules
 %dir %{python_sitelib}/func/yaml
 %{python_sitelib}/func/minion/*.py*
+%{python_sitelib}/func/minion/facts/*.py*
+%{python_sitelib}/func/minion/facts/modules/*.py*
 %{python_sitelib}/func/overlord/*.py*
+%{python_sitelib}/func/overlord/group/*.py*
 %{python_sitelib}/func/overlord/cmd_modules/*.py*
 %{python_sitelib}/func/overlord/modules/*.py*
 %{python_sitelib}/func/yaml/*.py*
@@ -135,10 +171,10 @@
 # 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/funcd /etc/rc.d/rc${i}.d/S99funcd
    done
    for i in 1 6; do
-        ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/k01funcd
+	ln -sf /etc/init.d/funcd /etc/rc.d/rc${i}.d/k01funcd
    done
 fi
 # fix perms on log files
@@ -164,6 +200,9 @@
 
 
 %changelog
+* Wed May 26 2010 Léon Keijser <keijser@stone-it.com> - 0.26-0.20100526.gitce3a1a674
+- built from git 
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 
