Репозиторий Sisyphus
Последнее обновление: 27 ноября 2020 | Пакетов: 17746 | Посещений: 19700611
en ru br
Репозитории ALT
S:1.34.21-alt1
4.1: 1.23.3-alt2
www.altlinux.org/Changes

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

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

%define zmuser apache2
%define zmgroup _webserver

Name: zoneminder
Version: 1.34.9
Release: alt1
Summary: A camera monitoring and analysis tool
Group: System/Servers
License: GPLv2
Url: http://www.zoneminder.com
Source: %name-%version-alt.tar
Source1: Crud-%version.tar
Source2: CakePHP-Enum-Behavior-%version.tar
Source3: zoneminder.conf
Source4: README.alt
Source5: README-nginx-ru.alt
Source6: nginx-zoneminder.conf.sample
Source7: zm-fcgi.inc
Source8: php7-fpm-zoneminder.conf
Patch1: zoneminder-1.32.3-alt-mysql8-transition.patch

Conflicts: zm <= 1.22.3
BuildRequires(pre): rpm-macros-webserver-common
Requires: libgnutls libgnutls-openssl zlib perl-Class-Date perl-DateTime perl-Date-Manip perl-libwww ffmpeg perl-X10 perl-Sys-Mmap perl-DBD-mysql perl-Storable php7-pdo_mysql php7-openssl su perl-Data-Entropy perl-Crypt-Eksblowfish perl-Sys-Mmap webserver perl-Pod-Usage perl-Sys-MemInfo perl-Number-Bytes-Human perl-JSON-MaybeXS perl-Sys-CPU
Requires: perl-SOAP-WSDL perl-Class-Std-Fast perl-Data-UUID perl-IO-Socket-Multicast perl-Digest-SHA
AutoReq: noperl
BuildRequires: bzlib-devel ffmpeg gcc-c++ libavresample-devel libswresample-devel libavdevice-devel libavformat-devel libgcrypt-devel libgnutls-openssl-devel libjpeg-devel libmysqlclient-devel libpcre-devel libswscale-devel netpbm perl-Archive-Tar perl-Archive-Zip perl-DBD-mysql perl-Date-Manip perl-MIME-Lite perl-MIME-tools perl-Module-Load perl-Sys-Mmap perl-X10 perl-devel perl-libwww zlib-devel libpolkit-devel cmake libv4l-devel rpm-macros-cmake libvlc-devel libcurl-devel libssl-devel libsystemd-devel libffi-devel libx264-devel libmount-devel libuuid-devel libselinux-devel libblkid-devel libmp4v2

%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 api
Summary: Zoneminder Web API
Group: Networking/WWW
Requires: zoneminder
BuildArch: noarch

%description api
The API is built in CakePHP and lives under the /api directory. It provides a RESTful service
and supports CRUD (create, retrieve, update, delete) functions for Monitors, Events, Frames,
Zones and Config.

%package nginx
Summary: Zoneminder configuration file and requires for nginx
Group: Networking/WWW
Requires: php7-fpm-fcgi fcgiwrap nginx
BuildArch: noarch
%description nginx
Zoneminder configuration file and requires for nginx

%prep
%setup -n %name-%version-alt
%patch1 -p1
tar xvf %SOURCE1 --strip 1 -C web/api/app/Plugin/Crud
tar xvf %SOURCE2 --strip 1 -C web/api/app/Plugin/CakePHP-Enum-Behavior
cp %SOURCE4 README.alt
cp %SOURCE5 README-nginx-ru.alt

cat <<EOF >> db/zm_create.sql.in
use mysql;
grant select,insert,update,delete on zm.* to 'zmuser' at localhost identified by 'zmpass';
EOF

./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no

%build
%cmake -DZM_TARGET_DISTRO="alt" -DPCRE_INCLUDE_DIR=/usr/include/pcre -DZM_SYSTEMD=ON -DZM_WEB_USER=%{zmuser} -DZM_WEB_GROUP=%{zmgroup}

make %{?_smp_mflags} -C BUILD

%install
install -d %buildroot%_var/run
%make_install -C BUILD install DESTDIR=%buildroot
rm -rf %buildroot%prefix/%_lib/perl5/vendor_perl/*.*/*-*
rm -rf %buildroot%prefix/%_lib/perl5/*.*/*-*


install -m 755 -d %buildroot%_var/log/zoneminder
for dir in events images temp
do
install -m 755 -d %buildroot%_localstatedir/zoneminder/$dir
done
install -D -m 755 BUILD/scripts/zm %buildroot%_initdir/zoneminder
install -D -m 644 BUILD/misc/zoneminder.service %buildroot/%_unitdir/%name.service
install -D -m 644 BUILD/misc/zoneminder-tmpfiles.conf %buildroot/%_tmpfilesdir/zoneminder.conf
install -D -m 644 %SOURCE3 %buildroot%_sysconfdir/httpd/conf/addon-modules.d/zoneminder.conf
install -D -m 644 %SOURCE6 %buildroot%_sysconfdir/nginx/sites-enabled.d/nginx-zoneminder.conf.sample
install -D -m 644 %SOURCE7 %buildroot%_sysconfdir/nginx/sites-enabled.d/zm-fcgi.inc
install -D -m 644 %SOURCE8 %buildroot%_sysconfdir/fpm/fpm.d/fpm-zm.conf
mkdir -p %buildroot/%_cachedir/%name

cp -aR web/api %buildroot%_datadir/%name/www/api
ln -s %_cachedir/%name %buildroot%_datadir/%name/www/cache


rm -f %buildroot%perl_vendor_archlib/perllocal.pod
mkdir -p %buildroot%_datadir/%name/db
cp db/*.sql %buildroot%_datadir/%name/db

%pre
%_sbindir/groupadd -r -f %zmgroup 2>/dev/null ||:
%_sbindir/useradd -g %zmgroup -c 'WWW server' -d %webserver_datadir -s '/dev/null' \
       -G %webserver_group -r %zmuser 2>/dev/null || :

%post
%post_service zoneminder

%preun
%preun_service zoneminder

%files
%doc COPYING README.md README.alt
%config(noreplace) %_sysconfdir/zm/zm.conf
%config(noreplace) %_sysconfdir/zm/conf.d/*.conf
%ghost %_cachedir/%name
%_sysconfdir/zm/conf.d/README
%_tmpfilesdir/zoneminder.conf
%_unitdir/%name.service
%_initdir/zoneminder
%_bindir/*
%_datadir/%name
%_man8dir/zoneminder*
%perl_vendorlib/ZoneMinder*
%perl_vendorlib/ONVIF*
%perl_vendorlib/WSDiscovery*
%perl_vendorlib/WSSecurity*
%perl_vendorlib/WSNotification*

%_libexecdir/%name
%dir %attr(755,%zmuser,%zmgroup) %_var/log/zoneminder
%dir %attr(755,%zmuser,%zmgroup) %_localstatedir/zoneminder
%dir %attr(755,%zmuser,%zmgroup) %_localstatedir/zoneminder/events
%dir %attr(755,%zmuser,%zmgroup) %_localstatedir/zoneminder/images
%dir %attr(755,%zmuser,%zmgroup) %_localstatedir/zoneminder/temp
%_datadir/polkit-1/*/*
%exclude %_datadir/%name/www/api


%files nginx
%doc README-nginx-ru.alt
%config(noreplace) %_sysconfdir/nginx/sites-enabled.d/*
%config(noreplace) %_sysconfdir/fpm/fpm.d/*

%files api
%_datadir/%name/www/api

%changelog

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

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