summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/zoneminder/zoneminder.install
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-01-19 15:22:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-01-19 15:22:40 (GMT)
commiteaa1e24dfe16f3f5a3d12b194f977e971c8f4b4b (patch)
tree1039b920717da374ee67975622724f17f6fe89e1 /abs/core-testing/zoneminder/zoneminder.install
parente7d7822ab75eeb5b35fd7ee6d9a1cfc4e730272e (diff)
parent6f90626a0bf289be8f0497fd6b135c7ef831e0fd (diff)
downloadlinhes_pkgbuild-eaa1e24dfe16f3f5a3d12b194f977e971c8f4b4b.zip
linhes_pkgbuild-eaa1e24dfe16f3f5a3d12b194f977e971c8f4b4b.tar.gz
linhes_pkgbuild-eaa1e24dfe16f3f5a3d12b194f977e971c8f4b4b.tar.bz2
Merge branch 'HEAD' of ssh://jams@knoppmyth.net/mount/repository/LinHES-PKGBUILD.git
Diffstat (limited to 'abs/core-testing/zoneminder/zoneminder.install')
-rw-r--r--abs/core-testing/zoneminder/zoneminder.install93
1 files changed, 93 insertions, 0 deletions
diff --git a/abs/core-testing/zoneminder/zoneminder.install b/abs/core-testing/zoneminder/zoneminder.install
new file mode 100644
index 0000000..27ba60a
--- /dev/null
+++ b/abs/core-testing/zoneminder/zoneminder.install
@@ -0,0 +1,93 @@
+# zoneminder.install
+
+## arg 1: the new package version
+pre_install() {
+ echo
+}
+
+## arg 1: the new package version
+post_install() {
+chown nobody.nobody /home/httpd/html/zm/events
+chown nobody.nobody /home/httpd/html/zm/images
+chown nobody.nobody /home/httpd/html/zm/temp
+chown nobody.nobody /etc/zm.conf
+
+cat << EOF
+Note:
+==> Edit /etc/zm.conf to define a user and password for
+==> The zoneminder (zm) database
+==> To initialize the ZoneMinder database run (as root)
+==> /usr/lib/zm/bin/zminit
+
+EOF
+
+cat /etc/php/php.ini |grep "^extension=mysql.so" >/dev/null || cat << EOF
+==> You must edit /etc/php/php.ini and uncomment "extension=mysql.so"
+==> so php and MySQL can play together.
+
+EOF
+cat /etc/php/php.ini |grep "^short_open_tag = On" >/dev/null || cat << EOF
+==> You must edit /etc/php/php.ini and set short_open_tag = On
+==> or ZoneMinder will not work
+
+EOF
+
+
+cat /etc/php/php.ini |grep "^open_basedir.*/etc/" >/dev/null || cat << EOF
+==> You must edit /etc/php/php.ini and add to it open_basedir "/etc/" as such:
+==> open_basedir = /home/:/tmp/:/usr/share/pear/:/etc/
+==> Otherwise ZoneMinder will be unable to read /etc/zm.conf
+
+EOF
+
+cat /etc/httpd/conf/httpd.conf |grep "^LoadModule php" >/dev/null || cat << EOF
+Note:
+==> You must edit /etc/httpd/conf/httpd.conf and uncomment the line
+==> #LoadModule php5_module modules/libphp5.so
+
+EOF
+
+cat /etc/sysctl.conf |grep "kernel.shmall" >/dev/null || cat << EOF
+==> To raise the limit on shared memory for zoneminder
+==> add these lines to /etc/sysctl.conf
+==> kernel.shmall = 134217728
+==> kernel.shmmax = 134217728
+EOF
+
+
+[ -d /var/lib/zm ] || mkdir /var/lib/zm/
+touch /var/lib/zm/zm_backup.sql
+
+# 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
+
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+pre_upgrade() {
+ echo
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+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
+}
+## arg 1: the old package version
+pre_remove() {
+ echo
+}
+
+## arg 1: the old package version
+post_remove() {
+ echo
+}
+
+# vim:set ts=2 sw=2 et: