1 |
commit: f2e466918b4367d5d96582a2bba599383225308c |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 16 19:25:24 2017 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 16 19:25:39 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2e46691 |
7 |
|
8 |
www-misc/zoneminder: Various fixes, work in progress |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
|
12 |
www-misc/zoneminder/files/10_zoneminder.conf-r1 | 17 ++ |
13 |
www-misc/zoneminder/files/README.gentoo | 6 +- |
14 |
.../files/zoneminder-1.30.2-diskspace.patch | 15 ++ |
15 |
www-misc/zoneminder/zoneminder-1.30.2-r1.ebuild | 177 +++++++++++++++++++++ |
16 |
4 files changed, 212 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/www-misc/zoneminder/files/10_zoneminder.conf-r1 b/www-misc/zoneminder/files/10_zoneminder.conf-r1 |
19 |
new file mode 100644 |
20 |
index 00000000000..441c793d189 |
21 |
--- /dev/null |
22 |
+++ b/www-misc/zoneminder/files/10_zoneminder.conf-r1 |
23 |
@@ -0,0 +1,17 @@ |
24 |
+ScriptAlias /zm/cgi-bin/ "/usr/libexec/zoneminder/cgi-bin/" |
25 |
+ |
26 |
+<Directory "/usr/libexec/zoneminder/cgi-bin"> |
27 |
+ AllowOverride All |
28 |
+ Options ExecCGI |
29 |
+ Order allow,deny |
30 |
+ Allow from all |
31 |
+</Directory> |
32 |
+ |
33 |
+Alias /zoneminder "%ZM_WEBDIR%" |
34 |
+ |
35 |
+<Directory "%ZM_WEBDIR%"> |
36 |
+ Options -Indexes MultiViews FollowSymLinks |
37 |
+ AllowOverride All |
38 |
+ Order allow,deny |
39 |
+ Allow from all |
40 |
+</Directory> |
41 |
|
42 |
diff --git a/www-misc/zoneminder/files/README.gentoo b/www-misc/zoneminder/files/README.gentoo |
43 |
index 2ada7c7d0a4..07995214d1c 100644 |
44 |
--- a/www-misc/zoneminder/files/README.gentoo |
45 |
+++ b/www-misc/zoneminder/files/README.gentoo |
46 |
@@ -14,14 +14,14 @@ |
47 |
for an example configuration snippet. |
48 |
|
49 |
4. Enable PHP in your webserver configuration, |
50 |
- enable short_open_tags in php.ini, |
51 |
+ enable short_open_tags in php.ini (likely on by default now) |
52 |
set the time zone in php.ini, |
53 |
and restart/reload the webserver. |
54 |
|
55 |
5. Start the zoneminder daemon: |
56 |
/etc/init.d/zoneminder start |
57 |
|
58 |
-6. Finally point your browser to http://your.webserver/zoneminder |
59 |
+6. Finally point your browser to http://your.webserver/zm |
60 |
|
61 |
If you are upgrading, you will need to run the zmupdate.pl script: |
62 |
- /usr/bin/zmupdate.pl --version=oldversionnumber [--user=zmuser --pass=topsecretpassword] |
63 |
+ /usr/bin/zmupdate.pl --version=oldversionnumber [--user=zmuser --pass=topsecretpassword] |
64 |
|
65 |
diff --git a/www-misc/zoneminder/files/zoneminder-1.30.2-diskspace.patch b/www-misc/zoneminder/files/zoneminder-1.30.2-diskspace.patch |
66 |
new file mode 100644 |
67 |
index 00000000000..fee5b783c35 |
68 |
--- /dev/null |
69 |
+++ b/www-misc/zoneminder/files/zoneminder-1.30.2-diskspace.patch |
70 |
@@ -0,0 +1,15 @@ |
71 |
+https://forums.zoneminder.com/viewtopic.php?t=24534 |
72 |
+& personal message by simon@××××××××××.co_m |
73 |
+ |
74 |
+diff -ruN ZoneMinder-1.30.2.orig/web/includes/functions.php ZoneMinder-1.30.2/web/includes/functions.php |
75 |
+--- ZoneMinder-1.30.2.orig/web/includes/functions.php 2017-03-30 20:43:06.000000000 +0200 |
76 |
++++ ZoneMinder-1.30.2/web/includes/functions.php 2017-04-16 21:13:43.841371345 +0200 |
77 |
+@@ -1442,7 +1442,7 @@ |
78 |
+ return( $load[0] ); |
79 |
+ } |
80 |
+ |
81 |
+-function getDiskPercent($path = ZM_DIR_EVENTS) { |
82 |
++function getDiskPercent($path = ZM_PATH_WEB.'/'.ZM_DIR_EVENTS) { |
83 |
+ $total = disk_total_space($path); |
84 |
+ if ( $total === false ) { |
85 |
+ Error("disk_total_space returned false. Verify the web account user has access to " . $path ); |
86 |
|
87 |
diff --git a/www-misc/zoneminder/zoneminder-1.30.2-r1.ebuild b/www-misc/zoneminder/zoneminder-1.30.2-r1.ebuild |
88 |
new file mode 100644 |
89 |
index 00000000000..d37f30cc0bf |
90 |
--- /dev/null |
91 |
+++ b/www-misc/zoneminder/zoneminder-1.30.2-r1.ebuild |
92 |
@@ -0,0 +1,177 @@ |
93 |
+# Copyright 1999-2017 Gentoo Foundation |
94 |
+# Distributed under the terms of the GNU General Public License v2 |
95 |
+ |
96 |
+# TO DO: |
97 |
+# * dependencies of unknown status: |
98 |
+# dev-perl/Device-SerialPort |
99 |
+# dev-perl/MIME-Lite |
100 |
+# dev-perl/MIME-tools |
101 |
+# dev-perl/PHP-Serialization |
102 |
+# virtual/perl-Archive-Tar |
103 |
+# virtual/perl-libnet |
104 |
+# virtual/perl-Module-Load |
105 |
+ |
106 |
+EAPI=6 |
107 |
+ |
108 |
+inherit versionator perl-functions readme.gentoo-r1 cmake-utils depend.apache flag-o-matic systemd |
109 |
+ |
110 |
+MY_PN="ZoneMinder" |
111 |
+ |
112 |
+MY_CRUD_VERSION="3.1.0" |
113 |
+ |
114 |
+DESCRIPTION="Capture, analyse, record and monitor any cameras attached to your system" |
115 |
+HOMEPAGE="http://www.zoneminder.com/" |
116 |
+SRC_URI=" |
117 |
+ https://github.com/${MY_PN}/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz |
118 |
+ https://github.com/FriendsOfCake/crud/archive/v${MY_CRUD_VERSION}.tar.gz -> Crud-${MY_CRUD_VERSION}.tar.gz |
119 |
+" |
120 |
+ |
121 |
+LICENSE="GPL-2" |
122 |
+KEYWORDS="" |
123 |
+IUSE="curl ffmpeg gcrypt gnutls +mmap +ssl libressl vlc" |
124 |
+SLOT="0" |
125 |
+ |
126 |
+REQUIRED_USE=" |
127 |
+ || ( ssl gnutls ) |
128 |
+" |
129 |
+ |
130 |
+DEPEND=" |
131 |
+ app-eselect/eselect-php[apache2] |
132 |
+ dev-lang/perl:= |
133 |
+ dev-lang/php:*[apache2,cgi,curl,gd,inifile,pdo,mysql,mysqli,sockets] |
134 |
+ dev-libs/libpcre |
135 |
+ dev-perl/Archive-Zip |
136 |
+ dev-perl/Class-Std-Fast |
137 |
+ dev-perl/Data-Dump |
138 |
+ dev-perl/Date-Manip |
139 |
+ dev-perl/Data-UUID |
140 |
+ dev-perl/DBD-mysql |
141 |
+ dev-perl/DBI |
142 |
+ dev-perl/IO-Socket-Multicast |
143 |
+ dev-perl/SOAP-WSDL |
144 |
+ dev-perl/Sys-CPU |
145 |
+ dev-perl/Sys-MemInfo |
146 |
+ dev-perl/URI-Encode |
147 |
+ dev-perl/libwww-perl |
148 |
+ sys-auth/polkit |
149 |
+ sys-libs/zlib |
150 |
+ virtual/ffmpeg |
151 |
+ virtual/httpd-php:* |
152 |
+ virtual/jpeg:0 |
153 |
+ virtual/mysql |
154 |
+ virtual/perl-ExtUtils-MakeMaker |
155 |
+ virtual/perl-Getopt-Long |
156 |
+ virtual/perl-Sys-Syslog |
157 |
+ virtual/perl-Time-HiRes |
158 |
+ www-servers/apache |
159 |
+ curl? ( net-misc/curl ) |
160 |
+ gcrypt? ( dev-libs/libgcrypt:0= ) |
161 |
+ gnutls? ( net-libs/gnutls ) |
162 |
+ mmap? ( dev-perl/Sys-Mmap ) |
163 |
+ ssl? ( |
164 |
+ !libressl? ( dev-libs/openssl:0= ) |
165 |
+ libressl? ( dev-libs/libressl:0= ) |
166 |
+ ) |
167 |
+ vlc? ( media-video/vlc[live] ) |
168 |
+" |
169 |
+RDEPEND="${DEPEND}" |
170 |
+ |
171 |
+# we cannot use need_httpd_cgi here, since we need to setup permissions for the |
172 |
+# webserver in global scope (/etc/zm.conf etc), so we hardcode apache here. |
173 |
+need_apache |
174 |
+ |
175 |
+S=${WORKDIR}/${MY_PN}-${PV} |
176 |
+ |
177 |
+PATCHES=( |
178 |
+ "${FILESDIR}/${PN}-1.26.5"-automagic.patch |
179 |
+ "${FILESDIR}/${PN}-1.28.1"-mysql_include_path.patch |
180 |
+ "${FILESDIR}/${PN}-1.30.2"-diskspace.patch |
181 |
+) |
182 |
+ |
183 |
+MY_ZM_WEBDIR=/usr/share/zoneminder/www |
184 |
+ |
185 |
+src_prepare() { |
186 |
+ cmake-utils_src_prepare |
187 |
+ |
188 |
+ rmdir "${S}/web/api/app/Plugin/Crud" || die |
189 |
+ mv "${WORKDIR}/crud-${MY_CRUD_VERSION}" "${S}/web/api/app/Plugin/Crud" || die |
190 |
+} |
191 |
+ |
192 |
+src_configure() { |
193 |
+ append-cxxflags -D__STDC_CONSTANT_MACROS |
194 |
+ perl_set_version |
195 |
+ |
196 |
+ mycmakeargs=( |
197 |
+ -DZM_PERL_SUBPREFIX=${VENDOR_LIB#/usr} |
198 |
+ -DZM_TMPDIR=/var/tmp/zm |
199 |
+ -DZM_SOCKDIR=/var/run/zm |
200 |
+ -DZM_WEB_USER=apache |
201 |
+ -DZM_WEB_GROUP=apache |
202 |
+ -DZM_WEBDIR=${MY_ZM_WEBDIR} |
203 |
+ -DZM_NO_MMAP="$(usex mmap OFF ON)" |
204 |
+ -DZM_NO_X10=OFF |
205 |
+ -DZM_NO_FFMPEG="$(usex ffmpeg OFF ON)" |
206 |
+ -DZM_NO_CURL="$(usex curl OFF ON)" |
207 |
+ -DZM_NO_LIBVLC="$(usex vlc OFF ON)" |
208 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL="$(usex ssl OFF ON)" |
209 |
+ -DHAVE_GNUTLS="$(usex gnutls ON OFF)" |
210 |
+ -DHAVE_GCRYPT="$(usex gcrypt ON OFF)" |
211 |
+ ) |
212 |
+ |
213 |
+ cmake-utils_src_configure |
214 |
+} |
215 |
+ |
216 |
+src_install() { |
217 |
+ cmake-utils_src_install |
218 |
+ |
219 |
+ # the log directory |
220 |
+ keepdir /var/log/zm |
221 |
+ fowners apache:apache /var/log/zm |
222 |
+ |
223 |
+ # the logrotate script |
224 |
+ insinto /etc/logrotate.d |
225 |
+ newins distros/ubuntu1204/zoneminder.logrotate zoneminder |
226 |
+ |
227 |
+ # now we duplicate the work of zmlinkcontent.sh |
228 |
+ keepdir /var/lib/zoneminder /var/lib/zoneminder/images /var/lib/zoneminder/events /var/lib/zoneminder/api_tmp |
229 |
+ fperms -R 0775 /var/lib/zoneminder |
230 |
+ fowners -R apache:apache /var/lib/zoneminder |
231 |
+ dosym /var/lib/zoneminder/images ${MY_ZM_WEBDIR}/images |
232 |
+ dosym /var/lib/zoneminder/events ${MY_ZM_WEBDIR}/events |
233 |
+ dosym /var/lib/zoneminder/api_tmp ${MY_ZM_WEBDIR}/api/app/tmp |
234 |
+ |
235 |
+ # bug 523058 |
236 |
+ keepdir ${MY_ZM_WEBDIR}/temp |
237 |
+ fowners -R apache:apache ${MY_ZM_WEBDIR}/temp |
238 |
+ |
239 |
+ # the configuration file |
240 |
+ fperms 0640 /etc/zm.conf |
241 |
+ fowners root:apache /etc/zm.conf |
242 |
+ |
243 |
+ # init scripts etc |
244 |
+ newinitd "${FILESDIR}"/init.d zoneminder |
245 |
+ newconfd "${FILESDIR}"/conf.d zoneminder |
246 |
+ |
247 |
+ # systemd unit file |
248 |
+ systemd_dounit "${FILESDIR}"/zoneminder.service |
249 |
+ |
250 |
+ cp "${FILESDIR}"/10_zoneminder.conf-r1 "${T}"/10_zoneminder.conf || die |
251 |
+ sed -i "${T}"/10_zoneminder.conf -e "s:%ZM_WEBDIR%:${MY_ZM_WEBDIR}:g" || die |
252 |
+ |
253 |
+ dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README.md TODO "${T}"/10_zoneminder.conf |
254 |
+ |
255 |
+ perl_delete_packlist |
256 |
+ |
257 |
+ readme.gentoo_create_doc |
258 |
+} |
259 |
+ |
260 |
+pkg_postinst() { |
261 |
+ readme.gentoo_print_elog |
262 |
+ |
263 |
+ local v |
264 |
+ for v in ${REPLACING_VERSIONS}; do |
265 |
+ if ! version_is_at_least ${PV} ${v}; then |
266 |
+ elog "You have upgraded zoneminder and may have to upgrade your database now using the 'zmupdate.pl' script." |
267 |
+ fi |
268 |
+ done |
269 |
+} |