Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 83036040567a4ea6c0fca07cb4614dc3 > files > 18

zoneminder-1.25.0-23.mga3.src.rpm

%define zmuid   apache
%define zmgid   apache
%define upstream_name ZoneMinder
%define moover  1.2.5
%define camver  0.92
#%%define subrel 1

Name:           zoneminder
Version:        1.25.0
Release:        %mkrel 23
Summary:        Video Camera and CCTV Security with Motion Detection
Group:          Security
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-%{camver}.tar.gz
Source2:        %{name}.conf
Source3:        redalert.wav
Source4:        README.Mageia
Source5:        http://mootools.net/download/get/mootools-%{moover}-core-yc.js
Source6:        zmrestart
Source7:        zmstop
Source8:        zmsetup
Source9:        %{name}.service

# Performance patch by Kfir Itzhak 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-20120717.patch
# Remove hack and let rpm set permissions
Patch1:         zm_1_25_0-chown.patch
# Patch zm_create.sql.in (the Fedora/Mdv append method fails)
Patch2:         zm_1_25_0-zm_create.sql.patch
Patch3:         zm-1.25.0-mga-changes_for_ffmpeg-0.11.patch
# Patch to work around v4l2 api breakage in 3.5 kernel thanks to Fedora
Patch4:         zm-1.25.0-fda-fix_kernel_3.5-zm_local_camera.cpp.patch
# Fix build with automake-1.13
Patch5:         zm-1.25.0-mga-fix-build-with-automake-1.13.patch
# CVE-2013-0232 (arbitrary command execution vulnerability)
Patch6:         zm-1.25.0-mga-CVE-2013-0232.patch

BuildRequires:  mysql-devel
BuildRequires:  jpeg-devel
BuildRequires:  gnutls-devel
BuildRequires:  java-devel >= 1:1.7.0
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
BuildRequires:  ffmpeg-devel

Requires(post): rpm-helper >= 0.24.8-1
Requires(preun): rpm-helper >= 0.24.8-1
Requires:       apache >= 2.4
Requires:       php
Requires:       php-mysql
Requires:       php-sockets
Requires:       apache-mod_php
Requires:       perl-Archive-Zip
Requires:       perl-Archive-Tar
Requires:       perl-DBD-mysql
Requires:       perl-MIME-Lite
Requires:       perl-MIME-tools
Requires:       perl-Net-SSH-Expect
Requires:       perl-Net-SFTP-Foreign
Requires:       perl-X10
Requires:       ffmpeg
Suggests:       mysql

%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 -a 1 -n %{upstream_name}-%{version}
   
%patch0 -p1 -b .zm_1_25_0-mga-perfpatch-kfir-20120717.patch
%patch1 -p1 -b .zm_1_25_0-chown.patch
%patch2 -p0 -b .zm_1_25_0-zm_create.sql.patch
%patch3 -p1 -b .zm-1.25.0-mga-changes_for_ffmpeg-0.11.patch
%patch4 -p0 -b .zm-1.25.0-fda-fix_kernel_3.5-zm_local_camera.cpp.patch
%patch5 -p0 -b .zm-1.25.0-mga-fix-build-with-automake-1.13.patch
%patch6 -p1 -b .zm-1.25.0-mga-CVE-2013-0232.patch

cp %{SOURCE4} README.Mageia

pushd cambozola-%{camver}
%ant
popd

%build
autoreconf

%configure2_5x \
    --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 \
    --with-ffmpeg=%{_prefix} \
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
%makeinstall_std 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-%{camver}/dist/cambozola.jar  %{buildroot}%{_localstatedir}/www/html/zm/cambozola.jar

install -d -m 755 %{buildroot}%{_datadir}/%{name}
install -d -m 755 db %{buildroot}%{_datadir}/%{name}/db
install -m 644 db/*.sql %{buildroot}%{_datadir}/%{name}/db

install -D -m 644 %{SOURCE2} %{buildroot}%{_webappconfdir}/%{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 %{SOURCE6} %{buildroot}%{_bindir}/zmrestart
install -D -m 755 %{SOURCE7} %{buildroot}%{_bindir}/zmstop
install -D -m 755 %{SOURCE8} %{buildroot}%{_bindir}/zmsetup

install -D -m 644 scripts/zmlogrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/zm
install -D -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/%{name}.service

# Install mootools
pushd %{buildroot}%{_localstatedir}/www/html/zm
install -m 644 %{SOURCE5} mootools-%{moover}-core-yc.js
ln -s mootools-%{moover}-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) %{_webappconfdir}/%{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
%{_datadir}/%{name}
%attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/html/zm
%dir %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/log/zm
%{_sysconfdir}/logrotate.d/zm



%changelog

* Fri Mar 22 2013 barjac <barjac> 1.25.0-23.mga3
+ Revision: 404522
- check for mysql in zmsetup and offer to install
- suggest mysql

* Sat Mar 16 2013 barjac <barjac> 1.25.0-22.mga3.tainted
+ Revision: 403486
- patch - CVE-2013-0232 (arbitrary command execution vulnerability)

* Mon Jan 14 2013 umeabot <umeabot> 1.25.0-21.mga3.tainted
+ Revision: 387773
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Tue Jan 08 2013 fwang <fwang> 1.25.0-20.mga3.tainted
+ Revision: 341755
- rebuild for new ffmpeg

* Sat Jan 05 2013 barjac <barjac> 1.25.0-19.mga3.tainted
+ Revision: 338866
- fix build with automake-1.13
- re-enumerate patches

  + kamil <kamil>
    - add P10: zoneminder-1.25.0-mga-fix-build-with-automake-1.13.patch

* Sat Dec 01 2012 fwang <fwang> 1.25.0-18.mga3.tainted
+ Revision: 323865
- there is no ffmpeg-static
- rebuild for new pcre

* Thu Sep 27 2012 barjac <barjac> 1.25.0-17.mga3.tainted
+ Revision: 298811
- Change group from Video to Security to fit new policy

* Wed Sep 26 2012 barjac <barjac> 1.25.0-16.mga3
+ Revision: 297850
- Added BR/Requires on turbo-jpeg for improved performance

* Tue Sep 11 2012 guillomovitch <guillomovitch> 1.25.0-15.mga3.tainted
+ Revision: 292434
- drop useless explicit perl dependencies computed automatically

* Tue Sep 11 2012 barjac <barjac> 1.25.0-15.mga3
+ Revision: 292235
- Patch to work around v4l2 api breakage in 3.5 kernel
- Removed stray patch that was re-named a while back

  + guillomovitch <guillomovitch>
    - renumerate sources for sake of readability
    - cleanup files part
    - no dependency on mysql
    - cleanup setup part
    - don't replicate %%configure arguments
    - cleanup installation
    - drop sysinit support
    - use _webappconfdir macro

* Wed Jul 25 2012 barjac <barjac> 1.25.0-14.mga3.tainted
+ Revision: 274157
- new perfpatch with deinterlace
- new version of mootools and define for version
- added define for cambozala version
- improved systemd unit file to not need zmstop
- changed zmstop utility to use systemctl
- include ffmpeg in core build
- remove gcc4.7 patches as now in perfpatch
- remove avcodec detect patch as now in perfpatch
- drop lmp3lame in tainted as not needed
- remove unneeded BR ffmpeg
- moved zoneminder.conf to sites.d
- updated zoneminder.conf for apache 2.4
- added min version require for apache >= 2.4

* Mon Jul 16 2012 barjac <barjac> 1.25.0-13.mga3.tainted
+ Revision: 271539
- re-name ffmpeg patch for consistency - and policy
- fix warnings in cambozala build with BR on minimum JDK version

* Mon Jul 16 2012 barjac <barjac> 1.25.0-12.mga3.tainted
+ Revision: 271422
- modified and re-added ffmpeg patch to not add includes
- remove BR ffmpeg-static-devel
- Patched configure.ac to correctly detect presence of libavcodec

  + neoclust <neoclust>
    - Start to port to new ffmpeg

* Tue Jul 10 2012 barjac <barjac> 1.25.0-11.mga3
+ Revision: 269149
- rebuild against gcc-4.7
- patched to fix build fail due to missing includes in gcc-4.7
- fix from bug 6462 mga2 applied to mga3

* Fri May 11 2012 barjac <barjac> 1.25.0-10.mga2.tainted
+ 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