%define zmuid apache %define zmgid apache %define upstream_name ZoneMinder %define tainted 0 %define subrel 2 %if "%distro_section" == "tainted" %global tainted 1 %endif Name: zoneminder Version: 1.25.0 Release: %mkrel 10 Summary: Video Camera and CCTV Security with Motion Detection Group: Video URL: http://www.%{name}.com/ License: GPLv2+ and MIT # Mootools is under the MIT license: http://mootools.net/ # http://www.opensource.org/licenses/mit-license.php Source: http://www2.%{name}.com/downloads/%{upstream_name}-%{version}.tar.gz Source1: www.charliemouse.com/code/cambozola/cambozola-0.92.tar.gz Source2: %{name}.conf Source3: redalert.wav Source4: README.Mageia Source5: zmrestart Source6: http://mootools.net/download/get/mootools-1.2.3-core-yc.js Source7: zmsetup Source8: %{name}.service Source9: zmstop # Performance patch by Kfir Itzhak updated 3/4/2012 from ZoneMinder-kfir git. # git clone https://github.com/mastertheknife/ZoneMinder-kfir # git checkout perfpatch # Create diff against stock ZoneMinder Patch0: zm_1_25_0-mga-perfpatch-kfir-20120403.patch # Remove hack and let rpm set permissions Patch3: zm_1_25_0-chown.patch # Patch zm_create.sql.in (the Fedora/Mdv append method fails) Patch4: zm_1_25_0-zm_create.sql.patch # CVE-2013-0232 (arbitrary command execution vulnerability) Patch5: zm-1.25.0-mga-CVE-2013-0232.patch BuildRequires: mysql-devel BuildRequires: libjpeg-static-devel BuildRequires: gnutls-devel BuildRequires: ant BuildRequires: libgcrypt-devel BuildRequires: pcre-devel BuildRequires: perl-Archive-Zip BuildRequires: perl-Archive-Tar BuildRequires: perl-MIME-tools BuildRequires: perl-DBD-mysql BuildRequires: perl-Sys-Mmap BuildRequires: perl-Device-SerialPort BuildRequires: perl-MIME-Lite BuildRequires: perl-Date-Manip BuildRequires: perl-libwww-perl BuildRequires: perl-X10 BuildRequires: perl-Net-SSH-Expect BuildRequires: perl-Net-SFTP-Foreign %if %{tainted} BuildRequires: ffmpeg-devel BuildRequires: ffmpeg %endif Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 Requires: apache Requires: mysql Requires: php Requires: php-mysql Requires: php-sockets Requires: apache-mod_php Requires: perl-Archive-Zip Requires: perl-Archive-Tar Requires: perl-MIME-tools Requires: perl-DBD-mysql Requires: perl-Sys-Mmap Requires: perl-Device-SerialPort Requires: perl-MIME-Lite Requires: perl-Date-Manip Requires: perl-libwww-perl Requires: perl-X10 Requires: perl-Net-SSH-Expect Requires: perl-Net-SFTP-Foreign %if %{tainted} Requires: ffmpeg Requires: lame %endif %description A CCTV security package with remote access, motion detection and recording. ZoneMinder is intended for use in single or multi-camera video security applications, including commercial or home CCTV. It supports capture, analysis, recording, and monitoring of video data coming from one or more video or network cameras attached to a Linux system. ZoneMinder also supports web and semi-automatic control of Pan/Tilt/Zoom cameras using a variety of protocols. It is designed to run on distributions which support the Video For Linux (V4L) interface and has been tested with video cameras attached to BTTV cards, various USB cameras and also supports most IP network cameras. With thanks to Kfir Itzhak aka "mastertheknife" for his extensive performance enhancements which are included in this version. %prep %setup -q -n %{upstream_name}-%{version} %patch0 -p1 -b .zm_1_25_0-mga-perfpatch-kfir-20120403.patch %patch3 -p1 -b .zm_1_25_0-chown.patch %patch4 -p0 -b .zm_1_25_0-zm_create.sql.patch %patch5 -p1 -b .zm-1.25.0-mga-CVE-2013-0232.patch cp %{SOURCE4} README.Mageia %setup -q -D -T -a 1 -n %{upstream_name}-%{version} pushd cambozola-0.92 %ant popd %build aclocal autoconf automake %configure \ --prefix=%{_prefix} \ --mandir=%{_datadir}/man \ --infodir=%{_datadir}/info \ --datadir=%{_datadir} \ --sysconfdir=%{_sysconfdir} \ --localstatedir=%{_localstatedir}/lib \ --with-libarch=lib \ --with-mysql=%{_prefix} \ --with-webdir=%{_localstatedir}/www/html/zm \ --with-cgidir=%{_localstatedir}/www/cgi-bin \ --with-webuser=%{zmuid} \ --with-webgroup=%{zmgid} \ --enable-mmap=yes \ --disable-debug \ --disable-crashtrace \ %if %{tainted} --with-ffmpeg=%{_prefix} \ --with-extralibs="-lmp3lame" \ %endif CPPFLAGS="-D__STDC_CONSTANT_MACROS" \ LDFLAGS="$LDFLAGS -Wl,--build-id" %make %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid}/;' \ -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid}/;' zm.conf %install install -d %{buildroot}/var/run make install DESTDIR=%{buildroot} INSTALLDIRS=vendor rm -rf %{buildroot}%{perl_vendorarch} %{buildroot}%{perl_archlib} rm -f %{buildroot}%{_bindir}/zmx10.pl for dir in events images temp do install -m 755 -d %{buildroot}%{_localstatedir}/www/html/zm/$dir done install -D -m 775 cambozola-0.92/dist/cambozola.jar %{buildroot}%{_localstatedir}/www/html/zm/cambozola.jar install -d -m 755 %{buildroot}%{_localstatedir}/log/%{name} install -D -m 755 scripts/zm %{buildroot}%{_initrddir}/%{name} install -d -m 755 %{buildroot}%{_datadir}/%{name} install -d -m 755 db %{buildroot}%{_datadir}/%{name}/db install -D -m 755 db/*.sql %{buildroot}%{_datadir}/%{name}/db install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf install -D -m 755 %{SOURCE3} %{buildroot}%{_localstatedir}/www/html/zm/sounds/redalert.wav install -d -m 755 %{buildroot}%{_localstatedir}/log/zm install -D -m 755 %{SOURCE7} %{buildroot}%{_bindir}/zmsetup install -D -m 755 %{SOURCE5} %{buildroot}%{_bindir}/zmrestart install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d install -m 644 scripts/zmlogrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/zm install -d -m 755 %{buildroot}%{_unitdir} install -D -m 755 %{SOURCE8} %{buildroot}%{_unitdir}/%{name}.service install -D -m 755 %{SOURCE9} %{buildroot}%{_bindir}/zmstop # Install mootools pushd %{buildroot}%{_localstatedir}/www/html/zm install -m 644 %{SOURCE6} mootools-1.2.3-core-yc.js ln -s mootools-1.2.3-core-yc.js mootools.js popd cat > README.urpmi <<EOF ZoneMinder is now installed. Mageia has included a script to simplify setup. It will help you to create a mysql root password, a new ZoneMinder mysql database, or update from a previously installed version. It will then start Mysql, Apache and ZoneMinder on completion. To use it enter the following command as root in a terminal:- zmsetup EOF %post %_post_service %{name} %preun %_preun_service %{name} %files %doc AUTHORS COPYING README README.Mageia README.urpmi %config(noreplace) %attr(640,root,%{zmgid}) %{_sysconfdir}/zm.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/%{name}.conf %{_bindir}/zma %{_bindir}/zmaudit.pl %{_bindir}/zmc %{_bindir}/zmcontrol.pl %{_bindir}/zmdc.pl %{_bindir}/zmf %{_bindir}/zmfilter.pl %attr(4755,root,root) %{_bindir}/zmfix %{_bindir}/zmpkg.pl %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu %{_bindir}/zmupdate.pl %{_bindir}/zmvideo.pl %{_bindir}/zmwatch.pl %{_bindir}/zmstreamer %{_bindir}/zmsetup %{_bindir}/zmstop %{_bindir}/zmrestart %{_unitdir}/%{name}.service %{perl_vendorlib}/%{upstream_name}* %{_mandir}/man*/* %{_localstatedir}/www/cgi-bin %dir %{_datadir}/%{name} %{_datadir}/%{name}/* %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/html/zm %dir %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/log/zm %attr(755,root,root) %{_initrddir}/%{name} %{_sysconfdir}/logrotate.d/zm %changelog * Sat Mar 16 2013 barjac <barjac> 1.25.0-10.2.mga2 + Revision: 403490 - patch - CVE-2013-0232 (arbitrary command execution vulnerability) - fix unit file by adding zmstop script - bug #6462 * Fri May 11 2012 barjac <barjac> 1.25.0-10.mga2 + Revision: 235332 - Fix in unit file for bug #5805 * Sat Apr 28 2012 tmb <tmb> 1.25.0-9.mga2.tainted + Revision: 233913 - Require rpm-helper >= 0.24.8-1 for systemd support * Mon Apr 09 2012 barjac <barjac> 1.25.0-8.mga2.tainted + Revision: 229835 - new perfpatch with various bug fixes - fix spec bugs that installed a makefile and left a stray folder after uninstall - improved README.mageia - removed old patches that are now included in patch0 + dmorgan <dmorgan> - Add ExecReload support in systemd file ( Fedora) * Mon Feb 20 2012 barjac <barjac> 1.25.0-7.mga2.tainted + Revision: 211184 - Patch to fix bug in zmwatch.js that was filling error log - Added User= to unit file to fix zm processes running with wrong cgroup - Added ExecStop= to unit file to allow systemctl to stop zm processes correctly - Fix typo in zmrestart script that was giving wrong error message * Mon Jan 30 2012 barjac <barjac> 1.25.0-6.mga2.tainted + Revision: 203335 - Fix bug (typo) in zmsetup script * Sat Jan 21 2012 barjac <barjac> 1.25.0-5.mga2.tainted + Revision: 199305 - Updated zmsetup and zmrestart scripts to systemd * Thu Dec 22 2011 barjac <barjac> 1.25.0-4.mga2.tainted + Revision: 185583 - Added performance patch - bump release * Tue Dec 20 2011 barjac <barjac> 1.25.0-3.mga2.tainted + Revision: 184679 - Rebuild against mariadb - Minor text edit in spec * Fri Nov 04 2011 shlomif <shlomif> 1.25.0-2.mga2.tainted + Revision: 162984 - Fixed the /tmp thing. - New mkrel for rebuild due to package failure - New version with systemd support. * Thu Oct 06 2011 shlomif <shlomif> 1.24.4-8.mga2.tainted + Revision: 152451 - Fixed bugs in zmsetup and zmupdate.pl, added logrotate, added LSB header to init. Thanks to barjac. * Fri Sep 23 2011 shlomif <shlomif> 1.24.4-7.mga2.tainted + Revision: 147001 - Add perl-X10 as requires. Thanks to barjac - imported package zoneminder * Tue Sep 20 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-6 - cambozola.jar removed from SOURCES and now built from source. * Mon Sep 19 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-5 - Corrections to BuildRequires and Requires * Fri Sep 16 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-4 - Patched to avoid format-security errors when using configure macro. - Removed hostname feature from zmsetup as beyond scope. * Thu Sep 15 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-3 - Corrected various source permissions and description line lengths. - Improved zmsetup to change hostname if required. - Removed requirement for sse2 * Tue Sep 13 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-2 - Removed jscalendar as it is apparently not requiired. - Added zmrestart script as it can be useful. * Sun Sep 11 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-1 - Added Require: php-sockets, README.urpmi, distro_section for tainted builds. * Thu Sep 8 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-0 - New package for Mageia. - Includes the performance patch by Kfir Itzhak :- - http://www.zoneminder.com/forums/viewtopic.php?f=9&t=17652