--- /dev/null
+#!/bin/sh
+#
+# func: Starts the func certmaster daemon
+#
+# Version: @(#) /etc/rc.d/init.d/func 0.1
+#
+# chkconfig: - 98 99
+# description: Starts and stops the func daemon at startup and shutdown..
+
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/certmaster ]; then
+ msg_starting "certmaster"
+ daemon /usr/bin/certmaster
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/certmaster
+ else
+ msg_already_running "certmaster"
+ fi
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/certmaster ]; then
+ msg_stopping "certmaster"
+ killproc certmaster
+ rm -f /var/lock/subsys/certmaster
+ else
+ msg_not_running "certmaster"
+ fi
+ ;;
+ status)
+ status certmaster
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+#!/bin/sh
+#
+# func: Starts the func daemon
+#
+# Version: @(#) /etc/rc.d/init.d/func 0.1
+#
+# chkconfig: - 98 99
+# description: Starts and stops the func daemon at startup and shutdown..
+
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/funcd ]; then
+ msg_starting "funcd"
+ daemon /usr/bin/funcd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/funcd
+ else
+ msg_already_running "funcd"
+ fi
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/funcd ]; then
+ msg_stopping "funcd"
+ killproc funcd
+ rm -f /var/lock/subsys/funcd
+ else
+ msg_not_running "funcd"
+ fi
+ ;;
+ status)
+ status funcd
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+%define subver .3
+Summary: Fedora Unified Network Controller
+Name: func
+Version: 0.13
+Release: 1
+License: GPLv2+
+Group: Applications/System
+Source0: https://hosted.fedoraproject.org/projects/func/attachment/wiki/FuncReleases/%{name}-%{version}.tar%{subver}.gz?format=raw
+# Source0-md5: adf06e92209e2576bd44fa64641b8733
+Source1: %{name}-funcd.init
+Source2: %{name}-certmaster.init
+URL: https://hosted.fedoraproject.org/projects/func/
+BuildRequires: python >= 1:2.5
+BuildRequires: rpmbuild(macros) >= 1.219
+Requires: python-pyOpenSSL
+%pyrequires_eq python-libs
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+func is a remote api for mangement, configation, and monitoring of systems.
+
+%prep
+%setup -q
+
+%build
+python setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/funcd
+
+python setup.py install \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/funcd
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/certmaster
+
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add certmaster
+/sbin/chkconfig --add funcd
+
+%preun
+if [ "$1" = "0" ]; then
+ %service certmaster stop
+ %service funcd stop
+ /sbin/chkconfig --del certmaster
+ /sbin/chkconfig --del funcd
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS README
+%attr(755,root,root) %{_bindir}/funcd
+%attr(755,root,root) %{_bindir}/func
+%attr(755,root,root) %{_bindir}/certmaster
+%attr(755,root,root) %{_bindir}/certmaster-ca
+%attr(755,root,root) %{_bindir}/func-inventory
+%dir %{_sysconfdir}/%{name}
+%dir %{_sysconfdir}/%{name}/minion-acl.d/
+# TODO: move /etc/pki into FHS? It's used for key storage
+%dir %{_sysconfdir}/pki
+%dir %{_sysconfdir}/pki/%{name}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/func/minion.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/func/certmaster.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/logrotate.d/func_rotate
+%attr(755,root,root) /etc/rc.d/init.d/certmaster
+%attr(755,root,root) /etc/rc.d/init.d/funcd
+%{py_sitescriptdir}/func-%{version}-py*.egg-info
+%{py_sitescriptdir}/func
+%{_mandir}/man1/*.1*