Author: draenog                      Date: Fri Mar 16 20:13:04 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 0.8
- add slug_watch daemon

---- Files affected:
packages/git-core-slug:
   git-core-slug.spec (1.12 -> 1.13) , slug_watch.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/git-core-slug/git-core-slug.spec
diff -u packages/git-core-slug/git-core-slug.spec:1.12 
packages/git-core-slug/git-core-slug.spec:1.13
--- packages/git-core-slug/git-core-slug.spec:1.12      Thu Sep 29 15:20:27 2011
+++ packages/git-core-slug/git-core-slug.spec   Fri Mar 16 21:12:59 2012
@@ -3,18 +3,19 @@
 %define        module  git_slug
 Summary:       Tools to interact with PLD git repositories
 Name:          git-core-slug
-Version:       0.7
+Version:       0.8
 Release:       1
 License:       GPL v2
 Group:         Development/Building
 Source0:       
https://github.com/draenog/slug/tarball/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 016770d23589ec5996982f532f49574b
+# Source0-md5: c070c539d8a67399b729537cc3ace456
+Source1:       slug_watch.init
 URL:           https://github.com/draenog/slug
 BuildRequires: asciidoc
 BuildRequires: docbook-dtd45-xml
 BuildRequires: python3-modules
 BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: xmlto
 Requires:      git-core
 Requires:      python3-modules
@@ -24,6 +25,17 @@
 %description
 Python tools to interact with PLD git repositories.
 
+%package watch
+Summary:       Cron job to update Refs repository for git-slug
+Group:         Development/Building
+Requires:      pld-gitolite
+Requires(post,preun):  /sbin/chkconfig
+Requires:      rc-scripts
+
+%description watch
+Cron job to update Refs repository for git-slug. It is to be run on
+PLD gitolite server.
+
 %prep
 %setup -qc
 mv draenog-slug-*/* .
@@ -45,9 +57,27 @@
 ln -s %{_bindir}/slug.py $RPM_BUILD_ROOT%{_libdir}/git-core/git-pld
 echo ".so slug.py.1" > $RPM_BUILD_ROOT%{_mandir}/man1/git-pld.1
 
+install -D %SOURCE1 $RPM_BUILD_ROOT/etc/rc.d/init.d/slug_watch
+install -d $RPM_BUILD_ROOT/home/services/gitolite/.gitolite/hooks/common
+cp -r post-receive.python.d 
$RPM_BUILD_ROOT/home/services/gitolite/.gitolite/hooks/common
+install -d $RPM_BUILD_ROOT/home/services/gitolite/{watchdir,Refs}
+install -d $RPM_BUILD_ROOT/home/services/gitolite/Attic
+touch $RPM_BUILD_ROOT/home/services/gitolite/{watchdir,Refs}
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post watch
+/sbin/chkconfig --add slug_watch
+%service slug_watch restart
+
+%preun watch
+if [ "$1" = "0" ]; then
+        %service -q slug_watch stop
+        /sbin/chkconfig --del slug_watch
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc HOWTO Changelog
@@ -55,16 +85,36 @@
 %{_libdir}/git-core/git-pld
 %{_mandir}/man1/*.1*
 %{py3_sitescriptdir}/%{module}
+%exclude %{py3_sitescriptdir}/%{module}/serverconst.py
+%exclude %{py3_sitescriptdir}/%{module}/*/serverconst.*
 %if "%{py_ver}" > "2.4"
 %{py3_sitescriptdir}/git_core_slug-*.egg-info
 %endif
 
+%files watch
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/slug_watch
+%attr(754,root,root) /etc/rc.d/init.d/slug_watch
+%attr(755,gitolite,gitolite) /home/services/gitolite/adc/bin/trash
+%{py3_sitescriptdir}/Daemon
+%{py3_sitescriptdir}/%{module}//serverconst.py
+%{py3_sitescriptdir}/%{module}/*/serverconst.*
+%attr(644,gitolite,gitolite) 
/home/services/gitolite/.gitolite/hooks/common/post-receive.python.d/slug_hook.py
+%attr(744,gitolite,gitolite) %dir /home/services/gitolite/Attic
+%attr(744,gitolite,gitolite) %dir /home/services/gitolite/watchdir
+%attr(744,gitolite,gitolite) %dir /home/services/gitolite/Refs
+
+
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <[email protected]>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.13  2012/03/16 20:12:59  draenog
+- up to 0.8
+- add slug_watch daemon
+
 Revision 1.12  2011/09/29 13:20:27  draenog
 - up to v0.7
 

================================================================
Index: packages/git-core-slug/slug_watch.init
diff -u /dev/null packages/git-core-slug/slug_watch.init:1.1
--- /dev/null   Fri Mar 16 21:13:04 2012
+++ packages/git-core-slug/slug_watch.init      Fri Mar 16 21:12:59 2012
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# slug_watch   daemon to update Refs list
+#
+# chkconfig:   345 99 01
+#
+# description: daemon for PLD gitolite setup
+#
+# processname: slug_watch
+# pidfile: /var/run/slug_watch.pid
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+
+pidfile="/var/run/slug_watch.pid"
+
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/slug_watch ]; then
+               msg_already_running "slug_watch"
+               return
+       fi
+
+       msg_starting "slug_watch"
+       daemon /usr/bin/slug_watch -u gitolite -d start 
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/slug_watch
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/slug_watch ]; then
+               msg_not_running "slug_watch"
+               return
+       fi
+
+       # Stop daemons.
+       msg_stopping "slug_watch"
+       killproc slug_watch
+       rm -f /var/lock/subsys/slug_watch
+}
+
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  status)
+       status --pidfile $pidfile slug_watch
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|status}"
+       exit 3
+esac
+
+exit $RETVAL
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/git-core-slug/git-core-slug.spec?r1=1.12&r2=1.13&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to