summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/zoneminder/PKGBUILD
blob: 6bfb0821eb55c9ebc662ab3be4d578ba40a4ffc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# This is a ZoneMinder PKGBUILD file. 
# Contributor: Ross melin <rdmelin@gmail.com>

pkgname=zoneminder
pkgver=1.23.3
pkgrel=6
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'
         '320dd41725945218de0672f899e1d739'
         '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|<ffmpeg/avformat.h>|<libavformat/avformat.h>|' $srcdir/ZoneMinder-$pkgver/src/zm_mpeg.h
  sed -i 's|<ffmpeg/swscale.h>|<libswscale/swscale.h>|' $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: