%define zmuid $(id -un) %define zmgid $(id -gn) %define zmuid_final apache %define zmgid_final apache Name: zoneminder Version: 1.25.0 Release: 14 Summary: A camera monitoring and analysis tool Group: System Environment/Daemons # jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/ # Mootools is inder the MIT license: http://mootools.net/ License: GPLv2+ and LGPLv2+ and MIT URL: http://www.zoneminder.com/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source: http://www.zoneminder.com/fileadmin/downloads/ZoneMinder-%{version}.tar.gz Source1: http://www.charliemouse.com/code/cambozola/cambozola-0.68.tar.gz Source2: zoneminder.conf Source3: redalert.wav Source4: README.Atomic Source5: http://downloads.sourceforge.net/jscalendar/jscalendar-1.0.zip Source6: http://mootools.net/download/get/mootools-1.2.3-core-yc.js Source7: zoneminder.logrotate Source8: zoneminder.service Patch1: zoneminder-1.25.0-dbinstall.patch Patch2: zoneminder-1.24.3-runlevel.patch Patch3: zoneminder-1.25.0-noffmpeg-2.patch Patch10: zoneminder-1.24.4-installfix.patch Patch11: zoneminder-1.25.0-gcc47.patch Patch12: zoneminder-1.25.0-gcrypt-2.patch Patch13: zoneminder-1.25.0-kernel35.patch Patch14: zoneminder-1.25.0-perf.patch Conflicts: zm <= 1.22.3 BuildRequires: automake gnutls-devel BuildRequires: mysql-devel pcre-devel libjpeg-devel BuildRequires: perl(Archive::Tar) perl(Archive::Zip) BuildRequires: perl(Date::Manip) perl(DBD::mysql) BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) BuildRequires: perl(MIME::Entity) perl(MIME::Lite) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(Time::HiRes) Requires: httpd php php-mysql Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip) Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP) %if 0%{?fedora} >= 17 BuildRequires: systemd-units Requires: cambozola Requires(post): systemd-units systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units %else Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service Requires(postun): /sbin/service %endif %description ZoneMinder is a set of applications which is intended to provide a complete solution allowing you to capture, analyse, record and monitor any cameras you have attached to a Linux based machine. It is designed to run on kernels which support the Video For Linux (V4L) interface and has been tested with cameras attached to BTTV cards, various USB cameras and IP network cameras. It is designed to support as many cameras as you can attach to your computer without too much degradation of performance. This package includes cambozola.jar. %prep %setup -q -n ZoneMinder-%{version} # Unpack jscalendar and move some files around %setup -q -D -T -a 5 -n ZoneMinder-%{version} mkdir jscalendar-doc pushd jscalendar-1.0 mv *html *php doc/* README ../jscalendar-doc rmdir doc popd %patch14 -p1 %patch1 -p0 -b .dbinstall %patch2 -p0 -b .runlevel %patch3 -p1 -b .noffmpeg %patch10 -p0 -b .installfix # patch14 covers this # %patch11 -p0 -b .gcc47 %patch12 -p1 -b .gcrypt #%patch13 -p0 -b .kernel35 gunzip -c %{SOURCE1} | tar xf - cambozola-*/dist/cambozola.jar cp %{SOURCE4} README.Atomic chmod -x src/zm_event.cpp src/zm_user.h #cat <> db/zm_create.sql.in #update Config set Value = '/cgi-bin/zm/nph-zms' where Name = 'ZM_PATH_ZMS'; #use mysql; #grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass'; #EOF %build autoreconf OPTS="" %ifnarch %{ix86} x86_64 OPTS="$OPTS --disable-crashtrace" %endif export ZM_RUNDIR=/var/run/zoneminder export ZM_TMPDIR=/var/lib/zoneminder/temp %configure \ --with-libarch=%{_lib} \ --with-mysql=%{_prefix} \ --with-webdir=%{_datadir}/%{name}/www \ --with-cgidir=%{_libexecdir}/%{name}/cgi-bin \ --with-webuser=%{zmuid} \ --with-webgroup=%{zmgid} \ --enable-mmap=yes \ --disable-debug \ $OPTS make %{?_smp_mflags} # Have to do this now because the configure script wipes out modifications made to this file cat <> db/zm_create.sql # Fedora change: # Alter some default paths to match the default URL and selinux expectations update Config set Value = '/cgi-bin/zm/nph-zms' where Name = 'ZM_PATH_ZMS'; update Config set Value = '/var/log/zoneminder' where Name = 'ZM_PATH_LOGS'; update Config set Value = '/var/log/zoneminder/zm_debug_log+' where Name = 'ZM_EXTRA_DEBUG_LOG'; update Config set Value = '/var/log/zoneminder/zm_xml.log' where Name = 'ZM_EYEZM_LOG_FILE'; update Config set Value = '/var/lib/zoneminder/sock' where Name = 'ZM_PATH_SOCKS'; update Config set Value = '/var/lib/zoneminder/swap' where Name = 'ZM_PATH_SWAP'; update Config set Value = '/var/spool/zoneminder-upload' where Name = 'ZM_UPLOAD_FTP_LOC_DIR'; EOF make %{?_smp_mflags} %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid_final}/;' \ -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid_final}/;' zm.conf %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_localstatedir}/run make install DESTDIR=$RPM_BUILD_ROOT \ INSTALLDIRS=vendor rm -rf $RPM_BUILD_ROOT%{perl_vendorarch} $RPM_BUILD_ROOT%{perl_archlib} rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder for dir in events images temp do install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/zoneminder/$dir rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/www/$dir ln -sf ../../../..%{_localstatedir}/lib/zoneminder/$dir $RPM_BUILD_ROOT%{_datadir}/%{name}/www/$dir done install -m 755 -d %{buildroot}/var/lib/zoneminder/sock install -m 755 -d %{buildroot}/var/lib/zoneminder/swap install -m 755 -d %{buildroot}/var/spool/zoneminder-upload install -D -m 644 %{SOURCE2} %{buildroot}/etc/httpd/conf.d/zoneminder.conf install -D -m 755 %{SOURCE3} %{buildroot}/%{_datadir}/zoneminder/www/sounds/redalert.wav %if 0%{?fedora} >= 17 install -D -m 644 %{SOURCE6} %{buildroot}/%{_unitdir}/zoneminder.service # Set up cambozola pushd %{buildroot}/%{_datadir}/zoneminder/www ln -s ../../java/cambozola.jar popd install -d -m 755 %{buildroot}/etc/tmpfiles.d cat > %{buildroot}/etc/tmpfiles.d/zoneminder.conf <= 17 /bin/systemctl daemon-reload >/dev/null 2>&1 || : %else /sbin/chkconfig --add zoneminder %endif fi %preun if [ $1 -eq 0 ]; then %if 0%{?fedora} >= 17 # Package removal, not upgrade /bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || : /bin/systemctl stop zoneminder.service > /dev/null 2>&1 || : %else /sbin/service zoneminder stop > /dev/null 2>&1 || : /sbin/chkconfig --del zoneminder %endif %postun %if 0%{?fedora} >= 17 /bin/systemctl daemon-reload >/dev/null 2>&1 || : %endif if [ $1 -ge 1 ]; then # Package upgrade, not uninstall %if 0%{?fedora} >= 17 /bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || : %else /sbin/service zoneminder condrestart > /dev/null 2>&1 || : %endif fi %files %defattr(-,root,root,-) %doc AUTHORS COPYING README README.Atomic jscalendar-doc %config(noreplace) %attr(640,root,%{zmgid_final}) %{_sysconfdir}/zm.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/zoneminder.conf %attr(755,root,root) %{_initrddir}/zoneminder %config(noreplace) /etc/logrotate.d/zoneminder %{_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}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu %{_bindir}/zmupdate.pl %{_bindir}/zmvideo.pl %{_bindir}/zmwatch.pl %{perl_vendorlib}/ZoneMinder* %{_mandir}/man*/* %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/cgi-bin %dir %{_datadir}/%{name} %{_datadir}/%{name}/db %{_datadir}/%{name}/www %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/events %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/images %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/temp %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/log/zoneminder %changelog * Wed Feb 20 2013 Scott R. Shinn - 1.25.0-13 - Update to 1.25.0 - Merge in performance patch * Fri Dec 4 2009 Stepan Kasal - 1.24.2-4 - rebuild against perl 5.10.1 - use Perl vendorarch and archlib variables correctly * Mon Jul 27 2009 Fedora Release Engineering - 1.24.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Jul 22 2009 Jason L Tibbitts III - 1.24.2-2 - Bump release since 1.24.2-1 was mistakenly tagged a few months ago. * Wed Jul 22 2009 Jason L Tibbitts III - 1.24.2-1 - Initial update to 1.24.2. - Rebase patches. - Update mootools download location. - Update to mootools 1.2.3. - Add additional dependencies for some optional features. * Sat Apr 11 2009 Martin Ebourne - 1.24.1-3 - Remove unused Sys::Mmap perl dependency RPM is finding * Sat Apr 11 2009 Martin Ebourne - 1.24.1-2 - Update gcc44 patch to disable -frepo, seems to be broken with gcc44 - Added noffmpeg patch to make building outside mock easier * Sat Mar 21 2009 Martin Ebourne - 1.24.1-1 - Patch for gcc 4.4 compilation errors - Upgrade to 1.24.1 * Wed Feb 25 2009 Fedora Release Engineering - 1.23.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Jan 24 2009 Caolán McNamara - 1.23.3-3 - rebuild for dependencies * Mon Dec 15 2008 Martin Ebourne - 1.23.3-2 - Fix permissions on zm.conf * Fri Jul 11 2008 Jason L Tibbitts III - 1.23.3-1 - Initial attempt at packaging 1.23. * Tue Jul 1 2008 Martin Ebourne - 1.22.3-15 - Add perl module compat dependency, bz #453590 * Tue May 6 2008 Martin Ebourne - 1.22.3-14 - Remove default runlevel, bz #441315 * Mon Apr 28 2008 Jason L Tibbitts III - 1.22.3-13 - Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3. * Tue Feb 19 2008 Fedora Release Engineering - 1.22.3-12 - Autorebuild for GCC 4.3 * Thu Jan 3 2008 Martin Ebourne - 1.22.3-11 - Fix compilation on gcc 4.3 * Thu Dec 6 2007 Martin Ebourne - 1.22.3-10 - Rebuild for new openssl * Thu Aug 2 2007 Martin Ebourne - 1.22.3-8 - Fix licence tag * Thu Jul 12 2007 Martin Ebourne - 1.22.3-7 - Fixes from testing by Jitz including missing dependencies and database creation * Sat Jun 30 2007 Martin Ebourne - 1.22.3-6 - Disable crashtrace on ppc * Sat Jun 30 2007 Martin Ebourne - 1.22.3-5 - Fix uid for directories in /var/lib/zoneminder * Tue Jun 26 2007 Martin Ebourne - 1.22.3-4 - Added perl Archive::Tar dependency - Disabled web interface due to lack of access control on the event images * Sun Jun 10 2007 Martin Ebourne - 1.22.3-3 - Changes recommended in review by Jason Tibbitts * Mon Apr 2 2007 Martin Ebourne - 1.22.3-2 - Standardised on package name of zoneminder * Thu Dec 28 2006 Martin Ebourne - 1.22.3-1 - First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin