Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %define zmuid apache
- %define zmgid apache
- %define tainted 0
- %if "%distro_section" == "tainted"
- %global tainted 1
- %endif
- Name: zoneminder
- Version: 1.25.0
- Release: %mkrel 1
- Summary: Video Camera and CCTV Security with Motion Detection
- Group: Video
- URL: http://www.zoneminder.com/
- License: GPLv2+ and MIT
- # Mootools is under the MIT license: http://mootools.net/
- # http://www.opensource.org/licenses/mit-license.php
- Source: http://www.zoneminder.com/fileadmin/downloads/ZoneMinder-%{version}.tar.gz
- Source1: www.charliemouse.com/code/cambozola/cambozola-0.92.tar.gz
- Source2: zoneminder.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: zoneminder.service
- # Removes hack and lets 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
- # Patch for typo bug in zmupdate.pl
- Patch7: zm-1_25_0-zmupdate.pl.in.patch
- BuildRequires: mysql-devel libjpeg-static-devel gnutls-devel
- BuildRequires: ant libgcrypt-devel pcre-devel
- BuildRequires: perl-Archive-Zip perl-Archive-Tar perl-MIME-tools perl-DBD-mysql
- BuildRequires: perl-Sys-Mmap perl-Device-SerialPort perl-MIME-Lite perl-Date-Manip
- BuildRequires: perl-libwww-perl
- BuildRequires: perl-X10 perl-Net-SSH-Expect perl-Net-SFTP-Foreign
- %if %{tainted}
- BuildRequires: ffmpeg-devel ffmpeg
- %endif
- Requires: apache mysql php php-mysql php-sockets apache-mod_php
- Requires: perl-Archive-Zip perl-Archive-Tar perl-MIME-tools perl-DBD-mysql
- Requires: perl-Sys-Mmap perl-Device-SerialPort perl-MIME-Lite perl-Date-Manip
- Requires: perl-libwww-perl
- Requires: perl-X10 perl-Net-SSH-Expect perl-Net-SFTP-Foreign
- %if %{tainted}
- Requires: ffmpeg 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.
- %prep
- %setup -q -n ZoneMinder-%{version}
- %patch3 -p1 -b .zm_1_24_4-chown.patch
- %patch4 -p0 -b .zm_1_24_4-zm_create.sql.patch
- %patch7 -p0 -b .zm-1_24_4-zmupdate.pl.in.patch
- cp %{SOURCE4} README.Mageia
- %setup -q -D -T -a 1 -n ZoneMinder-%{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
- rm -rf $RPM_BUILD_ROOT
- install -d $RPM_BUILD_ROOT/var/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
- for dir in events images temp
- do
- install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/$dir
- done
- install -D -m 775 cambozola-0.92/dist/cambozola.jar $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/cambozola.jar
- install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
- install -D -m 755 scripts/zm $RPM_BUILD_ROOT%{_initrddir}/zoneminder
- install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
- install -d -m 755 db $RPM_BUILD_ROOT%{_datadir}/%{name}/db
- install -D -m 755 db/* $RPM_BUILD_ROOT%{_datadir}/%{name}/db
- install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/zoneminder.conf
- install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/sounds/redalert.wav
- install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zm
- install -D -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_bindir}/zmsetup
- install -D -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/zmrestart
- install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
- install -m 644 scripts/zmlogrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zm
- install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/tmp/zm
- install -d -m 755 $RPM_BUILD_ROOT/lib/systemd/system
- install -D -m 755 %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/system/zoneminder.service
- # Install mootools
- pushd $RPM_BUILD_ROOT%{_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 zoneminder
- %preun
- %_preun_service zoneminder
- %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/zoneminder.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}/zmrestart
- /lib/systemd/system/zoneminder.service
- %{perl_vendorlib}/ZoneMinder*
- %{_mandir}/man*/*
- %{_localstatedir}/www/cgi-bin
- %{_datadir}/%{name}/*
- %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/html/zm
- %dir %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/log/zm
- %attr(755,root,root) %{_initrddir}/zoneminder
- %{_sysconfdir}/logrotate.d/zm
- %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/tmp/zm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement