From 6f90626a0bf289be8f0497fd6b135c7ef831e0fd Mon Sep 17 00:00:00 2001 From: Cecil Hugh Watson Date: Mon, 19 Jan 2009 00:00:36 -0800 Subject: MythZoneMinder, ZoneMinder and deps. --- .../mythtv/stable/mythzoneminder/PKGBUILD | 32 ++++ .../perl_modules/perl-astro-suntime/PKGBUILD | 29 ++++ .../perl_modules/perl-device-serialport/PKGBUILD | 29 ++++ .../perl_modules/perl-php-serialization/PKGBUILD | 30 ++++ .../perl_modules/perl-test-pod/PKGBUILD | 25 +++ .../perl_modules/perl-time-modules/PKGBUILD | 25 +++ .../perl_modules/perl-unicode-map/PKGBUILD | 30 ++++ abs/core-testing/perl_modules/perl-x10/PKGBUILD | 30 ++++ abs/core-testing/zoneminder/Makefile.patch | 13 ++ abs/core-testing/zoneminder/PKGBUILD | 90 +++++++++++ abs/core-testing/zoneminder/customdb | 31 ++++ abs/core-testing/zoneminder/mootools.v1.11.js | 3 + abs/core-testing/zoneminder/zm.conf.patch | 20 +++ abs/core-testing/zoneminder/zm.rc.d | 172 +++++++++++++++++++++ abs/core-testing/zoneminder/zmeventdump | 48 ++++++ abs/core-testing/zoneminder/zminit.arch | 143 +++++++++++++++++ abs/core-testing/zoneminder/zmupdate.patch | 11 ++ abs/core-testing/zoneminder/zoneminder.install | 93 +++++++++++ 18 files changed, 854 insertions(+) create mode 100644 abs/core-testing/mythtv/stable/mythzoneminder/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-astro-suntime/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-device-serialport/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-php-serialization/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-test-pod/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-time-modules/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-unicode-map/PKGBUILD create mode 100644 abs/core-testing/perl_modules/perl-x10/PKGBUILD create mode 100644 abs/core-testing/zoneminder/Makefile.patch create mode 100644 abs/core-testing/zoneminder/PKGBUILD create mode 100755 abs/core-testing/zoneminder/customdb create mode 100644 abs/core-testing/zoneminder/mootools.v1.11.js create mode 100644 abs/core-testing/zoneminder/zm.conf.patch create mode 100644 abs/core-testing/zoneminder/zm.rc.d create mode 100755 abs/core-testing/zoneminder/zmeventdump create mode 100644 abs/core-testing/zoneminder/zminit.arch create mode 100644 abs/core-testing/zoneminder/zmupdate.patch create mode 100644 abs/core-testing/zoneminder/zoneminder.install diff --git a/abs/core-testing/mythtv/stable/mythzoneminder/PKGBUILD b/abs/core-testing/mythtv/stable/mythzoneminder/PKGBUILD new file mode 100644 index 0000000..4e61cfb --- /dev/null +++ b/abs/core-testing/mythtv/stable/mythzoneminder/PKGBUILD @@ -0,0 +1,32 @@ +# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $ +# Maintainer: Juergen Hoetzel +# Contributor: kleptophobiac@gmail.com + +pkgname=mythzoneminder +pkgver=0.21 +pkgrel=1 +pkgdesc="Weather checking plugin for MythTV" +arch=('i686' 'x86_64') +url="http://www.mythtv.org" +license=('GPL') +depends=("mythtv>=${pkgver}" 'zoneminder=1.23.3') +source=("ftp://ftp.knoppmyth.net/R6/sources/mythplugins-$pkgver-fixes.tar.bz2") +md5sums=('00ee70be781b9af5913f046525d79ab9') +groups=('mythtv-extras') + +build() { + cd $startdir/src/mythplugins + . /etc/profile.d/qt3.sh + + # use QT3 qmake + export PATH=$QTDIR/bin:$PATH + + ./configure --prefix=/usr --enable-opengl --disable-all --enable-mythzoneminder --zm-version=1.23.3 + + qmake mythplugins.pro + make qmake || return 1 + make -j 2 || return 1 + + make INSTALL_ROOT=$startdir/pkg install +} + diff --git a/abs/core-testing/perl_modules/perl-astro-suntime/PKGBUILD b/abs/core-testing/perl_modules/perl-astro-suntime/PKGBUILD new file mode 100644 index 0000000..d615aa3 --- /dev/null +++ b/abs/core-testing/perl_modules/perl-astro-suntime/PKGBUILD @@ -0,0 +1,29 @@ +# This PKGBUILD was generated by cpan4pacman via CPANPLUS::Dist::Pacman +# Contributor: Ross melin + +# Required by zoneminder + +pkgname=perl-astro-suntime +pkgver=0.01 +pkgrel=2 +pkgdesc="Calculate sun rise/set times" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~ROBF/Astro-SunTime" +license=('GPL' 'PerlArtistic') +depends=('perl-time-modules') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/R/RO/ROBF/Astro-SunTime-$pkgver.tar.gz) +md5sums=('4657927a49604494bfaaa153663b90b9') + +build() { + cd $startdir/src/Astro-SunTime-$pkgver + eval `perl -V:archname` + PERL_MM_USE_DEFAULT=1 /usr/bin/perl Makefile.PL \ + INSTALLDIRS=vendor || return 1 + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install || return 1 + /usr/bin/find $startdir/pkg -name '.packlist' -delete + /usr/bin/find $startdir/pkg -name '*.pod' -delete +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/perl_modules/perl-device-serialport/PKGBUILD b/abs/core-testing/perl_modules/perl-device-serialport/PKGBUILD new file mode 100644 index 0000000..d1341c8 --- /dev/null +++ b/abs/core-testing/perl_modules/perl-device-serialport/PKGBUILD @@ -0,0 +1,29 @@ +# This PKGBUILD was generated by cpan4pacman via CPANPLUS::Dist::Pacman +# Contributor: Ross melin + +# Required by zoneminder + +pkgname=perl-device-serialport +pkgver=1.04 +pkgrel=2 +pkgdesc="POSIX clone of Win32::SerialPort" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~COOK/Device-SerialPort" +license=('GPL' 'PerlArtistic') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/C/CO/COOK/Device-SerialPort-$pkgver.tar.gz) +md5sums=('82c698151f934eb28c65d1838cee7d9e') + +build() { + cd $startdir/src/Device-SerialPort-$pkgver + eval `perl -V:archname` + PERL_MM_USE_DEFAULT=1 /usr/bin/perl Makefile.PL \ + INSTALLDIRS=vendor || return 1 + + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install || return 1 + /usr/bin/find $startdir/pkg -name '.packlist' -delete + /usr/bin/find $startdir/pkg -name '*.pod' -delete +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/perl_modules/perl-php-serialization/PKGBUILD b/abs/core-testing/perl_modules/perl-php-serialization/PKGBUILD new file mode 100644 index 0000000..428ee8e --- /dev/null +++ b/abs/core-testing/perl_modules/perl-php-serialization/PKGBUILD @@ -0,0 +1,30 @@ +# This PKGBUILD was generated by cpan4pacman via CPANPLUS::Dist::Pacman +# Contributor: Ross melin + +# Required by zoneminder + +pkgname=perl-php-serialization +pkgver=0.27 +pkgrel=2 +pkgdesc="PHP::Serialization" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~php-serialization/PHP-Serialization" +license=('GPL' 'PerlArtistic') +depends=('perl') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/J/JB/JBROWN/php-serialization/PHP-Serialization-$pkgver.tar.gz) +md5sums=('2fb3f63071c5c2119b4eebe39b329684') + +build() { + cd $startdir/src/PHP-Serialization-$pkgver + eval `perl -V:archname` + PERL_MM_USE_DEFAULT=1 /usr/bin/perl Makefile.PL \ + INSTALLDIRS=vendor || return 1 + + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install || return 1 + /usr/bin/find $startdir/pkg -name '.packlist' -delete + /usr/bin/find $startdir/pkg -name '*.pod' -delete +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/perl_modules/perl-test-pod/PKGBUILD b/abs/core-testing/perl_modules/perl-test-pod/PKGBUILD new file mode 100644 index 0000000..a901b02 --- /dev/null +++ b/abs/core-testing/perl_modules/perl-test-pod/PKGBUILD @@ -0,0 +1,25 @@ +# +# Contributor: Oliver Charles +# + +pkgname="perl-test-pod" +pkgver=1.26 +pkgrel=1 +pkgdesc="Translate Wiki formatted text to other formats" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~petdance/Test-Pod" +license="unknown" +depends=('perl>=5.10.0') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/P/PE/PETDANCE/Test-Pod-$pkgver.tar.gz) +md5sums=('2f259135656ac4549b65a4f14f07b7c6') + +build() { + cd $startdir/src/Test-Pod-$pkgver + PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1 + make || return 1 + make DESTDIR="$pkgdir/" install || return 1 + + find "$pkgdir" -name '.packlist' -delete + find "$pkgdir" -name 'perllocal.pod' -delete +} diff --git a/abs/core-testing/perl_modules/perl-time-modules/PKGBUILD b/abs/core-testing/perl_modules/perl-time-modules/PKGBUILD new file mode 100644 index 0000000..6911ebc --- /dev/null +++ b/abs/core-testing/perl_modules/perl-time-modules/PKGBUILD @@ -0,0 +1,25 @@ +# Contributor: Your Name +pkgname=perl-time-modules +pkgver=2006.0814 +pkgrel=1 +pkgdesc="Parses Date strings" +url="http://search.cpan.org/~muir/Time-modules-$pkgver/" +depends=(perl) +license="GPL" +options=('!emptydirs') +arch=('i686') +source=(http://search.cpan.org/CPAN/authors/id/M/MU/MUIR/modules/Time-modules-$pkgver.tar.gz) +md5sums=('790c6739f601b85654fac9ee516b18d8') + +build() { + cd $startdir/src/Time-modules-$pkgver + eval `perl -V:archname` + /usr/bin/perl Makefile.PL \ + INSTALLARCHLIB=/usr/lib/perl5/current/${archname} \ + INSTALLSITELIB=/usr/lib/perl5/site_perl/current \ + INSTALLSITEARCH=/usr/lib/perl5/site_perl/current/${archname} + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install + /usr/bin/find $startdir/pkg -name '.packlist' -exec rm '{}' \; + /usr/bin/find $startdir/pkg -name '*.pod' -exec rm '{}' \; +} diff --git a/abs/core-testing/perl_modules/perl-unicode-map/PKGBUILD b/abs/core-testing/perl_modules/perl-unicode-map/PKGBUILD new file mode 100644 index 0000000..1d03e86 --- /dev/null +++ b/abs/core-testing/perl_modules/perl-unicode-map/PKGBUILD @@ -0,0 +1,30 @@ +# This PKGBUILD was generated by cpan4pacman via CPANPLUS::Dist::Pacman +# Contributor: Ross melin + +# Required by zoneminder + +pkgname=perl-unicode-map +pkgver=0.112 +pkgrel=2 +pkgdesc="Unicode::Map" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~MSCHWARTZ/Unicode-Map" +license=('GPL' 'PerlArtistic') +depends=('perl') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/M/MS/MSCHWARTZ/Unicode-Map-$pkgver.tar.gz) +md5sums=('edaa8fc5ddf0e5d805e274283dd0625d') + +build() { + cd $startdir/src/Unicode-Map-$pkgver + eval `perl -V:archname` + PERL_MM_USE_DEFAULT=1 /usr/bin/perl Makefile.PL \ + INSTALLDIRS=vendor || return 1 + + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install || return 1 + /usr/bin/find $startdir/pkg -name '.packlist' -delete + /usr/bin/find $startdir/pkg -name '*.pod' -delete +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/perl_modules/perl-x10/PKGBUILD b/abs/core-testing/perl_modules/perl-x10/PKGBUILD new file mode 100644 index 0000000..51283d5 --- /dev/null +++ b/abs/core-testing/perl_modules/perl-x10/PKGBUILD @@ -0,0 +1,30 @@ +# This PKGBUILD was generated by cpan4pacman via CPANPLUS::Dist::Pacman +# Contributor: Ross melin + +# Required by zoneminder + +pkgname=perl-x10 +pkgver=0.03 +pkgrel=2 +pkgdesc="X10" +arch=('i686' 'x86_64') +url="http://search.cpan.org/~ROBF/X10" +license=('GPL' 'PerlArtistic') +depends=('perl-astro-suntime>=0.01' 'perl-device-serialport' 'perl-time-modules') +options=('!emptydirs') +source=(http://www.cpan.org/authors/id/R/RO/ROBF/X10-$pkgver.tar.gz) +md5sums=('056b3d98fab545865148b948de6784c7') + +build() { + cd $startdir/src/X10-$pkgver + eval `perl -V:archname` + PERL_MM_USE_DEFAULT=1 /usr/bin/perl Makefile.PL \ + INSTALLDIRS=vendor || return 1 + + /usr/bin/make || return 1 + /usr/bin/make DESTDIR=$startdir/pkg install || return 1 + /usr/bin/find $startdir/pkg -name '.packlist' -delete + /usr/bin/find $startdir/pkg -name '*.pod' -delete +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/zoneminder/Makefile.patch b/abs/core-testing/zoneminder/Makefile.patch new file mode 100644 index 0000000..d033e72 --- /dev/null +++ b/abs/core-testing/zoneminder/Makefile.patch @@ -0,0 +1,13 @@ +--- ZoneMinder-1.23.3.orig/Makefile 2008-03-13 17:41:47.000000000 -0700 ++++ ZoneMinder-1.23.3/Makefile 2008-03-15 06:21:22.000000000 -0700 +@@ -687,8 +687,8 @@ + # Yes, you are correct. This is a HACK! + install-data-hook: + ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) ) +- -( if ! test -e $(RUNDIR); then mkdir $(RUNDIR); fi ) +- ( if ! test -e $(ZM_RUNDIR); then mkdir $(ZM_RUNDIR); fi; chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR) ) ++ -( if ! test -e$(DESTDIR)$(RUNDIR); then mkdir -p $(DESTDIR)$(RUNDIR); fi ) ++ ( if ! test -e $(DESTDIR)$(ZM_RUNDIR); then mkdir -p $(DESTDIR)$(ZM_RUNDIR); fi; chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_RUNDIR); chmod u+w $(DESTDIR)$(ZM_RUNDIR) ) + + uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp ) diff --git a/abs/core-testing/zoneminder/PKGBUILD b/abs/core-testing/zoneminder/PKGBUILD new file mode 100644 index 0000000..bdd1669 --- /dev/null +++ b/abs/core-testing/zoneminder/PKGBUILD @@ -0,0 +1,90 @@ +# This is a ZoneMinder PKGBUILD file. +# Contributor: Ross melin + +pkgname=zoneminder +pkgver=1.23.3 +pkgrel=4 +pkgdesc="Capture, analyse, record and monitor video security cameras." +arch=('i686') +url="http://www.zoneminder.com" +license=('GPL') +groups=() +depends=('lighttpd' 'php' 'mysql' 'pcre' 'gnutls' 'ffmpeg' 'perl-php-serialization' 'perl-libwww' 'perl-date-manip' 'perl-unicode-map' 'perl-dbi' 'perl-dbd-mysql' 'perl-io-stringy' 'perl-mime-lite' 'perl-timedate' 'perl-x10' 'perl-time-modules') +makedepends=() +provides=(zoneminder) +conflicts=() +replaces=() +backup=(etc/zm.conf) +options=() +install=zoneminder.install +source=(http://www2.zoneminder.com/downloads/ZoneMinder-$pkgver.tar.gz \ + zm.rc.d \ + zm.conf.patch \ + zmupdate.patch \ + Makefile.patch \ + zminit.arch \ + customdb \ + mootools.v1.11.js \ + http://www.charliemouse.com:8080/code/cambozola/cambozola-0.50.tar.gz \ + zmeventdump) +noextract=() +md5sums=('ee803f0f71d6e67adf602c3557fb6bc9' + 'af8631abe20cd7dcab1a023af7d4f3e8' + '246852035905589617b9e0dc63759d27' + '0e91bbfddbed78ffe1c968d11af49ccb' + '818cec2eba7e1efb3f5c410f6dd8d528' + 'f9720872736f26d17bc49d8725b75ae4' + 'f0c4b80b3c2f1e0fe90d7b52191b7e51' + '0df5bf23f9b09f0cae2e7f0a9e0ef16e' + 'daded58688e16ab513920a54a0599267' + '3046d91dde4a753867c62aba985c647e') + +build() { + cd "$srcdir/ZoneMinder-$pkgver" + + patch -p1 < $startdir/src/zm.conf.patch + patch -p1 < $startdir/src/zmupdate.patch + + sed -i 's|||' $srcdir/ZoneMinder-$pkgver/src/zm_mpeg.h + sed -i 's|||' $srcdir/ZoneMinder-$pkgver/src/zm_mpeg.h + sed -i 's|--- Created by|-- Created by|' $srcdir/ZoneMinder-$pkgver/scripts/zmdbbackup.in + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-webuser=nobody \ + --with-webgroup=nobody \ + --with-mysql=/usr \ + --with-webdir=/home/httpd/html/zm \ + --with-cgidir=/home/httpd/cgi-bin \ + --bindir=/usr/lib/zm/bin + + patch -p1 < $startdir/src/Makefile.patch + make || return 1 + make DESTDIR="$pkgdir" install || return 1 + + install -D -m 700 $startdir/src/zminit.arch $startdir/pkg/usr/lib/zm/bin/zminit + install -D -m 700 $startdir/src/zm.rc.d $startdir/pkg/etc/rc.d/zm + install -D -m 700 scripts/zmdbbackup $startdir/pkg/usr/lib/zm/bin/zmdbbackup + install -D -m 700 scripts/zmdbbackup $startdir/pkg/usr/lib/zm/bin/zmdbbackup + install -D -m 700 scripts/zmdbrestore $startdir/pkg/usr/lib/zm/bin/zmdbrestore + install -D -m 700 scripts/zmlogrotate.conf $startdir/pkg/etc/logrotate.d/zm + install -D -m 700 $startdir/src/zmeventdump $startdir/pkg/etc/cron.hourly/zmeventdump + + tar -zxf $startdir/src/cambozola-0.50.tar.gz + install -m 644 cambozola-0.50/dist/cambozola.jar $startdir/pkg/home/httpd/html/zm/cambozola.jar + + install $startdir/src/mootools.v1.11.js $startdir/pkg/home/httpd/html/zm/mootools.js + install -D -m 700 $startdir/src/customdb $startdir/pkg/usr/lib/zm/upgrade/customdb + install -D db/zm*.sql $startdir/pkg/usr/lib/zm/upgrade/ + + mkdir -p $startdir/pkg/var/run/zm + + ### remove special files + find $startdir/pkg/ -name "perllocal.pod" \ + -o -name ".packlist" \ + -o -name "*.bs" \ + |xargs -i rm -f {} + +} + +# vim:set ts=2 sw=2 et: diff --git a/abs/core-testing/zoneminder/customdb b/abs/core-testing/zoneminder/customdb new file mode 100755 index 0000000..93ce7fe --- /dev/null +++ b/abs/core-testing/zoneminder/customdb @@ -0,0 +1,31 @@ +#!/bin/sh +DBHOST=$1 +DBNAME=$2 +USERNAME=$3 +PASSWORD=$4 + +ZM_PATH_ZMS=/cgi-bin/nph-zms +ZM_PATH_SOCKS=/var/lib/zm +ZM_PATH_LOGS=/var/log/zm +ZM_WEB_LIST_THUMBS=1 +ZM_WEB_MONTAGE_WIDTH=320 +ZM_WEB_MONTAGE_HEIGHT=240 +ZM_OPT_CAMBOZOLA=1 +ZM_OPT_MPEG=ffmpeg +ZM_PATH_FFMPEG=/usr/bin/ffmpeg +ZM_OPT_NETPBM=1 +ZM_EXTRA_DEBUG_LOG=/var/log/zm/zm_debug.log+ +ZM_OPT_USE_AUTH=0 + +sql=/tmp/$$ +echo "" >$sql +for n in ZM_PATH_ZMS ZM_PATH_SOCKS ZM_PATH_LOGS ZM_WEB_LIST_THUMBS ZM_WEB_MONTAGE_WIDTH ZM_WEB_MONTAGE_HEIGHT ZM_OPT_CAMBOZOLA ZM_OPT_MPEG ZM_PATH_FFMPEG ZM_OPT_NETPBM ZM_EXTRA_DEBUG_LOG ZM_OPT_USE_AUTH; do + eval "val=\$$n" + echo "UPDATE Config SET Value='$val' WHERE Name='$n';" >>$sql +done + +cat $sql | mysql --user=$USERNAME --password=$PASSWORD --host=$DBHOST $DBNAME +rm -f $sql + + +exit 0 diff --git a/abs/core-testing/zoneminder/mootools.v1.11.js b/abs/core-testing/zoneminder/mootools.v1.11.js new file mode 100644 index 0000000..154284c --- /dev/null +++ b/abs/core-testing/zoneminder/mootools.v1.11.js @@ -0,0 +1,3 @@ +//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, , MIT Style License. + +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o ci={cj:\'1.11\'};k $77(N){m(N!=9N)};k $F(N){B(!$77(N))m O;B(N.5i)m\'G\';o F=7c N;B(F==\'2I\'&&N.ch){22(N.84){Y 1:m\'G\';Y 3:m(/\\S/).2v(N.ax)?\'cg\':\'cd\'}}B(F==\'2I\'||F==\'k\'){22(N.9C){Y 2t:m\'1z\';Y 7y:m\'5C\';Y 18:m\'4R\'}B(7c N.V==\'4M\'){B(N.3r)m\'ce\';B(N.8t)m\'1b\'}}m F};k $2a(){o 54={};M(o i=0;i<1b.V;i++){M(o K 1a 1b[i]){o ap=1b[i][K];o 6d=54[K];B(6d&&$F(ap)==\'2I\'&&$F(6d)==\'2I\')54[K]=$2a(6d,ap);14 54[K]=ap}}m 54};o $R=k(){o 1p=1b;B(!1p[1])1p=[c,1p[0]];M(o K 1a 1p[1])1p[0][K]=1p[1][K];m 1p[0]};o $5e=k(){M(o i=0,l=1b.V;i-1:c.3k(2z)>-1},b5:k(){m c.3g(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});2t.R({5E:k(1z){B(c.V<3)m O;B(c.V==4&&c[3]==0&&!1z)m\'c2\';o 3C=[];M(o i=0;i<3;i++){o 5d=(c[i]-0).4l(16);3C.1k((5d.V==1)?\'0\'+5d:5d)}m 1z?3C:\'#\'+3C.2c(\'\')},5G:k(1z){B(c.V!=3)m O;o 1s=[];M(o i=0;i<3;i++){1s.1k(5O((c[i].V==1)?c[i]+c[i]:c[i],16))}m 1z?1s:\'1s(\'+1s.2c(\',\')+\')\'}});7Z.R({3a:k(C){o fn=c;C=$2a({\'W\':fn,\'I\':O,\'1b\':1n,\'2g\':O,\'4f\':O,\'6f\':O},C);B($2A(C.1b)&&$F(C.1b)!=\'1z\')C.1b=[C.1b];m k(I){o 1p;B(C.I){I=I||U.I;1p=[(C.I===1e)?I:L C.I(I)];B(C.1b)1p.R(C.1b)}14 1p=C.1b||1b;o 3N=k(){m fn.4j($4T(C.W,fn),1p)};B(C.2g)m 9M(3N,C.2g);B(C.4f)m c3(3N,C.4f);B(C.6f)5j{m 3N()}5c(c9){m O};m 3N()}},bT:k(1p,W){m c.3a({\'1b\':1p,\'W\':W})},6f:k(1p,W){m c.3a({\'1b\':1p,\'W\':W,\'6f\':1e})()},W:k(W,1p){m c.3a({\'W\':W,\'1b\':1p})},c8:k(W,1p){m c.3a({\'W\':W,\'I\':1e,\'1b\':1p})},2g:k(2g,W,1p){m c.3a({\'2g\':2g,\'W\':W,\'1b\':1p})()},4f:k(aV,W,1p){m c.3a({\'4f\':aV,\'W\':W,\'1b\':1p})()}});aN.R({3d:k(){m 5O(c)},aH:k(){m 66(c)},1F:k(3s,1D){m 1c.3s(1D,1c.1D(3s,c))},2q:k(5Y){5Y=1c.3w(10,5Y||0);m 1c.2q(c*5Y)/5Y},c7:k(fn){M(o i=0;i\'}el=Q.aJ(el)}el=$(el);m(!1U||!el)?el:el.2j(1U)}});o 26=L 18({1i:k(T){m(T)?$R(T,c):c}});26.R=k(1U){M(o 1V 1a 1U){c.1L[1V]=1U[1V];c[1V]=$5e.6x(1V)}};k $(el){B(!el)m 1n;B(el.5i)m 2F.52(el);B([U,Q].1j(el))m el;o F=$F(el);B(F==\'2z\'){el=Q.6W(el);F=(el)?\'G\':O}B(F!=\'G\')m 1n;B(el.5i)m 2F.52(el);B([\'2I\',\'c4\'].1j(el.6S.5L()))m el;$R(el,P.1L);el.5i=k(){};m 2F.52(el)};Q.6Y=Q.33;k $$(){o T=[];M(o i=0,j=1b.V;i0&&6Q<13)c.1t=\'f\'+6Q}c.1t=c.1t||6i.bA(c.6O).5L()}14 B(c.F.2v(/(6h|3m|bw)/)){c.1Y={\'x\':I.8E||I.9f+Q.2Z.5V,\'y\':I.8w||I.at+Q.2Z.63};c.9B={\'x\':I.8E?I.8E-U.99:I.9f,\'y\':I.8w?I.8w-U.9i:I.at};c.bR=(I.9K==3)||(I.bv==2);22(c.F){Y\'90\':c.2o=I.2o||I.ca;1C;Y\'8Y\':c.2o=I.2o||I.8A}c.aU()}m c},1R:k(){m c.6U().6X()},6U:k(){B(c.I.6U)c.I.6U();14 c.I.db=1e;m c},6X:k(){B(c.I.6X)c.I.6X();14 c.I.eK=O;m c}});2X.6m={2o:k(){B(c.2o&&c.2o.84==3)c.2o=c.2o.3n},aD:k(){5j{2X.6m.2o.1X(c)}5c(e){c.2o=c.3v}}};2X.1L.aU=(U.8r)?2X.6m.aD:2X.6m.2o;2X.1O=L 3M({\'eL\':13,\'6P\':38,\'eJ\':40,\'1u\':37,\'4n\':39,\'eI\':27,\'eF\':32,\'eG\':8,\'eH\':9,\'57\':46});P.2H.2p={1B:k(F,fn){c.$19=c.$19||{};c.$19[F]=c.$19[F]||{\'1O\':[],\'1I\':[]};B(c.$19[F].1O.1j(fn))m c;c.$19[F].1O.1k(fn);o 76=F;o 2w=P.2p[F];B(2w){B(2w.7F)2w.7F.1X(c,fn);B(2w.2D)fn=2w.2D;B(2w.F)76=2w.F}B(!c.8j)fn=fn.3a({\'W\':c,\'I\':1e});c.$19[F].1I.1k(fn);m(P.8V.1j(76))?c.2C(76,fn):c},4C:k(F,fn){B(!c.$19||!c.$19[F])m c;o 1m=c.$19[F].1O.3k(fn);B(1m==-1)m c;o 1t=c.$19[F].1O.74(1m,1)[0];o J=c.$19[F].1I.74(1m,1)[0];o 2w=P.2p[F];B(2w){B(2w.2K)2w.2K.1X(c,fn);B(2w.F)F=2w.F}m(P.8V.1j(F))?c.3h(F,J):c},6j:k(1Z){m P.72(c,\'1B\',1Z)},78:k(F){B(!c.$19)m c;B(!F){M(o 6g 1a c.$19)c.78(6g);c.$19=1n}14 B(c.$19[F]){c.$19[F].1O.1q(k(fn){c.4C(F,fn)},c);c.$19[F]=1n}m c},1h:k(F,1p,2g){B(c.$19&&c.$19[F]){c.$19[F].1O.1q(k(fn){fn.3a({\'W\':c,\'2g\':2g,\'1b\':1p})()},c)}m c},au:k(15,F){B(!15.$19)m c;B(!F){M(o 6g 1a 15.$19)c.au(15,6g)}14 B(15.$19[F]){15.$19[F].1O.1q(k(fn){c.1B(F,fn)},c)}m c}};U.R(P.2H.2p);Q.R(P.2H.2p);P.R(P.2H.2p);P.2p=L 3M({\'8N\':{F:\'90\',2D:k(I){I=L 2X(I);B(I.2o!=c&&!c.8o(I.2o))c.1h(\'8N\',I)}},\'8P\':{F:\'8Y\',2D:k(I){I=L 2X(I);B(I.2o!=c&&!c.8o(I.2o))c.1h(\'8P\',I)}},\'5a\':{F:(U.8r)?\'8b\':\'5a\'}});P.8V=[\'6h\',\'eM\',\'5z\',\'5n\',\'5a\',\'8b\',\'90\',\'8Y\',\'2M\',\'9X\',\'eN\',\'eS\',\'4e\',\'7v\',\'9t\',\'eT\',\'5o\',\'eR\',\'eQ\',\'3F\',\'eO\',\'eP\',\'48\',\'aE\',\'8s\',\'eE\',\'2G\'];7Z.R({3e:k(W,1p){m c.3a({\'W\':W,\'1b\':1p,\'I\':2X})}});26.R({eV:k(3q){m L 26(c.36(k(el){m(P.4D(el)==3q)}))},a8:k(1A,2J){o T=c.36(k(el){m(el.1A&&el.1A.1j(1A,\' \'))});m(2J)?T:L 26(T)},a2:k(4u,2J){o T=c.36(k(el){m(el.4u==4u)});m(2J)?T:L 26(T)},a9:k(1w,82,J,2J){o T=c.36(k(el){o 2i=P.5R(el,1w);B(!2i)m O;B(!82)m 1e;22(82){Y\'=\':m(2i==J);Y\'*=\':m(2i.1j(J));Y\'^=\':m(2i.6K(0,J.V)==J);Y\'$=\':m(2i.6K(2i.V-J.V)==J);Y\'!=\':m(2i!=J);Y\'~=\':m 2i.1j(J,\' \')}m O});m(2J)?T:L 26(T)}});k $E(1S,36){m($(36)||Q).9P(1S)};k $et(1S,36){m($(36)||Q).6Y(1S)};$$.3B={\'5C\':/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([!*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/,\'4a\':{7L:k(1x,3b,1d,i){o 2r=[3b.eu?\'7N:\':\'\',1d[1]];B(1d[2])2r.1k(\'[@4u="\',1d[2],\'"]\');B(1d[3])2r.1k(\'[1j(7P(" ", @4R, " "), " \',1d[3],\' ")]\');B(1d[4]){B(1d[5]&&1d[6]){22(1d[5]){Y\'*=\':2r.1k(\'[1j(@\',1d[4],\', "\',1d[6],\'")]\');1C;Y\'^=\':2r.1k(\'[es-er(@\',1d[4],\', "\',1d[6],\'")]\');1C;Y\'$=\':2r.1k(\'[eo(@\',1d[4],\', 2z-V(@\',1d[4],\') - \',1d[6].V,\' + 1) = "\',1d[6],\'"]\');1C;Y\'=\':2r.1k(\'[@\',1d[4],\'="\',1d[6],\'"]\');1C;Y\'!=\':2r.1k(\'[@\',1d[4],\'!="\',1d[6],\'"]\')}}14{2r.1k(\'[@\',1d[4],\']\')}}1x.1k(2r.2c(\'\'));m 1x},7O:k(1x,3b,2J){o T=[];o 4a=Q.5r(\'.//\'+1x.2c(\'//\'),3b,$$.3B.ac,ep.eq,1n);M(o i=0,j=4a.ev;i<\\/2s>\');$(\'7I\').7i=k(){B(c.5m==\'8p\')5X()}}}14{U.2C("4e",5X);Q.2C("fe",5X)}}};U.fm=k(fn){m c.1B(\'7S\',fn)};U.R({8m:k(){B(c.5x)m c.fl;B(c.9a)m Q.4B.9c;m Q.2Z.9c},8n:k(){B(c.5x)m c.fo;B(c.9a)m Q.4B.9d;m Q.2Z.9d},93:k(){B(c.2P)m 1c.1D(Q.2Z.4b,Q.2Z.71);B(c.4x)m Q.4B.71;m Q.2Z.71},92:k(){B(c.2P)m 1c.1D(Q.2Z.3R,Q.2Z.5P);B(c.4x)m Q.4B.5P;m Q.2Z.5P},8u:k(){m c.99||Q.2Z.5V},8v:k(){m c.9i||Q.2Z.63},7g:k(){m{\'3l\':{\'x\':c.8m(),\'y\':c.8n()},\'7h\':{\'x\':c.93(),\'y\':c.92()},\'2G\':{\'x\':c.8u(),\'y\':c.8v()}}},3p:k(){m{\'x\':0,\'y\':0}}});o 1f={};1f.2T=L 18({C:{3X:18.1l,1Q:18.1l,7w:18.1l,2f:k(p){m-(1c.av(1c.7W*p)-1)/2},49:fb,2x:\'4W\',3T:1e,98:50},1i:k(C){c.G=c.G||1n;c.2Y(C);B(c.C.1i)c.C.1i.1X(c)},2n:k(){o 3A=$3A();B(3A=(7-4*a)/11){J=-1c.3w((11-6*a-11*p)/4,2)+b*b;1C}}m J},ds:k(p,x){m 1c.3w(2,10*--p)*1c.av(20*p*1c.7W*(x[0]||1)/3)}});[\'dt\',\'dz\',\'dA\',\'dG\'].1q(k(2f,i){1f.3o[2f]=L 1f.7U(k(p){m 1c.3w(p,[i+2])});1f.3o.7X(2f)});o 4g={};4g.2T=L 18({C:{3J:O,2x:\'4W\',3X:18.1l,al:18.1l,1Q:18.1l,as:18.1l,8S:18.1l,1F:O,3E:{x:\'1u\',y:\'1o\'},4P:O,6M:6},1i:k(el,C){c.2Y(C);c.G=$(el);c.3J=$(c.C.3J)||c.G;c.3m={\'12\':{},\'1m\':{}};c.J={\'1g\':{},\'12\':{}};c.1G={\'1g\':c.1g.3e(c),\'4i\':c.4i.3e(c),\'3D\':c.3D.3e(c),\'1R\':c.1R.W(c)};c.6V();B(c.C.1i)c.C.1i.1X(c)},6V:k(){c.3J.1B(\'5n\',c.1G.1g);m c},9F:k(){c.3J.4C(\'5n\',c.1G.1g);m c},1g:k(I){c.1h(\'al\',c.G);c.3m.1g=I.1Y;o 1F=c.C.1F;c.1F={\'x\':[],\'y\':[]};M(o z 1a c.C.3E){B(!c.C.3E[z])6l;c.J.12[z]=c.G.2h(c.C.3E[z]).3d();c.3m.1m[z]=I.1Y[z]-c.J.12[z];B(1F&&1F[z]){M(o i=0;i<2;i++){B($2A(1F[z][i]))c.1F[z][i]=($F(1F[z][i])==\'k\')?1F[z][i]():1F[z][i]}}}B($F(c.C.4P)==\'4M\')c.C.4P={\'x\':c.C.4P,\'y\':c.C.4P};Q.2C(\'2M\',c.1G.4i);Q.2C(\'5z\',c.1G.1R);c.1h(\'3X\',c.G);I.1R()},4i:k(I){o ao=1c.2q(1c.dH(1c.3w(I.1Y.x-c.3m.1g.x,2)+1c.3w(I.1Y.y-c.3m.1g.y,2)));B(ao>c.C.6M){Q.3h(\'2M\',c.1G.4i);Q.2C(\'2M\',c.1G.3D);c.3D(I);c.1h(\'as\',c.G)}I.1R()},3D:k(I){c.69=O;c.3m.12=I.1Y;M(o z 1a c.C.3E){B(!c.C.3E[z])6l;c.J.12[z]=c.3m.12[z]-c.3m.1m[z];B(c.1F[z]){B($2A(c.1F[z][1])&&(c.J.12[z]>c.1F[z][1])){c.J.12[z]=c.1F[z][1];c.69=1e}14 B($2A(c.1F[z][0])&&(c.J.12[z]el.1u&&12.xel.1o)},1R:k(){B(c.3f&&!c.69)c.3f.1h(\'dC\',[c.G,c]);14 c.G.1h(\'dD\',c);c.1r();m c}});P.R({dq:k(C){m L 4g.aM(c,C)}});o 6n=L 18({C:{23:\'59\',be:1e,9g:18.1l,5h:18.1l,6w:18.1l,aG:1e,5J:\'dp-8\',aZ:O,4J:{}},7q:k(){c.2u=(U.6C)?L 6C():(U.2P?L 9o(\'en.dc\'):O);m c},1i:k(C){c.7q().2Y(C);c.C.5D=c.C.5D||c.5D;c.4J={};B(c.C.aG&&c.C.23==\'59\'){o 5J=(c.C.5J)?\'; dd=\'+c.C.5J:\'\';c.5l(\'9R-F\',\'9J/x-aS-da-d9\'+5J)}B(c.C.1i)c.C.1i.1X(c)},9s:k(){B(c.2u.5m!=4||!c.4Q)m;c.4Q=O;o 4I=0;5j{4I=c.2u.4I}5c(e){};B(c.C.5D.1X(c,4I))c.5h();14 c.6w();c.2u.7i=18.1l},5D:k(4I){m((4I>=d6)&&(4I]*>([\\s\\S]*?)<\\/2s>/dJ;6Z((2s=5C.e9(c.3L.1K)))3y.1k(2s[1]);3y=3y.2c(\'\\n\')}B(3y)(U.9O)?U.9O(3y):U.9M(3y,0)},af:k(1w){5j{m c.2u.ea(1w)}5c(e){};m 1n}});8X.5A=k(1Z){o 5f=[];M(o K 1a 1Z)5f.1k(7e(K)+\'=\'+7e(1Z[K]));m 5f.2c(\'&\')};P.R({6a:k(C){m L 9b(c.5R(\'eb\'),$2a({1T:c.5A()},C,{23:\'59\'})).9h()}});o 3H=L 3M({C:{7o:O,7k:O,49:O,5g:O},2j:k(1t,J,C){C=$2a(c.C,C);J=7e(J);B(C.7o)J+=\'; 7o=\'+C.7o;B(C.7k)J+=\'; 7k=\'+C.7k;B(C.49){o 6k=L 96();6k.e8(6k.9w()+C.49*24*60*60*bd);J+=\'; e7=\'+6k.e4()}B(C.5g)J+=\'; 5g\';Q.4K=1t+\'=\'+J;m $R(C,{\'1t\':1t,\'J\':J})},5q:k(1t){o J=Q.4K.31(\'(?:^|;)\\\\s*\'+1t.b5()+\'=([^;]*)\');m J?e5(J[1]):O},2K:k(4K,C){B($F(4K)==\'2I\')c.2j(4K.1t,\'\',$2a(4K,{49:-1}));14 c.2j(4K,\'\',$2a(C,{49:-1}))}});o 3I={4l:k(N){22($F(N)){Y\'2z\':m\'"\'+N.3g(/(["\\\\])/g,\'\\\\$1\')+\'"\';Y\'1z\':m\'[\'+N.2D(3I.4l).2c(\',\')+\']\';Y\'2I\':o 2z=[];M(o K 1a N)2z.1k(3I.4l(K)+\':\'+3I.4l(N[K]));m\'{\'+2z.2c(\',\')+\'}\';Y\'4M\':B(e6(N))1C;Y O:m\'1n\'}m 6i(N)},5r:k(4H,5g){m(($F(4H)!=\'2z\')||(5g&&!4H.2v(/^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+ec-u \\n\\r\\t])+?$/)))?1n:ed(\'(\'+4H+\')\')}};3I.ej=6n.R({1i:k(2L,C){c.2L=2L;c.1B(\'5h\',c.1Q);c.1r(C);c.5l(\'X-ek\',\'ei\')},6a:k(N){m c.1r(c.2L,\'eh=\'+3I.4l(N))},1Q:k(){c.1h(\'1Q\',[3I.5r(c.3L.1K,c.C.5g)])}});o ar=L 3M({8q:k(1Z,1J){1J=$2a({\'5N\':18.1l},1J);o 2s=L P(\'2s\',{\'4s\':1Z}).6j({\'4e\':1J.5N,\'ee\':k(){B(c.5m==\'8p\')c.1h(\'4e\')}});57 1J.5N;m 2s.6o(1J).28(Q.6e)},1y:k(1Z,1J){m L P(\'4y\',$2a({\'a1\':\'ef\',\'eg\':\'e3\',\'F\':\'1K/1y\',\'4N\':1Z},1J)).28(Q.6e)},4S:k(1Z,1J){1J=$2a({\'5N\':18.1l,\'e2\':18.1l,\'dP\':18.1l},1J);o 4S=L dQ();4S.4s=1Z;o G=L P(\'8x\',{\'4s\':1Z});[\'4e\',\'8s\',\'aE\'].1q(k(F){o I=1J[\'67\'+F];57 1J[\'67\'+F];G.1B(F,k(){c.4C(F,1b.8t);I.1X(c)})});B(4S.2y&&4S.2N)G.1h(\'4e\',G,1);m G.6o(1J)},6s:k(58,C){C=$2a({1Q:18.1l,an:18.1l},C);B(!58.1k)58=[58];o 6s=[];o 6q=0;58.1q(k(1Z){o 8x=L ar.4S(1Z,{\'5N\':k(){C.an.1X(c,6q);6q++;B(6q==58.V)C.1Q()}});6s.1k(8x)});m L 26(6s)}});o 3O=L 18({V:0,1i:k(2I){c.N=2I||{};c.5K()},5q:k(1t){m(c.6t(1t))?c.N[1t]:1n},6t:k(1t){m(1t 1a c.N)},2j:k(1t,J){B(!c.6t(1t))c.V++;c.N[1t]=J;m c},5K:k(){c.V=0;M(o p 1a c.N)c.V++;m c},2K:k(1t){B(c.6t(1t)){57 c.N[1t];c.V--}m c},1q:k(fn,W){$1q(c.N,fn,W)},R:k(N){$R(c.N,N);m c.5K()},2a:k(){c.N=$2a.4j(1n,[c.N].R(1b));m c.5K()},1l:k(){c.N={};c.V=0;m c},1O:k(){o 1O=[];M(o K 1a c.N)1O.1k(K);m 1O},1I:k(){o 1I=[];M(o K 1a c.N)1I.1k(c.N[K]);m 1I}});k $H(N){m L 3O(N)};3O.3H=3O.R({1i:k(1w,C){c.1w=1w;c.C=$R({\'aw\':1e},C||{});c.4e()},aX:k(){B(c.V==0){3H.2K(c.1w,c.C);m 1e}o 4H=3I.4l(c.N);B(4H.V>dR)m O;3H.2j(c.1w,4H,c.C);m 1e},4e:k(){c.N=3I.5r(3H.5q(c.1w),1e)||{};c.5K()}});3O.3H.2H={};[\'R\',\'2j\',\'2a\',\'1l\',\'2K\'].1q(k(23){3O.3H.2H[23]=k(){3O.1L[23].4j(c,1b);B(c.C.aw)c.aX();m c}});3O.3H.3i(3O.3H.2H);o 2Q=L 18({1i:k(2E,F){F=F||(2E.1k?\'1s\':\'3C\');o 1s,2m;22(F){Y\'1s\':1s=2E;2m=1s.8h();1C;Y\'2m\':1s=2E.b9();2m=2E;1C;62:1s=2E.5G(1e);2m=1s.8h()}1s.2m=2m;1s.3C=1s.5E();m $R(1s,2Q.1L)},54:k(){o 5I=$A(1b);o 7d=($F(5I[5I.V-1])==\'4M\')?5I.dO():50;o 1s=c.8e();5I.1q(k(2E){2E=L 2Q(2E);M(o i=0;i<3;i++)1s[i]=1c.2q((1s[i]/ 35 * (35 - 7d)) + (2E[i] /35*7d))});m L 2Q(1s,\'1s\')},dN:k(){m L 2Q(c.2D(k(J){m 51-J}))},dK:k(J){m L 2Q([J,c.2m[1],c.2m[2]],\'2m\')},dL:k(7a){m L 2Q([c.2m[0],7a,c.2m[2]],\'2m\')},dM:k(7a){m L 2Q([c.2m[0],c.2m[1],7a],\'2m\')}});k $dS(r,g,b){m L 2Q([r,g,b],\'1s\')};k $dT(h,s,b){m L 2Q([h,s,b],\'2m\')};2t.R({8h:k(){o 5W=c[0],65=c[1],75=c[2];o 2W,6y,8k;o 1D=1c.1D(5W,65,75),3s=1c.3s(5W,65,75);o 4p=1D-3s;8k=1D/51;6y=(1D!=0)?4p/1D:0;B(6y==0){2W=0}14{o 8l=(1D-5W)/4p;o 8W=(1D-65)/4p;o br=(1D-75)/4p;B(5W==1D)2W=br-8W;14 B(65==1D)2W=2+8l-br;14 2W=4+8W-8l;2W/=6;B(2W<0)2W++}m[1c.2q(2W*bc),1c.2q(6y*35),1c.2q(8k*35)]},b9:k(){o br=1c.2q(c[2]/35*51);B(c[1]==0){m[br,br,br]}14{o 2W=c[0]%bc;o f=2W%60;o p=1c.2q((c[2]*(35-c[1]))/dZ*51);o q=1c.2q((c[2]*(b7-c[1]*f))/bm*51);o t=1c.2q((c[2]*(b7-c[1]*(60-f)))/bm*51);22(1c.9q(2W/60)){Y 0:m[br,t,p];Y 1:m[q,br,p];Y 2:m[p,br,t];Y 3:m[p,q,br];Y 4:m[t,p,br];Y 5:m[br,p,q]}}m O}});o 9x=L 18({C:{6b:20,8O:1,6F:k(x,y){c.G.3G(x,y)}},1i:k(G,C){c.2Y(C);c.G=$(G);c.8y=([U,Q].1j(G))?$(Q.4B):c.G},1g:k(){c.8z=c.9A.3e(c);c.8y.2C(\'2M\',c.8z)},1R:k(){c.8y.3h(\'2M\',c.8z);c.1H=$55(c.1H)},9A:k(I){c.1Y=(c.G==U)?I.9B:I.1Y;B(!c.1H)c.1H=c.2G.4f(50,c)},2G:k(){o el=c.G.7g();o 1m=c.G.3p();o 3F={\'x\':0,\'y\':0};M(o z 1a c.1Y){B(c.1Y[z]<(c.C.6b+1m[z])&&el.2G[z]!=0)3F[z]=(c.1Y[z]-c.C.6b-1m[z])*c.C.8O;14 B(c.1Y[z]+c.C.6b>(el.3l[z]+1m[z])&&el.2G[z]+el.3l[z]!=el.7h[z])3F[z]=(c.1Y[z]-el.3l[z]+c.C.6b-1m[z])*c.C.8O}B(3F.y||3F.x)c.1h(\'6F\',[el.2G.x+3F.x,el.2G.y+3F.y])}});9x.3i(L 2p,L 43);o 8B=L 18({C:{6F:18.1l,1Q:18.1l,8L:k(1m){c.4h.1P(c.p,1m)},2b:\'8M\',6E:35,1E:0},1i:k(el,4h,C){c.G=$(el);c.4h=$(4h);c.2Y(C);c.8K=-1;c.8D=-1;c.2n=-1;c.G.1B(\'5n\',c.9D.3e(c));o 6H,1E;22(c.C.2b){Y\'8M\':c.z=\'x\';c.p=\'1u\';6H={\'x\':\'1u\',\'y\':O};1E=\'4b\';1C;Y\'8Q\':c.z=\'y\';c.p=\'1o\';6H={\'x\':O,\'y\':\'1o\'};1E=\'3R\'}c.1D=c.G[1E]-c.4h[1E]+(c.C.1E*2);c.a5=c.4h[1E]/2;c.ai=c.G[\'5q\'+c.p.8R()].W(c.G);c.4h.1P(\'1v\',\'70\').1P(c.p,-c.C.1E);o 8U={};8U[c.z]=[-c.C.1E,c.1D-c.C.1E];c.3D=L 4g.2T(c.4h,{1F:8U,3E:6H,6M:0,3X:k(){c.6L()}.W(c),8S:k(){c.6L()}.W(c),1Q:k(){c.6L();c.29()}.W(c)});B(c.C.1i)c.C.1i.1X(c)},2j:k(2n){c.2n=2n.1F(0,c.C.6E);c.6G();c.29();c.1h(\'8L\',c.a0(c.2n));m c},9D:k(I){o 1v=I.1Y[c.z]-c.ai()-c.a5;1v=1v.1F(-c.C.1E,c.1D-c.C.1E);c.2n=c.8C(1v);c.6G();c.29();c.1h(\'8L\',1v)},6L:k(){c.2n=c.8C(c.3D.J.12[c.z]);c.6G()},6G:k(){B(c.8K!=c.2n){c.8K=c.2n;c.1h(\'6F\',c.2n)}},29:k(){B(c.8D!==c.2n){c.8D=c.2n;c.1h(\'1Q\',c.2n+\'\')}},8C:k(1v){m 1c.2q((1v+c.C.1E)/c.1D*c.C.6E)},a0:k(2n){m c.1D*2n/c.C.6E}});8B.3i(L 2p);8B.3i(L 43);o e0=1f.ah.R({1i:k(C){c.1r(U,C);c.5w=(c.C.5w)?$$(c.C.5w):$$(Q.5w);o 5k=U.5k.4N.31(/^[^#]*/)[0]+\'#\';c.5w.1q(k(4y){B(4y.4N.3k(5k)!=0)m;o 3K=4y.4N.6K(5k.V);B(3K&&$(3K))c.9L(4y,3K)},c);B(!U.5x)c.1B(\'1Q\',k(){U.5k.e1=c.3K})},9L:k(4y,3K){4y.1B(\'6h\',k(I){c.3K=3K;c.8A(3K);I.1R()}.3e(c))}});o 9S=L 18({C:{4L:O,3X:18.1l,1Q:18.1l,2S:1e,6M:3,9H:k(G,2S){2S.1P(\'21\',0.7);G.1P(\'21\',0.7)},9e:k(G,2S){G.1P(\'21\',1);2S.2K();c.3V.2K()}},1i:k(5p,C){c.2Y(C);c.5p=$(5p);c.T=c.5p.8H();c.4L=(c.C.4L)?$$(c.C.4L):c.T;c.1G={\'1g\':[],\'5y\':c.5y.3e(c)};M(o i=0,l=c.4L.V;i0);o 6T=c.4G.9W();o 3x=c.4G.8I();B(6T&&6P&&12<6T.4E().3P)c.4G.7Y(6T);B(3x&&!6P&&12>3x.4E().1o)c.4G.6v(3x);c.2l=12},dY:k(9Q){m c.5p.8H().2D(9Q||k(el){m c.T.3k(el)},c)},29:k(){c.2l=1n;Q.3h(\'2M\',c.1G.5o);Q.3h(\'5z\',c.1G.29);B(c.C.2S){Q.3h(\'2M\',c.1G.5y);c.1h(\'9e\',[c.4G,c.2S])}c.1h(\'1Q\',c.4G)}});9S.3i(L 2p,L 43);o aI=L 18({C:{aT:k(3W){3W.1P(\'4z\',\'8G\')},aW:k(3W){3W.1P(\'4z\',\'4O\')},8T:30,bp:35,bt:35,1A:\'dX\',5F:{\'x\':16,\'y\':16},4V:O},1i:k(T,C){c.2Y(C);c.45=L P(\'4Z\',{\'4R\':c.C.1A+\'-3W\',\'8J\':{\'1v\':\'3Y\',\'1o\':\'0\',\'1u\':\'0\',\'4z\':\'4O\'}}).28(Q.4B);c.3c=L P(\'4Z\').28(c.45);$$(T).1q(c.9I,c);B(c.C.1i)c.C.1i.1X(c)},9I:k(el){el.$1W.42=(el.4N&&el.4D()==\'a\')?el.4N.3g(\'9Y://\',\'\'):(el.a1||O);B(el.53){o 6z=el.53.68(\'::\');B(6z.V>1){el.$1W.42=6z[0].5T();el.$1W.5u=6z[1].5T()}14{el.$1W.5u=el.53}el.a7(\'53\')}14{el.$1W.5u=O}B(el.$1W.42&&el.$1W.42.V>c.C.8T)el.$1W.42=el.$1W.42.6K(0,c.C.8T-1)+"&dU;";el.1B(\'8N\',k(I){c.1g(el);B(!c.C.4V)c.8f(I);14 c.1v(el)}.W(c));B(!c.C.4V)el.1B(\'2M\',c.8f.3e(c));o 29=c.29.W(c);el.1B(\'8P\',29);el.1B(\'3V\',29)},1g:k(el){c.3c.1l();B(el.$1W.42){c.53=L P(\'b0\').28(L P(\'4Z\',{\'4R\':c.C.1A+\'-53\'}).28(c.3c)).5s(el.$1W.42)}B(el.$1W.5u){c.1K=L P(\'b0\').28(L P(\'4Z\',{\'4R\':c.C.1A+\'-1K\'}).28(c.3c)).5s(el.$1W.5u)}$55(c.1H);c.1H=c.4d.2g(c.C.bp,c)},29:k(I){$55(c.1H);c.1H=c.3Z.2g(c.C.bt,c)},1v:k(G){o 1m=G.3p();c.45.4A({\'1u\':1m.x+c.C.5F.x,\'1o\':1m.y+c.C.5F.y})},8f:k(I){o am={\'x\':U.8m(),\'y\':U.8n()};o 2G={\'x\':U.8u(),\'y\':U.8v()};o 3W={\'x\':c.45.4b,\'y\':c.45.3R};o 1V={\'x\':\'1u\',\'y\':\'1o\'};M(o z 1a 1V){o 1m=I.1Y[z]+c.C.5F[z];B((1m+3W[z]-2G[z])>am[z])1m=I.1Y[z]-c.C.5F[z]-3W[z];c.45.1P(1V[z],1m)}},4d:k(){B(c.C.aq)c.1H=c.3Z.2g(c.C.aq,c);c.1h(\'aT\',[c.45])},3Z:k(){c.1h(\'aW\',[c.45])}});aI.3i(L 2p,L 43);o dV=L 18({1i:k(){c.6D=$A(1b);c.19={};c.4U={}},1B:k(F,fn){c.4U[F]=c.4U[F]||{};c.19[F]=c.19[F]||[];B(c.19[F].1j(fn))m O;14 c.19[F].1k(fn);c.6D.1q(k(5v,i){5v.1B(F,c.4i.W(c,[F,5v,i]))},c);m c},4i:k(F,5v,i){c.4U[F][i]=1e;o 4F=c.6D.4F(k(2i,j){m c.4U[F][j]||O},c);B(!4F)m;c.4U[F]={};c.19[F].1q(k(I){I.1X(c,c.6D,5v)},c)}});o 7t=1f.26.R({C:{7K:18.1l,aa:18.1l,3Q:0,4d:O,2N:1e,2y:O,21:1e,7f:O,7n:O,3T:O,6I:O},1i:k(){o C,2B,T,2d;$1q(1b,k(4t,i){22($F(4t)){Y\'2I\':C=4t;1C;Y\'G\':2d=$(4t);1C;62:o 2r=$$(4t);B(!2B)2B=2r;14 T=2r}});c.2B=2B||[];c.T=T||[];c.2d=$(2d);c.2Y(C);c.2l=-1;B(c.C.6I)c.C.3T=1e;B($2A(c.C.4d)){c.C.3Q=O;c.2l=c.C.4d}B(c.C.1g){c.C.3Q=O;c.C.4d=O}c.3U={};B(c.C.21)c.3U.21=\'b8\';B(c.C.2y)c.3U.2y=c.C.7n?\'aj\':\'4b\';B(c.C.2N)c.3U.2N=c.C.7f?\'9n\':\'5P\';M(o i=0,l=c.2B.V;i0));c.1h(3Z?\'aa\':\'7K\',[c.2B[i],el]);M(o 2O 1a c.3U)N[i][2O]=3Z?0:el[c.3U[2O]]},c);m c.1g(N)},dW:k(25){m c.3Q(25)}});1f.7t=7t;',62,956,'||||||||||||this||||||||function||return||var|||||||||||||if|options|||type|element||event|value|property|new|for|obj|false|Element|document|extend||elements|window|length|bind||case||||now||else|from||to|Class|events|in|arguments|Math|param|true|Fx|start|fireEvent|initialize|contains|push|empty|pos|null|top|args|each|parent|rgb|key|left|position|name|items|css|array|className|addEvent|break|max|offset|limit|bound|timer|values|properties|text|prototype|result|style|keys|setStyle|onComplete|stop|selector|data|props|prop|tmp|call|page|source||opacity|switch|method||index|Elements||inject|end|merge|mode|join|container|parsed|transition|delay|getStyle|current|set|overflown|previous|hsb|step|relatedTarget|Events|round|temp|script|Array|transport|test|custom|unit|width|string|chk|togglers|addListener|map|color|Garbage|scroll|Methods|object|nocash|remove|url|mousemove|height|fx|ie|Color|border|ghost|Base|params|parse|hue|Event|setOptions|documentElement||match||getElementsByTagName|margin|100|filter||||create|context|wrapper|toInt|bindWithEvent|overed|replace|removeListener|implement|toggler|indexOf|size|mouse|parentNode|Transitions|getPosition|tag|item|min|CSS|iCss|target|pow|next|scripts|option|time|shared|hex|drag|modifiers|change|scrollTo|Cookie|Json|handle|anchor|response|Abstract|returns|Hash|bottom|display|offsetHeight|len|wait|effects|trash|tip|onStart|absolute|hide||iterable|myTitle|Options|getValue|toolTip||iTo|select|duration|xpath|offsetWidth|Styles|show|load|periodical|Drag|knob|check|apply|increase|toString|val|right|compute|delta|setNow|cont|src|argument|id|chains|padding|webkit|link|visibility|setStyles|body|removeEvent|getTag|getCoordinates|every|active|str|status|headers|cookie|handles|number|href|hidden|grid|running|class|image|pick|checker|fixed|px|open|results|div||255|collect|title|mix|clear|getNow|delete|sources|post|mousewheel|fromTo|catch|bit|native|queryString|secure|onSuccess|htmlElement|try|location|setHeader|readyState|mousedown|move|list|get|evaluate|setHTML|xml|myText|instance|links|webkit419|moveGhost|mouseup|toQueryString|HTMLElement|regexp|isSuccess|rgbToHex|offsets|hexToRgb|_method|colors|encoding|setLength|toLowerCase|unique|onload|parseInt|scrollHeight|iFrom|getProperty|include|trim|iNow|scrollLeft|red|domReady|precision|klass||walk|default|scrollTop|layout|green|parseFloat|on|split|out|send|area|droppables|mp|head|attempt|evType|click|String|addEvents|date|continue|fix|XHR|setProperties|currentStyle|counter|included|images|hasKey|brother|injectAfter|onFailure|generic|saturation|dual|Properties|loaded|XMLHttpRequest|instances|steps|onChange|checkStep|mod|alwaysHide|Listeners|substr|draggedKnob|snap|getElements|code|up|fKey|evalScripts|tagName|prev|stopPropagation|attach|getElementById|preventDefault|getElementsBySelector|while|relative|scrollWidth|setMany|Multi|splice|blue|realType|defined|removeEvents|regex|percent|forEach|typeof|alpha|encodeURIComponent|fixedHeight|getSize|scrollSize|onreadystatechange|none|path|setProperty|proto|fixedWidth|domain|evalResponse|setTransport|clean|hasClass|Accordion|Chain|unload|onCancel|update|RegExp|callChain|toUpperCase|transitions|qs|disabled|checked|add|pairs|getMany|ie_ready|multiple|onActive|getParam|found|xhtml|getItems|concat|selected|Dom|domready|Style|Transition|flag|PI|compat|injectBefore|Function|getLast|node|operator|innerText|nodeType|iProps|appendChild|cssText|firstChild|easeType|camelCase|DOMMouseScroll|random|charAt|copy|locate|newArray|rgbToHsb|merged|addEventListener|brightness|rr|getWidth|getHeight|hasChild|complete|javascript|gecko|abort|callee|getScrollLeft|getScrollTop|pageY|img|mousemover|coord|toElement|Slider|toStep|previousEnd|pageX|coordinates|visible|getChildren|getNext|styles|previousChange|onTick|horizontal|mouseenter|velocity|mouseleave|vertical|capitalize|onDrag|maxTitleChars|lim|NativeEvents|gr|Object|mouseout|first|mouseover|insertBefore|getScrollHeight|getScrollWidth|after|cancel|Date|borderShort|fps|pageXOffset|opera|Ajax|clientWidth|clientHeight|onDragComplete|clientX|onRequest|request|pageYOffset|Single|before|Merge|pp|fullHeight|ActiveXObject|wheelDelta|floor|wheelStops|onStateChange|beforeunload|iParsed|direction|getTime|Scroller|overflow|addClass|getCoords|client|constructor|clickedElement|removeClass|detach|clone|onDragStart|build|application|which|useLink|setTimeout|undefined|execScript|getElement|converter|Content|Sortables|normal|sel|contents|getPrevious|keydown|http|prefix|toPosition|rel|filterById|PropertiesIFlag|removeEventListener|half|Left|removeAttribute|filterByClass|filterByAttribute|onBackground|input|resolver|textarea|getFormElements|getHeader|ie6|Scroll|getPos|fullWidth|zoom|onBeforeStart|win|onProgress|distance||timeout|Asset|onSnap|clientY|cloneEvents|cos|autoSave|nodeValue|where|Bottom|idx|elementsProperty|childNodes|relatedTargetGecko|error|defaultView|urlEncoded|toFloat|Tips|createElement|shift|hyphenate|Move|Number|checkAgainst|getLeft|getTop|addSection|www|onShow|fixRelatedTarget|interval|onHide|save|picked|autoCancel|span|textContent|adopt|innerHTML|styleSheet|escapeRegExp|fixStyle|6000|fullOpacity|hsbToRgb|slideIn|slideOut|360|1000|async|Width|getStyles|slice|Top|sin|setOpacity|removeChild|600000|appendText|0px|showDelay|extended||Right|hideDelay|full|button|menu|shiftKey|metaKey|altKey|fromCharCode|frameborder|ctrlKey|attachEvent|detail|srcElement|control|CollectGarbage|readonly|frameBorder|alt|keyCode|111|readOnly|meta|detachEvent|120|rightClick|wheel|pass|some|associate|getRandom|clearChain|chain|DOMElement|execCommand|BackgroundImageCache|transparent|setInterval|embed|boolean|injectInside|times|bindAsEventListener|err|fromElement|iframe|khtml|whitespace|collection|clearTimeout|textnode|nodeName|MooTools|version|clearInterval|Window|taintEnabled|webkit420|getBoxObjectFor|navigator|all|Document|ie7|injectTop|cloneNode|borderStyle|borderColor|htmlFor|borderWidth|getText|getProperties|setAttribute|setText|colspan|colSpan|tabindex|tabIndex|maxlength|accessKey|accesskey|rowspan|rowSpan|removeProperty|attributes|float|styleFloat|cssFloat|toggleClass|createTextNode|replaceWith|replaceChild|zIndex|hasLayout|lastChild|getParent|getAttribute|getFirst|Sibling|getComputedStyle|getPropertyValue|maxLength|overrideMimeType|200|300|responseText|urlencoded|form|cancelBubble|XMLHTTP|charset|responseXML|Connection|Accept|html|ecma|With|Requested|close|setRequestHeader|postBody||utf|makeDraggable|Bounce|Elastic|Quad|618|Back|Circ|acos|Sine|Cubic|Quart|over|drop|emptydrop|leave|makeResizable|Quint|sqrt|java|gi|setHue|setSaturation|setBrightness|invert|pop|onerror|Image|4096|RGB|HSB|hellip|Group|showThisHideOpen|tool|serialize|10000|SmoothScroll|hash|onabort|screen|toGMTString|decodeURIComponent|isFinite|expires|setTime|exec|getResponseHeader|action|Eaeflnr|eval|readystatechange|stylesheet|media|json|JSON|Remote|Request||Expo|Microsoft|substring|XPathResult|UNORDERED_NODE_SNAPSHOT_TYPE|with|starts|ES|namespaceURI|snapshotLength|snapshotItem|checkbox|radio|getElementsByClassName|1999|w3|org|Pow|contextmenu|space|backspace|tab|esc|down|returnValue|enter|dblclick|keypress|submit|reset|blur|focus|keyup|resize|password|filterByTag|toLeft|toRight|Slide|toBottom|toTop|clearTimer|effect|toggle|easeIn|InOut|ease|Out|In|easeOut|easeInOut|500|linear|defer|DOMContentLoaded|protocol|write|offsetTop|https|offsetParent|void|innerWidth|onDomReady||innerHeight|offsetLeft'.split('|'),0,{})) diff --git a/abs/core-testing/zoneminder/zm.conf.patch b/abs/core-testing/zoneminder/zm.conf.patch new file mode 100644 index 0000000..b3406a8 --- /dev/null +++ b/abs/core-testing/zoneminder/zm.conf.patch @@ -0,0 +1,20 @@ +--- ZoneMinder-1.23.3/zm.conf.in.orig 2006-11-16 01:06:30.000000000 -0800 ++++ ZoneMinder-1.23.3/zm.conf.in 2007-09-26 16:51:06.000000000 -0700 +@@ -14,6 +14,7 @@ + + # Path to build directory, used mostly for finding DB upgrade scripts + ZM_PATH_BUILD=@PATH_BUILD@ ++ZM_PATH_UPDATE=/usr/lib/zm/upgrade + + # Build time, used to record when to trigger various checks + ZM_TIME_BUILD=@TIME_BUILD@ +@@ -44,7 +45,7 @@ + ZM_DB_NAME=@ZM_DB_NAME@ + + # ZoneMinder database user +-ZM_DB_USER=@ZM_DB_USER@ ++ZM_DB_USER= + + # ZoneMinder database password +-ZM_DB_PASS=@ZM_DB_PASS@ ++ZM_DB_PASS= diff --git a/abs/core-testing/zoneminder/zm.rc.d b/abs/core-testing/zoneminder/zm.rc.d new file mode 100644 index 0000000..00cd73c --- /dev/null +++ b/abs/core-testing/zoneminder/zm.rc.d @@ -0,0 +1,172 @@ +#!/bin/bash + +# Source function library. +. /etc/rc.conf +. /etc/rc.d/functions + +prog=ZoneMinder +ZM_VERSION="1.23.3" +ZM_PATH_BIN="/usr/lib/zm/bin" +ZM_CONFIG="/etc/zm.conf" +command="$ZM_PATH_BIN/zmpkg.pl" + +loadconf() +{ + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found. +" + return 1 + fi +} + +# Check for old config and update if needed +checkcfg() +{ + # Check config + if [ "$ZM_DB_HOST" = "" -o "$ZM_DB_NAME" = "" -o "$ZM_DB_USER" = "" -o "$ZM_DB_PASS" = "" ]; then + echo "In $ZM_CONFIG there should not be null values. +" + return 1 + loadconf + fi +} + +checkdb() +{ + # Check database exisits and version + GetVer="select Value from Config where Name='ZM_DYN_DB_VERSION'" + OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + if [ "$OLD_VERSION" = "" ]; then + GetVer="select Value from Config where Name='ZM_DYN_CURR_VERSION'" + OLD_VERSION=`echo $GetVer | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + if [ "$OLD_VERSION" = "" ]; then + echo "You must run $ZM_PATH_BIN/zminit manually +" + return 1 + fi + fi + RETVAL=$? + + if [ $RETVAL != 0 ]; then + tbls=`mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS -s -e 'show tables' $ZM_DB_NAME` + RETVAL=$? + if [ $RETVAL = 0 ]; then + echo "Initialize $prog database: +" + echo tbls | grep Config >/dev/null 2>&1 + RETVAL=$? + if [ $RETVAL != 0 ]; then + mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME < $ZM_PATH_UPDATE/zm_create.sql + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + fi + ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + else + echo "No access to ZoneMinder database. +Run $ZM_PATH_BIN/zminit manually. +" + return $RETVAL + fi + else + [ "$ZM_VERSION" = "$OLD_VERSION" ] && return 0 + echo "Upgrade %s database: " "$prog" + $ZM_PATH_BIN/zmupdate.pl --version=$OLD_VERSION --noi && ( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + echo + return $RETVAL + fi +} + +start() +{ + loadconf || return $? + checkcfg || return $? + checkdb || return $? + stat_busy "Starting $prog" + [ -d /var/run/zm ] || mkdir -m 774 /var/run/zm + chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/run/zm + GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + [ -d $ZM_PATH_SOCK ] || mkdir -m 774 $ZM_PATH_SOCK + sudo -u $ZM_WEB_USER test -O $ZM_PATH_SOCK \ + || chown -R $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK + # Setup the log dir + [ -d /var/log/zm ] || mkdir /var/log/zm + for logs in zmaudit.log zmdc.log zmfilter.log zmpkg.log zmupdate.log zmwatch.log; do + touch /var/log/zm/$logs + done + chown -R $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm + $command start + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + #[ $RETVAL = 0 ] && touch /var/lock/subsys/zm + return $RETVAL +} + +stop() +{ + stat_busy "Stopping $prog" + $command stop + RETVAL=$? + [ $RETVAL = 0 ] && stat_done + [ $RETVAL != 0 ] && stat_fail + #[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm +} + +status() +{ + result=`$command status` + if [ "$result" = "running" ]; then + echo "ZoneMinder is running +" + RETVAL=0 + else + echo "ZoneMinder is stopped +" + RETVAL=1 + fi +} + +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + stop + start + ;; + 'condrestart') + loadconf + checkcfg + result=`$ZM_PATH_BIN/zmdc.pl check` + if [ "$result" = "running" ]; then + $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null + start + fi + ;; + 'status') + status + ;; + *) + echo "Usage: zm { start | stop | restart | condrestart | status } +" + RETVAL=1 + ;; +esac +exit $RETVAL diff --git a/abs/core-testing/zoneminder/zmeventdump b/abs/core-testing/zoneminder/zmeventdump new file mode 100755 index 0000000..17087b9 --- /dev/null +++ b/abs/core-testing/zoneminder/zmeventdump @@ -0,0 +1,48 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: eventdump.sh +# +# USAGE: ./eventdump.sh +# +# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm +# events to make Event table recovery possible by doing a +# 'find' search in ZoneMinder the events directory +# +# OPTIONS: --- +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 1.0 +# CREATED: 03/06/2008 11:51:19 AM PST +# REVISION: --- +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=/etc/zm.conf +MYSQLDUMP=/usr/bin/mysqldump +EVENTSDIR=/home/httpd/html/zm/events + +# The rest should not need editing + +# Get the mysql user and password +source $ZM_CONFIG +MYDUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --skip-opt --compact --quick --no-create-info" + + +for tag in $(find $EVENTSDIR -amin -65 -name ".[0-9]*") + do + EVENT_PATH=$(echo $tag |cut -f 1 -d .) + EVENT_ID=$(echo $tag |cut -f 2 -d .) + # Dump the sql statements needed to reload the Events, Frames and Stats tables + + echo "-- ZM_DB_VERSION=$ZM_VERSION +" > $EVENT_PATH.sql + + $MYSQLDUMP $MYDUMPOPTS --where="Id=$EVENT_ID" zm Events >> $EVENT_PATH.sql + $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Frames >> $EVENT_PATH.sql + $MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Stats >> $EVENT_PATH.sql + +done diff --git a/abs/core-testing/zoneminder/zminit.arch b/abs/core-testing/zoneminder/zminit.arch new file mode 100644 index 0000000..01b6658 --- /dev/null +++ b/abs/core-testing/zoneminder/zminit.arch @@ -0,0 +1,143 @@ +#!/bin/sh + + +ZM_CONFIG=/etc/zm.conf + + + +loadcfg() { + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + exit 1 + fi + } +chkmysql(){ + #FIXME + /etc/rc.d/mysqld restart || (echo "mysql is not availible" && exit 1 ) + } + +getmylogin(){ + echo "Enter MySQL Administrator username" + echo "(Default: root and password is blank)" + echo -n "MySQL Admin: " + read MYADMIN + echo -n "Password: " + read MYPASS + if [ "X$MYPASS" != "X" ]; then MYPASS="-p$MYPASS"; fi + echo "\q" |mysql -u $MYADMIN $MYPASS || exit 0 + + } + +checkdb() +{ + # Check database exisits and version + exists=$(echo "show databases" |mysql -u $MYADMIN "$MYPASS" |grep zm) + if [ "$exists" = "zm" ]; then + OLD_VERSION=$(echo "select Value from Config where Name = 'ZM_DYN_DB_VERSION';" | mysql -u $MYADMIN $MYPASS zm |grep -v '^Value') + + case $OLD_VERSION in + "") + echo "A zm database exists, but the version is unknown" + echo "Updating is unlikely to succeed" + ;; + "$ZM_VERSION") + echo "The zm database appears to be up to date" + echo "If this is incorrect, edit $ZM_CONFIG to reflect the current version" + ;; + *) + echo "A database fron zm-$OLD_VERSION exists already" + ;; + esac + + while [ true ] + do + echo "Choose one of the following options:" + echo "[U]pdate the database" + echo "[D]rop the old database and reinitialize" + echo "[E]xit and do nothing" + read OPTION + case $OPTION in + "U"|"u") + /etc/rc.d/zm restart + exit 0 + ;; + "D"|"d") + echo "drop database zm;"|mysql -u $MYADMIN $MYPASS + return + ;; + "E"|"e") + exit 0 + ;; + esac + done + fi +} + +checkcfg(){ +for n in ZM_DB_HOST ZM_DB_NAME ZM_DB_USER ZM_DB_PASS; do + eval "val=\$$n" + if [ "$val" = "" ]; then + echo "ERROR($ZM_CONFIG): $n should not be empty." + echo "Enter a $n for ZM to use the Database." + if [ "$n" = "ZM_DB_PASS" ]; then + echo -n "Will not echo on screen $n : " + stty -echo # Turns off screen echo. + read newval + stty echo # Restores screen echo. + echo "" + ### The following can be used to generate a random password + # randstr newval 16 + else + echo -n "$n : " + read newval + fi + cp $ZM_CONFIG /tmp/$$ && + sed 's/^'$n='.*$/'$n=$newval'/g' /tmp/$$ >$ZM_CONFIG + + fi +done + +if [ "$ZM_DB_HOST" = "localhost" ]; then + ClientHost=localhost +else + ClientHost=`hostname` +fi +} + +reloadcfg(){ +loadcfg +} + +initdb(){ +sql=/tmp/zm.crdb.sql +echo "" >$sql +chmod 600 $sql + +echo "CREATE DATABASE $ZM_DB_NAME;" >>$sql +echo "USE $ZM_DB_NAME;" >>$sql + +echo "GRANT all on $ZM_DB_NAME.* TO '$ZM_DB_USER'@'$ClientHost' IDENTIFIED BY '$ZM_DB_PASS';" >>$sql + +cat $sql | mysql -B -h $ZM_DB_HOST -u $MYADMIN $MYPASS +rm -f $sql + +cat $ZM_PATH_UPDATE/zm_create.sql | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME +( cd $ZM_PATH_UPDATE; perl $ZM_PATH_BIN/zmupdate.pl -f ) + + $ZM_PATH_UPDATE/customdb $ZM_DB_HOST $ZM_DB_NAME $ZM_DB_USER $ZM_DB_PASS +} + + + +loadcfg +getmylogin +checkdb +checkcfg +reloadcfg +initdb + + + + diff --git a/abs/core-testing/zoneminder/zmupdate.patch b/abs/core-testing/zoneminder/zmupdate.patch new file mode 100644 index 0000000..2c94d89 --- /dev/null +++ b/abs/core-testing/zoneminder/zmupdate.patch @@ -0,0 +1,11 @@ +--- ZoneMinder-1.23.3/scripts/zmupdate.pl.orig 2007-09-26 17:05:19.000000000 -0700 ++++ ZoneMinder-1.23.3/scripts/zmupdate.pl 2007-09-26 17:10:55.000000000 -0700 +@@ -327,7 +327,7 @@ + $command .= " -p".$db_pass; + } + } +- $command .= " ".ZM_DB_NAME." < ".ZM_PATH_BUILD."/db/zm_update-".$version.".sql"; ++ $command .= " ".ZM_DB_NAME." < ".ZM_PATH_UPDATE."/zm_update-".$version.".sql"; + + print( "Executing '$command'\n" ) if ( DBG_LEVEL > 0 ); + my $output = qx($command); 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: -- cgit v0.12