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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
From c261f3213e6e4e5bad08f787376a74dd6ca38ca7 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Thu, 5 Jan 2012 17:32:05 -0600
Subject: [PATCH 01/10] arch fixes

---
 PKGBUILD |    2 +-
 zm.rc.d  |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index e646468..7976702 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -51,7 +51,7 @@ build() {
   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/zminit.arch  $startdir/pkg/srv/zoneminder/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
diff --git a/zm.rc.d b/zm.rc.d
index 60f684b..99a1f1f 100644
--- a/zm.rc.d
+++ b/zm.rc.d
@@ -5,8 +5,8 @@
 . /etc/rc.d/functions
 
 prog=ZoneMinder
-ZM_VERSION="1.24.0"
-ZM_PATH_BIN="/usr/lib/zm/bin"
+ZM_VERSION="1.25.0"
+ZM_PATH_BIN="/srv/zoneminder/bin"
 ZM_CONFIG="/etc/zm.conf"
 command="$ZM_PATH_BIN/zmpkg.pl"
 
@@ -110,7 +110,7 @@ start()
 	chown -R $ZM_WEB_USER:$ZM_WEB_GROUP  /var/log/zm
 	$command start
 	RETVAL=$?
-	[ $RETVAL = 0 ] && stat_done
+	[ $RETVAL = 0 ] && stat_done && add_daemon zm
 	[ $RETVAL != 0 ] && stat_fail
 	#[ $RETVAL = 0 ] && touch /var/lock/subsys/zm
 	return $RETVAL
@@ -121,7 +121,7 @@ stop()
 	stat_busy "Stopping $prog"
 	$command stop
 	RETVAL=$?
-	[ $RETVAL = 0 ] && stat_done
+	[ $RETVAL = 0 ] && stat_done && rm_daemon zm
 	[ $RETVAL != 0 ] && stat_fail
 	#[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm
 }
-- 
1.7.8.1


From 0e72042230d2da83b896a3586db1fa061cb8aeb5 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 11:53:11 -0600
Subject: [PATCH 02/10] fixed cgi-bin path to cgi-zm, as specified in
 httpd-zm.conf

---
 PKGBUILD |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index 7976702..eb6697a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,7 +41,7 @@ build() {
     --with-webgroup=http \
     --with-mysql=/usr  \
     --with-webdir=/srv/zoneminder/www  \
-    --with-cgidir=/srv/zoneminder/cgi-bin \
+    --with-cgidir=/srv/zoneminder/cgi-zm \
     --bindir=/srv/zoneminder/bin \
     ZM_SSL_LIB=openssl \
     CPPFLAGS=-D__STDC_CONSTANT_MACROS
-- 
1.7.8.1


From a05b531eac250049453064bf9322ce39cb7ad4d0 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 12:00:11 -0600
Subject: [PATCH 03/10] fixed location of zmupdate.pl, fixed spacing

---
 zoneminder.install |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/zoneminder.install b/zoneminder.install
index 250749f..a6ac09b 100644
--- a/zoneminder.install
+++ b/zoneminder.install
@@ -11,7 +11,7 @@ Note:
 ==> /usr/lib/zm/bin/zminit
 EOF
 
-cat  << EOF
+  cat  << EOF
 ==> Check /etc/php/php.ini and make sure these are uncommented
 ==> extension=gd.so
 ==> extension=gettext.so
@@ -21,12 +21,12 @@ cat  << EOF
 ==> extension=session.so
 ==> extension=sockets.so
 EOF
-cat << EOF
+  cat << EOF
 ==> Check /etc/php/php.ini and make sure short_open_tag = On
 EOF
 
 
-cat /etc/php/php.ini |grep "^open_basedir.*/etc/" | \
+  cat /etc/php/php.ini |grep "^open_basedir.*/etc/" | \
 grep "/var/lib/zm/www">/dev/null ||  cat << EOF
 ==> You must edit /etc/php/php.ini and add to open_basedir "/etc/" and
 ==> "/var/lib/zm/" like so
@@ -35,7 +35,7 @@ grep "/var/lib/zm/www">/dev/null ||  cat << EOF
 ==> or display its own web directory
 EOF
 
-cat << EOF
+  cat << EOF
 Note:
 ==> You must edit /etc/httpd/conf/httpd.conf and uncomment/add the line
 ==> LoadModule php5_module modules/libphp5.so
@@ -43,13 +43,13 @@ Note:
 ==> Include conf/extra/php5_module.conf
 ==> Include /etc/httpd/conf/extra/httpd-zm.conf
 EOF
-touch /var/lib/zm/zm_backup.sql
+  touch /var/lib/zm/zm_backup.sql
 }
 
 
 ## arg 1:  the new package version
 ## arg 2:  the old package version
 post_upgrade() {
-/usr/lib/zm/bin/zmupdate.pl -f >/dev/null
+  /srv/zoneminder/bin/zmupdate.pl -f >/dev/null
 }
 # vim:set ts=2 sw=2 et:
-- 
1.7.8.1


From 4e8fe0ed8369677fe26aa81670b94027f7d668c2 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 12:32:29 -0600
Subject: [PATCH 04/10] fixed path to www and cgi-bin for apache server

---
 httpd-zm.conf |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/httpd-zm.conf b/httpd-zm.conf
index bdd29d7..413c0cb 100644
--- a/httpd-zm.conf
+++ b/httpd-zm.conf
@@ -1,16 +1,16 @@
 # /etc/httpd/conf/extra/httpd-zm.conf
 # Config for zoneminder web app
 
-Alias /zm "/var/lib/zm/www"
-<Directory "/var/lib/zm/www">
+Alias /zm "/srv/zoneminder/www"
+<Directory "/srv/zoneminder/www">
     Options -Indexes MultiViews FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
 </Directory>
 
-ScriptAlias /cgi-zm "/var/lib/zm/cgi-bin"
-<Directory "/var/lib/zm/cgi-bin">
+ScriptAlias /cgi-zm "/srv/zoneminder/cgi-bin"
+<Directory "/srv/zoneminder/cgi-bin">
     AllowOverride All
     Options ExecCGI
     Order allow,deny
-- 
1.7.8.1


From da1b41fcb57588843d5533d28d2f8b63a1d6e3b3 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 12:47:05 -0600
Subject: [PATCH 05/10] forgot to change cgi-bin to cgi-zm

---
 httpd-zm.conf |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/httpd-zm.conf b/httpd-zm.conf
index 413c0cb..a0a4ced 100644
--- a/httpd-zm.conf
+++ b/httpd-zm.conf
@@ -9,8 +9,8 @@ Alias /zm "/srv/zoneminder/www"
     Allow from all
 </Directory>
 
-ScriptAlias /cgi-zm "/srv/zoneminder/cgi-bin"
-<Directory "/srv/zoneminder/cgi-bin">
+ScriptAlias /cgi-zm "/srv/zoneminder/cgi-zm"
+<Directory "/srv/zoneminder/cgi-zm">
     AllowOverride All
     Options ExecCGI
     Order allow,deny
-- 
1.7.8.1


From 4df0d26a0d6bfb840e25009c56ff6bfa618b5028 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 18:11:14 -0600
Subject: [PATCH 06/10] fixed more paths

---
 PKGBUILD           |   18 +++++++++++-------
 zoneminder.install |   12 +++++++-----
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index eb6697a..cb2ccb4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -48,24 +48,28 @@ build() {
   # goddamn chown line just mucks everything up, we'll chown it in the install
   # script.
   sed -i '/chown/d' Makefile
+  # modify hard-coded paths
+  sed -i 's#/var/lib/zm#/src/zoneminder/backup#' scripts/zmdbrestore.in
+  sed -i 's#/var/lib/zm#/src/zoneminder/backup#' scripts/zmlogrotate.conf.in
+  sed -i 's#/var/lib/zm#/src/zoneminder/backup#' scripts/zmdbbackup.in
   make || return 1
   make DESTDIR="$pkgdir" install || return 1
 
   install -D -m 700 $startdir/src/zminit.arch  $startdir/pkg/srv/zoneminder/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/zmeventdump  $startdir/pkg/usr/lib/zm/bin/zmeventdump
+  install -D -m 700 scripts/zmdbbackup  $startdir/pkg/srv/zoneminder/bin/zmdbbackup
+  install -D -m 700 scripts/zmdbbackup  $startdir/pkg/srv/zoneminder/bin/zmdbbackup
+  install -D -m 700 scripts/zmdbrestore  $startdir/pkg/srv/zoneminder/bin/zmdbrestore
+  install -D -m 700 scripts/zmeventdump  $startdir/pkg/srv/zoneminder/bin/zmeventdump
   install -D -m 700 scripts/zmlogrotate.conf  $startdir/pkg/etc/logrotate.d/zm
   install -D -m 700 $startdir/src/zmeventbackup  $startdir/pkg/etc/cron.hourly/zmeventbackup
-  install -D -m 755 $startdir/src/zmfilter.pl $startdir/pkg/usr/lib/zm/bin/zmfilter.pl
+  install -D -m 755 $startdir/src/zmfilter.pl $startdir/pkg/srv/zoneminder/bin/zmfilter.pl
 
   mkdir -p  $startdir/pkg/etc/httpd/conf/extra/
   install -m 644 $startdir/src/httpd-zm.conf $startdir/pkg/etc/httpd/conf/extra/httpd-zm.conf
 
-  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/
+  install -D -m 700 $startdir/src/customdb $startdir/pkg/srv/zoneminder/upgrade/customdb
+  install -D  db/zm*.sql $startdir/pkg/srv/zoneminder/upgrade/
 
   mkdir -p $startdir/pkg/var/run/zm
 
diff --git a/zoneminder.install b/zoneminder.install
index a6ac09b..c90841a 100644
--- a/zoneminder.install
+++ b/zoneminder.install
@@ -5,10 +5,12 @@ post_install() {
   ln -s /usr/share/cambozola/cambozola.jar /srv/zoneminder/www/
   chown -R http.http /srv/zoneminder
   chown http.http /etc/zm.conf
+  mkdir /srv/zoneminder/backup
+  mkdir /srv/zoneminder/socks
   cat << EOF
 Note:
 ==> To initialize the ZoneMinder database run (as root)
-==> /usr/lib/zm/bin/zminit
+==> /srv/zoneminder/bin/zminit
 EOF
 
   cat  << EOF
@@ -27,10 +29,10 @@ EOF
 
 
   cat /etc/php/php.ini |grep "^open_basedir.*/etc/" | \
-grep "/var/lib/zm/www">/dev/null ||  cat << EOF
+grep "/src/zoneminder/www">/dev/null ||  cat << EOF
 ==> You must edit /etc/php/php.ini and add to open_basedir "/etc/" and
-==> "/var/lib/zm/" like so
-==> open_basedir = /home/:/tmp/:/usr/share/pear/:/etc/:/var/lib/zm/
+==> "/src/zoneminder/" like so
+==> open_basedir = /home/:/tmp/:/usr/share/pear/:/etc/:/src/zoneminder/
 ==> Otherwise ZoneMinder will be unable to read /etc/zm.conf
 ==> or display its own web directory
 EOF
@@ -43,7 +45,7 @@ Note:
 ==> Include conf/extra/php5_module.conf
 ==> Include /etc/httpd/conf/extra/httpd-zm.conf
 EOF
-  touch /var/lib/zm/zm_backup.sql
+  touch /src/zoneminder/zm_backup.sql
 }
 
 
-- 
1.7.8.1


From a21386caf8eecfcf2d134030eacd55133f1a1ed8 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 18:11:40 -0600
Subject: [PATCH 07/10] fixed paths in customdb script

---
 customdb      |    2 +-
 zmeventbackup |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/customdb b/customdb
index 82dfc48..4e204c7 100755
--- a/customdb
+++ b/customdb
@@ -5,7 +5,7 @@ USERNAME=$3
 PASSWORD=$4
 
 ZM_PATH_ZMS=/cgi-zm/nph-zms
-ZM_PATH_SOCKS=/var/lib/zm/socks
+ZM_PATH_SOCKS=/srv/zoneminder/socks
 ZM_PATH_LOGS=/var/log/zm
 ZM_WEB_LIST_THUMBS=1
 ZM_WEB_MONTAGE_WIDTH=320
diff --git a/zmeventbackup b/zmeventbackup
index 71c9538..a14ee22 100755
--- a/zmeventbackup
+++ b/zmeventbackup
@@ -23,7 +23,7 @@
 # Edit these to suit your configuration
 ZM_CONFIG=/etc/zm.conf
 MYSQLDUMP=/usr/bin/mysqldump
-EVENTSDIR=/var/lib/zm/www/events
+EVENTSDIR=/srv/zoneminder/www/events
 
 # The rest should not need editing
 
-- 
1.7.8.1


From 07b91f1e21ec6d21bc18d8168fb0429913dbdf54 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 18:14:45 -0600
Subject: [PATCH 08/10] changed back cgi-zm stuff to cgi-bin because it is
 hard coded in zm web pages

---
 PKGBUILD      |    2 +-
 customdb      |    2 +-
 httpd-zm.conf |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index cb2ccb4..c35107a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,7 +41,7 @@ build() {
     --with-webgroup=http \
     --with-mysql=/usr  \
     --with-webdir=/srv/zoneminder/www  \
-    --with-cgidir=/srv/zoneminder/cgi-zm \
+    --with-cgidir=/srv/zoneminder/cgi-bin \
     --bindir=/srv/zoneminder/bin \
     ZM_SSL_LIB=openssl \
     CPPFLAGS=-D__STDC_CONSTANT_MACROS
diff --git a/customdb b/customdb
index 4e204c7..afd2959 100755
--- a/customdb
+++ b/customdb
@@ -4,7 +4,7 @@ DBNAME=$2
 USERNAME=$3
 PASSWORD=$4
 
-ZM_PATH_ZMS=/cgi-zm/nph-zms
+ZM_PATH_ZMS=/cgi-bin/nph-zms
 ZM_PATH_SOCKS=/srv/zoneminder/socks
 ZM_PATH_LOGS=/var/log/zm
 ZM_WEB_LIST_THUMBS=1
diff --git a/httpd-zm.conf b/httpd-zm.conf
index a0a4ced..ad24cbb 100644
--- a/httpd-zm.conf
+++ b/httpd-zm.conf
@@ -9,8 +9,8 @@ Alias /zm "/srv/zoneminder/www"
     Allow from all
 </Directory>
 
-ScriptAlias /cgi-zm "/srv/zoneminder/cgi-zm"
-<Directory "/srv/zoneminder/cgi-zm">
+ScriptAlias /cgi-bin "/srv/zoneminder/cgi-bin"
+<Directory "/srv/zoneminder/cgi-bin">
     AllowOverride All
     Options ExecCGI
     Order allow,deny
-- 
1.7.8.1


From 8de3232c6ee45a3f24ed138d0c1070e398762a23 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Fri, 6 Jan 2012 18:21:36 -0600
Subject: [PATCH 09/10] should specify arches, has code that is compiled

---
 PKGBUILD |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index c35107a..c3e9cc3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@ pkgname=zoneminder
 pkgver=1.25.0
 pkgrel=3
 pkgdesc="Capture, analyse, record and monitor video security cameras."
-arch=('any')
+arch=('x86' 'x86_64')
 url="http://www.zoneminder.com"
 license=('GPL')
 depends=('cambozola' 'apache' 'php' 'mysql' 'pcre' 'openssl' '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' 'perl-net-smtp-ssl' 'perl-sys-mmap' 'sudo' 'libv4l' 'libjpeg' 'gnutls' 'php-apache')
-- 
1.7.8.1


From f78be078ea1045018860f5632edb2e70683034e4 Mon Sep 17 00:00:00 2001
From: Jason Gardner <[email protected]>
Date: Sat, 7 Jan 2012 15:34:47 -0600
Subject: [PATCH 10/10] Add more notes for setting up apache. remove useless
 touch of zm_backup.sql

---
 zoneminder.install |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/zoneminder.install b/zoneminder.install
index c90841a..8b0ec28 100644
--- a/zoneminder.install
+++ b/zoneminder.install
@@ -44,8 +44,10 @@ Note:
 ==> You must also add these lines:
 ==> Include conf/extra/php5_module.conf
 ==> Include /etc/httpd/conf/extra/httpd-zm.conf
+==> Also, the default httpd.conf already has a ScriptAlias in it
+==> for cgi-bin. You must comment this line to allow the ScriptAlias
+==> in zoneminders httpd-zm.conf to take over.
 EOF
-  touch /src/zoneminder/zm_backup.sql
 }
 
 
-- 
1.7.8.1