]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Tweak example rpm spec and startup files
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 20 Mar 2015 20:03:32 +0000 (21:03 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Fri, 20 Mar 2015 20:05:47 +0000 (21:05 +0100)
gui/baculum/examples/rpm/baculum.spec
gui/baculum/examples/rpm/baculum.startup [changed mode: 0644->0755]

index 17138e2512fb9c8ef00d550230c7ed79840855c0..220a2bdf67faf7c290bd6d97552809f29f0bf1d6 100644 (file)
@@ -1,6 +1,6 @@
 Summary:       Baculum WebGUI tool for Bacula Community program
 Name:          baculum
-Version:       7.0.20150315git
+Version:       7.0.20150317git
 Release:       1%{?dist}
 License:       AGPLv3
 Group:         Applications/Internet
@@ -8,7 +8,8 @@ Source:         %{name}-%{version}.tar.gz
 URL:           http://bacula.org
 Requires:      lighttpd
 Requires:      lighttpd-fastcgi
-Requires:      php
+Requires:      bacula-console
+Requires:      php >= 5.3.4
 Requires:      php-bcmath
 Requires:      php-common
 Requires:      php-mbstring
@@ -16,8 +17,9 @@ Requires:     php-mysqlnd
 Requires:      php-pdo
 Requires:      php-pgsql
 Requires:      php-xml
-Requires(post):        chkconfig
-Requires(preun):chkconfig
+Requires(post):        /sbin/chkconfig
+Requires(preun):/sbin/service, /sbin/chkconfig
+BuildArch: noarch
 
 %description
 The Baculum program allows the user to administrate and manage Bacula work.
@@ -35,24 +37,33 @@ console that communicates with Bacula bconsole program.
 %attr(-,lighttpd,lighttpd) /usr/share/baculum/htdocs
 %attr(-,lighttpd,lighttpd) /etc/baculum
 %attr(755,root,root) /etc/rc.d/init.d/baculum
+%config /etc/sysconfig/baculum
+
+%doc AUTHORS INSTALL README LICENSE
 
 %install
 mkdir -p %{buildroot}/usr/share/baculum/htdocs
 mkdir -p %{buildroot}/etc/baculum
+mkdir -p %{buildroot}/etc/sysconfig
 mkdir -p %{buildroot}/etc/rc.d/init.d
 
-cp -ra . %{buildroot}/usr/share/baculum/htdocs
+cp -ra assets framework protected themes index.php AUTHORS INSTALL LICENSE README index.php %{buildroot}/usr/share/baculum/htdocs
 install -m 640 examples/rpm/baculum.lighttpd.conf %{buildroot}/etc/baculum/
 install -m 600 examples/rpm/baculum.users %{buildroot}/etc/baculum/
 install -m 755 examples/rpm/baculum.startup %{buildroot}/etc/rc.d/init.d/baculum
+install -m 644 examples/rpm/baculum.sysconfig %{buildroot}/etc/sysconfig/baculum
 
 
 %post
-ln -s /etc/baculum/baculum.users /usr/share/baculum/htdocs/protected/Data/baculum.users
 /sbin/chkconfig --add /etc/rc.d/init.d/baculum
+[ -e /usr/share/baculum/htdocs/protected/Data/baculum.users ] || ln -s /etc/baculum/baculum.users /usr/share/baculum/htdocs/protected/Data/baculum.users
 
 %preun
 if [ $1 -eq 0 ] ; then
     /sbin/service baculum stop
     /sbin/chkconfig --del baculum
 fi
+
+%changelog
+ * Wed Mar 18 2015 Marcin Haba <marcin.haba@bacula.pl> - 7.0.20150317git
+ - Spec create
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index abbd3fc..a2bb4a9
@@ -1,4 +1,10 @@
 #!/bin/sh
+#
+# chkconfig: 2345 91 9
+# description: This script uses Lighttpd web server for \
+#              working Baculum WebGUI tool.
+#
+
 ### BEGIN INIT INFO
 # Provides:          baculum
 # Required-Start:    $local_fs $remote_fs $network $syslog $named
@@ -7,7 +13,6 @@
 # Default-Stop:      0 1 6
 # Short-Description: Start/stop Baculum
 # Description:       Start the Baculum WebGUI Bacula Community tool.
-#  This script uses Lighttpd web server for working Baculum WebGUI tool.
 ### END INIT INFO
 
 DESC="Baculum WebGUI Bacula Community tool"
@@ -15,7 +20,8 @@ NAME=baculum
 SCRIPTNAME=/etc/init.d/$NAME
 DAEMON=/usr/sbin/lighttpd
 DAEMON_OPTS="-f /etc/baculum/baculum.lighttpd.conf"
-PIDFILE="/var/run/$NAME.pid"
+PIDFILE=/var/run/$NAME.pid
+LOCKFILE=/var/lock/subsys/$NAME
 
 test -x $DAEMON || exit 0
 
@@ -35,6 +41,10 @@ log_end_msg()
     logger ${RES:=FAIL}
 }
 
+rh_status() {
+    status $prog
+}
+
 if test -f /lib/lsb/init-functions; then
 . /lib/lsb/init-functions
 fi
@@ -50,6 +60,7 @@ case "$1" in
             log_end_msg 1
         else
             log_end_msg 0
+            touch $LOCKFILE
         fi
         ;;
     stop)
@@ -57,18 +68,22 @@ case "$1" in
         if kill -TERM `<$PIDFILE`
         then
             rm -f $PIDFILE
+            rm -f $LOCKFILE
             log_end_msg 0
         else
             log_end_msg 1
         fi
         ;;
+    status)
+        rh_status
+        ;;
     restart)
         check_syntax
         $0 stop
         $0 start
         ;;
     *)
-        echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
+        echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
         exit 1
         ;;
 esac