Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37409745
en ru br
Репозитории ALT
S:1.36.33-alt2
4.1: 1.23.3-alt2
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: zoneminder

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define zmuid $(id -un)
%define zmgid $(id -gn)
%define zmuid_final apache
%define zmgid_final apache

Name: zoneminder
Version: 1.23.3
Release: alt2
Summary: A camera monitoring and analysis tool
Group: System/Servers
License: GPL
Url: http://www.zoneminder.com/

Packager: Denis Medvedev <nbr at altlinux.ru>

Source: ZoneMinder-%version.tar.bz2
Source1: cambozola-%version.tar.bz2
Source2: zoneminder.conf
Source3: redalert.wav
Source4: README.alt
Patch1: zoneminder-1.22.3-dbinstall.patch
Patch10: zoneminder-1.22.3-installfix.patch

Conflicts: zm <= 1.22.3

BuildPreReq: automake libgnutls-devel libgnutls-openssl-devel zlib-devel-static ffmpeg ffmpeg-devel
BuildPreReq: mysql-devel pcre-devel libjpeg-devel gcc-c++ perl-PHP-Serialization
BuildPreReq: perl-DBD-mysql perl-Class-Date perl-DateTime perl-Date-Manip   perl-LWP-Parallel perl-devel perl-Module-Build perl-Module-Install
Requires: libgnutls libgnutls-openssl  zlib perl-Class-Date perl-DateTime perl-Date-Manip perl-LWP-Parallel apache-mod_perl ffmpeg
Requires: perl-DBD-mysql
Requires: perl-Storable
Requires: MySQL-client
Requires: php5-mysql
Requires: su

Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

AutoReq: noperl
%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.

%package apache
Summary: Configuration file and requires zoneminder for apache
Group: Networking/WWW
Requires: apache apache-mod_php5
%description apache
Configuration file and requires zoneminder for apache

%prep
%setup -n ZoneMinder-%version
%patch1 -p0 -b .dbinstall
%patch10 -p0 -b .installfix
bunzip2 -c %SOURCE1 | tar xf -  cambozola-%version/dist/cambozola.jar
cp %SOURCE4 README.alt

cat <<EOF >> 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' at localhost identified by 'zmpass';
EOF

%build
autoreconf

OPTS=""
%ifnarch %ix86 x86_64
OPTS="$OPTS --disable-crashtrace"
%endif

%configure \
--with-libarch=%_lib \
--with-mysql=%prefix \
--with-webdir=%_datadir/%name/www \
--with-cgidir=%_libexecdir/%name/cgi-bin \
--with-webuser=%zmuid \
--with-webgroup=%zmgid \
--disable-debug \
--enable-ffmpeg \
$OPTS
make %{?_smp_mflags}
perl -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid_final}/;' \
   -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid_final}/;' zm.conf

%install
install -d %buildroot%_localstatedir/run
%make_install install DESTDIR=%buildroot \
    INSTALLDIRS=vendor
rm -rf %buildroot%prefix/%_lib/perl5/vendor_perl/*.*/*-*
rm -rf %buildroot%prefix/%_lib/perl5/*.*/*-*
rm -f %buildroot%_bindir/zmx10.pl

install -m 755 -d %buildroot%_localstatedir/log/zoneminder
for dir in events images temp
do
install -m 755 -d %buildroot%_localstatedir/lib/zoneminder/$dir
rmdir %buildroot%_datadir/%name/www/$dir
ln -sf ../../../..%_localstatedir/lib/zoneminder/$dir %buildroot%_datadir/%name/www/$dir
done
install -D -m 755 scripts/zm %buildroot%_initdir/zoneminder
install -D -m 644 cambozola-*/dist/cambozola.jar %buildroot%_datadir/%name/www/cambozola.jar
install -D -m 644 %SOURCE2 %buildroot%_sysconfdir/httpd/conf/addon-modules.d/zoneminder.conf
install -D -m 644  zm.conf %buildroot%_sysconfdir/zm.conf  
install -D -m 755 %SOURCE3 %buildroot%_datadir/%name/www/sounds/redalert.wav

%post
/sbin/chkconfig --add zoneminder

%post apache
%post_service httpd

%preun apache
%preun_service httpd

%preun
if [ $1 -eq 0 ]; then
/sbin/service zoneminder stop > /dev/null 2>&1 || :
/sbin/chkconfig --del zoneminder
fi

%postun
if [ $1 -ge 1 ]; then
/sbin/service zoneminder condrestart > /dev/null 2>&1 || :
fi

%files
%doc AUTHORS COPYING README  README.alt
%config(noreplace) %_sysconfdir/zm.conf
%_initdir/zoneminder

%_bindir/zma
%_bindir/zmaudit.pl
%_bindir/zmc
%_bindir/zmdc.pl
%_bindir/zmf
%_bindir/zmfilter.pl
%_bindir/zmfix
%_bindir/zmpkg.pl
%_bindir/zmtrack.pl
%_bindir/zmtrigger.pl
%_bindir/zmu
%_bindir/zmupdate.pl
%_bindir/zmvideo.pl
%_bindir/zmwatch.pl
%_bindir/zmcontrol.pl

%perl_vendorlib/ZoneMinder*
%_mandir/man*/*
%dir %_libexecdir/%name
%_libexecdir/%name/cgi-bin
%dir %_datadir/%name
%dir %_datadir/ZoneMinder
%dir %_datadir/ZoneMinder/db
%_datadir/ZoneMinder/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

%files apache
%config(noreplace) %_sysconfdir/httpd/conf/addon-modules.d/zoneminder.conf

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin