]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Add metadata for rpm packages
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 13 Nov 2014 22:37:33 +0000 (23:37 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 13 Nov 2014 22:37:33 +0000 (23:37 +0100)
gui/baculum/examples/rpm/baculum.lighttpd.conf [new file with mode: 0644]
gui/baculum/examples/rpm/baculum.spec [new file with mode: 0644]
gui/baculum/examples/rpm/baculum.startup [new file with mode: 0644]
gui/baculum/examples/rpm/baculum.users [new file with mode: 0644]

diff --git a/gui/baculum/examples/rpm/baculum.lighttpd.conf b/gui/baculum/examples/rpm/baculum.lighttpd.conf
new file mode 100644 (file)
index 0000000..8829462
--- /dev/null
@@ -0,0 +1,53 @@
+# Baculum WebGUI tool for Bacula Community
+#
+# Web Server Configuration
+#
+
+server.port           = 9095
+server.username       = "lighttpd"
+server.groupname      = "lighttpd"
+server.document-root  = "/var/www/baculum"
+server.errorlog       = "/var/www/baculum/protected/logs/baculum-error.log"
+accesslog.filename    = "/var/www/baculum/protected/logs/baculum-access.log"
+server.pid-file       = "/var/run/baculum.pid"
+
+server.modules = (
+        "mod_auth",
+        "mod_rewrite",
+        "mod_fastcgi",
+        "mod_accesslog"
+)
+
+auth.backend          = "plain" 
+auth.backend.plain.userfile = "/var/www/baculum/protected/Data/baculum.users"
+auth.require = ( "/" => (
+        "method" => "basic",
+        "realm" => "Baculum Auth",
+        "require" => "valid-user"
+))
+
+index-file.names      = ( "index.php" )
+
+static-file.exclude-extensions = ( ".php" )
+
+dir-listing.encoding  = "utf-8"
+
+mimetype.assign = (
+   ".html" => "text/html",
+   ".gif" => "image/gif",
+   ".png" => "image/png",
+   ".ico" => "image/x-icon",
+   ".css" => "text/css",
+   ".js" => "application/javascript",
+)
+
+fastcgi.server = (".php"=>((
+  "bin-path"=>"/usr/bin/php-cgi",
+  "socket"=>"/tmp/php.socket"
+)))
+
+url.rewrite-once = (
+   "^/themes/(.+)$" => "/themes/$1",
+   "^/assets/(.+)$" => "/assets/$1",
+   "^/(.+)$" => "/index.php/$1"
+)
diff --git a/gui/baculum/examples/rpm/baculum.spec b/gui/baculum/examples/rpm/baculum.spec
new file mode 100644 (file)
index 0000000..c0a3c48
--- /dev/null
@@ -0,0 +1,57 @@
+Summary:       Baculum WebGUI tool for Bacula Community program
+Name:          bacula-gui
+Version:       7.0.5
+Release:       1%{?dist}
+License:       AGPLv3
+Group:         Applications/Internet
+Source:                %{name}-%{version}.tar.gz
+URL:           http://bacula.org
+BuildRequires: lighttpd
+BuildRequires: lighttpd-fastcgi
+BuildRequires: php
+BuildRequires: php-bcmath
+BuildRequires: php-common
+BuildRequires: php-mbstring
+BuildRequires: php-mysqlnd
+BuildRequires: php-pdo
+BuildRequires: php-pgsql
+BuildRequires: php-xml
+Requires(post):        chkconfig
+Requires(preun):chkconfig
+
+%description
+The Baculum program allows the user to administrate and manage Bacula work.
+By using Baculum is possible to execute backup/restore operations, monitor
+current Bacula jobs, media management and others. Baculum has integrated web
+console that communicates with Bacula bconsole program.
+
+%prep
+%autosetup
+
+%build
+
+%files
+%defattr(-,lighttpd,lighttpd)
+%attr(-,lighttpd,lighttpd) /var/www/baculum
+%attr(-,root,root) /etc/baculum
+%attr(755,root,root) /etc/rc.d/init.d/baculum
+
+%install
+mkdir -p %{buildroot}/var/www/baculum
+mkdir -p %{buildroot}/etc/baculum
+mkdir -p %{buildroot}/etc/rc.d/init.d
+
+cp -ra baculum %{buildroot}/var/www/
+install -m 750 baculum/examples/rpm/baculum.lighttpd.conf %{buildroot}/etc/baculum/
+install -m 755 baculum/examples/rpm/baculum.startup %{buildroot}/etc/rc.d/init.d/baculum
+install -m 600 baculum/examples/rpm/baculum.users %{buildroot}/var/www/baculum/protected/Data/
+
+%post
+/sbin/chkconfig --add /etc/rc.d/init.d/baculum
+
+%preun
+if [ $1 -eq 0 ] ; then
+    /sbin/service baculum stop
+    /sbin/chkconfig --del baculum
+fi
+
diff --git a/gui/baculum/examples/rpm/baculum.startup b/gui/baculum/examples/rpm/baculum.startup
new file mode 100644 (file)
index 0000000..abbd3fc
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          baculum
+# Required-Start:    $local_fs $remote_fs $network $syslog $named
+# Required-Stop:     $local_fs $remote_fs $network $syslog $named
+# Default-Start:     2 3 4 5
+# 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"
+NAME=baculum
+SCRIPTNAME=/etc/init.d/$NAME
+DAEMON=/usr/sbin/lighttpd
+DAEMON_OPTS="-f /etc/baculum/baculum.lighttpd.conf"
+PIDFILE="/var/run/$NAME.pid"
+
+test -x $DAEMON || exit 0
+
+check_syntax()
+{
+    $DAEMON -t $DAEMON_OPTS > /dev/null || exit $?
+}
+
+log_daemon_msg()
+{
+    logger "$@"
+}
+
+log_end_msg()
+{
+    [ $1 -eq 0 ] && RES=OK
+    logger ${RES:=FAIL}
+}
+
+if test -f /lib/lsb/init-functions; then
+. /lib/lsb/init-functions
+fi
+
+. /etc/init.d/functions
+
+case "$1" in
+    start)
+        check_syntax
+        log_daemon_msg "Starting $DESC" $NAME
+        if ! ${DAEMON} $DAEMON_OPTS
+        then
+            log_end_msg 1
+        else
+            log_end_msg 0
+        fi
+        ;;
+    stop)
+        log_daemon_msg "Stopping $DESC" $NAME
+        if kill -TERM `<$PIDFILE`
+        then
+            rm -f $PIDFILE
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        ;;
+    restart)
+        check_syntax
+        $0 stop
+        $0 start
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0
\ No newline at end of file
diff --git a/gui/baculum/examples/rpm/baculum.users b/gui/baculum/examples/rpm/baculum.users
new file mode 100644 (file)
index 0000000..3663ae8
--- /dev/null
@@ -0,0 +1 @@
+admin:admin
\ No newline at end of file