Author: glen                         Date: Sat Aug 21 10:36:34 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add PLD OS; rel 2

---- Files affected:
packages/php-pear-System_Daemon:
   php-pear-System_Daemon.spec (1.9 -> 1.10) , PLD.php (NONE -> 1.1)  (NEW), 
template_PLD.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-pear-System_Daemon/php-pear-System_Daemon.spec
diff -u packages/php-pear-System_Daemon/php-pear-System_Daemon.spec:1.9 
packages/php-pear-System_Daemon/php-pear-System_Daemon.spec:1.10
--- packages/php-pear-System_Daemon/php-pear-System_Daemon.spec:1.9     Fri Aug 
20 14:38:48 2010
+++ packages/php-pear-System_Daemon/php-pear-System_Daemon.spec Sat Aug 21 
12:36:29 2010
@@ -1,18 +1,18 @@
 # $Revision$, $Date$
 %include       /usr/lib/rpm/macros.php
-%define                _class          System
-%define                _subclass       Daemon
 %define                _status         beta
 %define                _pearname       System_Daemon
 Summary:       %{_pearname} - Turn PHP scripts into Linux daemons
 Summary(pl.UTF-8):     %{_pearname} - zamiana skryptów PHP w demony
 Name:          php-pear-%{_pearname}
 Version:       0.10.3
-Release:       1
+Release:       2
 License:       New BSD License
 Group:         Development/Languages/PHP
 Source0:       http://pear.php.net/get/%{_pearname}-%{version}.tgz
 # Source0-md5: 00dad1b9912238d9c99cf50bd5efc87d
+Source1:       PLD.php
+Source2:       template_PLD.sh
 URL:           http://pear.php.net/package/System_Daemon/
 BuildRequires: php-pear-PEAR
 BuildRequires: rpm-php-pearprov >= 4.4.2-11
@@ -104,6 +104,10 @@
 install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir}}
 %pear_package_install
 
+# Add PLD Linux OS system
+cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_pear_dir}/System/Daemon/OS
+cp -a %{SOURCE2} 
$RPM_BUILD_ROOT%{php_pear_dir}/data/System_Daemon/data/template_PLD
+
 install -d 
$RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir},%{_examplesdir}/%{name}-%{version}}
 cp -a examples/*  $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
@@ -135,6 +139,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.10  2010/08/21 10:36:29  glen
+- add PLD OS; rel 2
+
 Revision 1.9  2010/08/20 12:38:48  glen
 - up to 0.10.3-beta
 

================================================================
Index: packages/php-pear-System_Daemon/PLD.php
diff -u /dev/null packages/php-pear-System_Daemon/PLD.php:1.1
--- /dev/null   Sat Aug 21 12:36:34 2010
+++ packages/php-pear-System_Daemon/PLD.php     Sat Aug 21 12:36:29 2010
@@ -0,0 +1,67 @@
+<?php
+/* vim: set noai expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
+/**
+ * System_Daemon turns PHP-CLI scripts into daemons.
+ *
+ * PHP version 5
+ *
+ * @category  System
+ * @package   System_Daemon
+ * @author    Elan Ruusamäe <[email protected]>
+ * @license   http://www.opensource.org/licenses/bsd-license.php New BSD 
Licence
+ * @version   SVN: Release: $Id$
+ * @link      http://trac.plutonia.nl/projects/system_daemon
+ */
+
+/**
+ * A System_Daemon_OS driver for PLD Linux Operating Systems
+ *
+ * @category  System
+ * @package   System_Daemon
+ * @author    Elan Ruusamäe <[email protected]>
+ * @license   http://www.opensource.org/licenses/bsd-license.php New BSD 
Licence
+ * @version   SVN: Release: $Id$
+ * @link      http://trac.plutonia.nl/projects/system_daemon
+ * *
+ */
+class System_Daemon_OS_PLD extends System_Daemon_OS_Linux
+{
+    /**
+     * On Linux, a distro-specific version file is often telling us enough
+     *
+     * @var string
+     */
+    protected $_osVersionFile = "/etc/pld-release";
+
+    /**
+     * Path of init.d scripts
+     *
+     * @var string
+     */
+    protected $_autoRunDir = '/etc/rc.d/init.d';
+
+    /**
+     * Template path
+     *
+     * @var string
+     */
+    protected $_autoRunTemplatePath = '#datadir#/template_PLD';
+
+    /**
+     * Replace the following keys with values to convert a template into
+     * a read autorun script
+     *
+     * @var array
+     */
+    protected $_autoRunTemplateReplace = array(
+        "@author_name@"  => "{PROPERTIES.authorName}",
+        "@author_email@" => "{PROPERTIES.authorEmail}",
+        '@name@'         => '{PROPERTIES.appName}',
+        '@desc@'         => '{PROPERTIES.appDescription}',
+        '@bin_file@'     => '{PROPERTIES.appDir}/{PROPERTIES.appExecutable}',
+        '@bin_name@'     => '{PROPERTIES.appExecutable}',
+        '@pid_file@'     => '{PROPERTIES.appPidLocation}',
+        '@chkconfig@'    => '{PROPERTIES.appChkConfig}',
+    );
+
+}

================================================================
Index: packages/php-pear-System_Daemon/template_PLD.sh
diff -u /dev/null packages/php-pear-System_Daemon/template_PLD.sh:1.1
--- /dev/null   Sat Aug 21 12:36:34 2010
+++ packages/php-pear-System_Daemon/template_PLD.sh     Sat Aug 21 12:36:29 2010
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# chkconfig:   @chkconfig@
+#
+# description: @desc@
+#
+# processname: @name@
+# config:
+# pidfile: @pid_file@
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; 
then
+               msg_network_down "@name@"
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/@name@ ] && . /etc/sysconfig/@name@
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/@name@ ]; then
+               msg_already_running "@name@"
+               return
+       fi
+
+       msg_starting "@name@"
+       daemon @bin_file@
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/@name@
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/@name@ ]; then
+               msg_not_running "@name@"
+               return
+       fi
+
+       # Stop daemons.
+       msg_stopping "@name@"
+       killproc --pidfile @pid_file@ @bin_name@ -TERM
+       rm -f /var/lock/subsys/@name@
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/@name@ ]; then
+               msg_not_running "@name@"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       status --pidfile @pid_file@ @name@ @bin_name@
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 
{start|stop|restart|try-restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pear-System_Daemon/php-pear-System_Daemon.spec?r1=1.9&r2=1.10&f=u

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

Reply via email to