From 4c2bbdfa9aec057c1815345a2790d58318f80165 Mon Sep 17 00:00:00 2001
From: Cecil Hugh Watson <knoppmyth@gmail.com>
Date: Sat, 5 Sep 2009 20:42:14 -0700
Subject: ZoneMinder:Further enhancements to run on LinHES.

---
 abs/core-testing/zoneminder/PKGBUILD           | 7 +++++--
 abs/core-testing/zoneminder/run                | 6 ++++++
 abs/core-testing/zoneminder/zoneminder.install | 4 +++-
 3 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100755 abs/core-testing/zoneminder/run

diff --git a/abs/core-testing/zoneminder/PKGBUILD b/abs/core-testing/zoneminder/PKGBUILD
index fdb0dbc..94a543a 100644
--- a/abs/core-testing/zoneminder/PKGBUILD
+++ b/abs/core-testing/zoneminder/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgname=zoneminder
 pkgver=1.23.3
-pkgrel=9
+pkgrel=10
 pkgdesc="Capture, analyse, record and monitor video security cameras."
 arch=('i686')
 url="http://www.zoneminder.com"
@@ -26,7 +26,8 @@ source=(http://www2.zoneminder.com/downloads/ZoneMinder-$pkgver.tar.gz \
 	customdb \
   mootools.v1.11.js \
   http://www.charliemouse.com:8080/code/cambozola/cambozola-0.50.tar.gz \
-  zmeventdump)
+  zmeventdump \
+  run)
 noextract=()
 md5sums=('ee803f0f71d6e67adf602c3557fb6bc9'
          'af8631abe20cd7dcab1a023af7d4f3e8'
@@ -84,6 +85,8 @@ build() {
     -o -name ".packlist"                \
     -o -name "*.bs"                     \
     |xargs -i rm -f {}
+    mkdir -p $pkgdir/etc/sv/zm
+    install -D -m 755 $srcdir/run $pkgdir/etc/sv/zm
 
 }
 
diff --git a/abs/core-testing/zoneminder/run b/abs/core-testing/zoneminder/run
new file mode 100755
index 0000000..e458bc8
--- /dev/null
+++ b/abs/core-testing/zoneminder/run
@@ -0,0 +1,6 @@
+#!/bin/bash
+export TERM=linux
+. /etc/rc.conf
+. /etc/rc.d/functions
+stat_runit "Starting ZoneMinder"
+exec /etc/rc.d/zm start
diff --git a/abs/core-testing/zoneminder/zoneminder.install b/abs/core-testing/zoneminder/zoneminder.install
index c2ae861..1f3cfc0 100644
--- a/abs/core-testing/zoneminder/zoneminder.install
+++ b/abs/core-testing/zoneminder/zoneminder.install
@@ -52,7 +52,8 @@ post_upgrade() {
   # Reuse the old config
 [ -f /etc/zm.conf.pacnew ] && cat /etc/zm.conf | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
 [ -f /etc/zm.conf.pacsave ] &&  cat /etc/zm.conf.pacsave | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
-[ -f /tmp/zm.conf ] && mv -f /tmp/zm.conf /etc/zm.conf && chown -R nobody.nobody /etc/zm.conf
+[ -f /tmp/zm.conf ] && mv -f /tmp/zm.conf /etc/zm.conf && chown -R http.http /etc/zm.conf
+add_service.sh zm
 }
 ## arg 1:  the old package version
 pre_remove() {
@@ -62,6 +63,7 @@ pre_remove() {
 ## arg 1:  the old package version
 post_remove() {
   echo
+  remove_service.sh zm
 }
 
 # vim:set ts=2 sw=2 et:
-- 
cgit v0.12