3 # - no globs for suid/sgid files
4 # - it requires some magick to work with cambozola
5 # - check default configuration in zm_create.sql (wrong paths: /tmp/, /usr/local/bin)
8 Summary: Zone Minder is a software motion detector with nice WWW GUI
9 Summary(pl.UTF-8): Zone Minder - programowy wykrywacz ruchu z miłym GUI przez WWW
14 Group: Applications/Graphics
15 Source0: http://www.zoneminder.com/downloads/ZoneMinder-%{version}.tar.gz
16 # Source0-md5: eaefa14befd482154970541252aa1a39
19 Source3: zm-logrotate_d
20 Source4: http://dig.hopto.org/xlib_shm/xlib_shm-0.6.3.tar.bz2
21 # Source4-md5: 469a65bdf658e68e23445f5cc6f07f07
22 # http://mootools.net/download
24 Patch0: zm-fedora.patch
25 Patch1: %{name}-xlib_shm.patch
26 Patch2: %{name}-build.patch
27 Patch3: %{name}-init.patch
28 Patch4: %{name}-1.25.0-gcc47.patch
29 Patch5: %{name}-1.25.0-gcrypt.patch
30 Patch6: %{name}-1.25.0-kernel35.patch
31 Patch7: ffmpeg10.patch
32 Patch8: format-security.patch
34 Patch10: ffmpeg-2.0.patch
35 URL: http://www.zoneminder.com/
36 BuildRequires: autoconf
37 BuildRequires: automake
38 BuildRequires: bzip2-devel
39 BuildRequires: ffmpeg-devel >= 0.4.9-4.20090225
40 BuildRequires: gnutls-devel
41 BuildRequires: libjpeg-devel
42 BuildRequires: libstdc++-devel
43 BuildRequires: mysql-devel
44 BuildRequires: pcre-devel
45 BuildRequires: perl-devel
46 BuildRequires: perl-DBD-mysql
47 BuildRequires: perl-DBI
48 BuildRequires: perl-Date-Manip
49 BuildRequires: perl-libwww
50 BuildRequires: perl-PHP-Serialization
51 BuildRequires: perl-Sys-Mmap
52 BuildRequires: rpmbuild(macros) >= 1.268
53 BuildRequires: xorg-lib-libXv-devel
54 Requires(post,preun): /sbin/chkconfig
55 Requires: perl-DBD-mysql
56 Requires: perl-Date-Manip
57 Requires: perl-MIME-tools
58 Requires: perl-PHP-Serialization
59 Requires: perl-Sys-Mmap
64 Requires: webserver(php)
66 Suggests: perl-MIME-Lite
69 Obsoletes: zoneminder-X10
71 Obsoletes: zoneminder-control
72 Conflicts: apache-base < 2.4.0-1
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define specflags -D__STDC_CONSTANT_MACROS
77 %define _webapps /etc/webapps
78 %define _webapp %{name}
79 %define _appdir %{_datadir}/%{_webapp}
82 ZoneMinder is a set of applications which is intended to provide a
83 complete solution allowing you to capture, analyse, record and monitor
84 any cameras you have attached to a Linux based machine. It is designed
85 to run on kernels which support the Video For Linux (V4L) interface
86 and has been tested with cameras attached to BTTV cards, various USB
87 cameras and IP network cameras.
89 %description -l pl.UTF-8
90 ZoneMinder to zestaw aplikacji mających dostarczyć kompletne
91 rozwiązanie pozwalające na przechwytywanie, analizę, nagrywanie i
92 monitorowanie kamer podłączonych do maszyny z Linuksem. Jest
93 zaprojektowany do działania z jądrami obsługującymi interfejs Video
94 For Linux (V4L) i był testowany z kamerami podłączonymi do kart BTTV,
95 różnymi kamerami USB i sieciowymi kamerami IP.
98 %setup -q -n ZoneMinder-%{version} -a4
115 sed -i -e 's#-frepo##g' src/Makefile.am
116 sed -i -e 's#chown#true#g' -e 's#chmod#true#g' *.am */*.am */*/*.am
118 cat <<'EOF' >> db/zm_create.sql.in
119 UPDATE Config SET Value = '/cgi-bin/zoneminder/nph-zms' WHERE Name = 'ZM_PATH_ZMS';
120 UPDATE Config SET Value = '/var/run/zoneminder' WHERE Name = 'ZM_PATH_SOCKS';
121 UPDATE Config SET Value = '/var/log/zoneminder' WHERE Name = 'ZM_PATH_LOGS';
122 GRANT SELECT,INSERT,UPDATE,DELETE ON zm.* TO 'zmuser'@localhost IDENTIFIED BY 'zmpass';
130 --with-libarch=%{_lib} \
131 %ifarch %{ix86} %{x8664}
132 --enable-crashtrace \
134 --disable-crashtrace \
138 --with-mysql=%{_prefix} \
140 --with-webgroup=http \
141 --with-webuser=http \
142 --with-webdir=%{_appdir}/www \
143 --with-cgidir=%{_libdir}/%{name}/cgi-bin
148 -e 's/(ZM_WEB_USER=).*$/${1}http/;' \
149 -e 's/(ZM_WEB_GROUP=).*$/${1}http/;' zm.conf
151 %{__cc} %{rpmcflags} %{rpmldflags} xlib_shm-*/xlib_shm.c -lXv -lXext -lX11 -lmysqlclient -o zm_xlib_shm
154 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT{%{_localstatedir}/{run,log/zoneminder},/etc/logrotate.d} \
156 $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
159 DESTDIR=$RPM_BUILD_ROOT \
162 rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/vendor_perl/*.*/*-*
163 rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/*.*/*-*
164 rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
166 install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
167 for dir in events images temp
169 install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/zoneminder/$dir
170 rm -rf $RPM_BUILD_ROOT%{_appdir}/www/$dir
171 ln -sf ../../../..%{_localstatedir}/lib/zoneminder/$dir $RPM_BUILD_ROOT%{_appdir}/www/$dir
173 install -D -m 755 scripts/zm $RPM_BUILD_ROOT/etc/rc.d/init.d/zoneminder
174 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
175 install %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/www
177 install zm_xlib_shm $RPM_BUILD_ROOT%{_bindir}
179 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
182 rm -rf $RPM_BUILD_ROOT
185 /sbin/chkconfig --add zoneminder
188 if [ "$1" = "0" ]; then
189 %service zoneminder stop
190 /sbin/chkconfig --del zoneminder
193 %triggerin -- apache-base
194 %webapp_register httpd %{_webapp}
196 %triggerun -- apache-base
197 %webapp_unregister httpd %{_webapp}
199 %triggerpostun -- %{name} < 1.25.0-6
200 if [ -f %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave ]; then
201 mv %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf.rpmsave
202 echo "Old apache config has been saved as %{_webapps}/%{_webapp}/httpd.conf.rpmsave"
207 %defattr(644,root,root,755)
209 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
210 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
211 %config(noreplace) %attr(640,root,http) %{_sysconfdir}/zm.conf
212 %config(noreplace) /etc/logrotate.d/%{name}
213 %attr(754,root,root) /etc/rc.d/init.d/zoneminder
214 %attr(4755,root,root) %{_bindir}/zmfix
215 %attr(755,root,root) %{_bindir}/zma
216 %attr(755,root,root) %{_bindir}/zmaudit.pl
217 %attr(755,root,root) %{_bindir}/zmcontrol.pl
218 %attr(755,root,root) %{_bindir}/zmc
219 %attr(755,root,root) %{_bindir}/zmdc.pl
220 %attr(755,root,root) %{_bindir}/zmf
221 %attr(755,root,root) %{_bindir}/zmfilter.pl
222 %attr(755,root,root) %{_bindir}/zmpkg.pl
223 %attr(755,root,root) %{_bindir}/zmstreamer
224 %attr(755,root,root) %{_bindir}/zmtrack.pl
225 %attr(755,root,root) %{_bindir}/zmtrigger.pl
226 %attr(755,root,root) %{_bindir}/zmu
227 %attr(755,root,root) %{_bindir}/zmupdate.pl
228 %attr(755,root,root) %{_bindir}/zmvideo.pl
229 %attr(755,root,root) %{_bindir}/zmwatch.pl
230 %attr(755,root,root) %{_bindir}/zm_xlib_shm
231 %dir %{_datadir}/ZoneMinder
232 %{_datadir}/ZoneMinder/db
238 %dir %{_appdir}/www/events
239 %{_appdir}/www/graphics
240 %dir %{_appdir}/www/images
241 %{_appdir}/www/includes
245 %{_appdir}/www/sounds
246 %dir %{_appdir}/www/temp
249 %dir %{_libdir}/%{name}
250 %dir %{_libdir}/%{name}/cgi-bin
251 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/nph-zms
252 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/zms
254 %dir %attr(770,root,http) /var/log/zoneminder
255 %dir %attr(750,root,http) /var/lib/zoneminder
256 %dir %attr(770,root,http) /var/lib/zoneminder/events
257 %dir %attr(770,root,http) /var/lib/zoneminder/images
258 %dir %attr(770,root,http) /var/lib/zoneminder/temp
260 %{perl_vendorlib}/ZoneMinder
261 %{perl_vendorlib}/*.pm
262 %{_mandir}/man3/ZoneMinder*3pm*