191 lines
6 KiB
RPMSpec
191 lines
6 KiB
RPMSpec
%define zmuid $(id -un)
|
|
%define zmgid $(id -gn)
|
|
%define zmuid_final apache
|
|
%define zmgid_final apache
|
|
|
|
Name: zoneminder
|
|
Version: 1.22.3
|
|
Release: 9%{?dist}
|
|
Summary: A camera monitoring and analysis tool
|
|
Group: System Environment/Daemons
|
|
License: GPLv2+
|
|
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.Fedora
|
|
Patch1: zoneminder-1.22.3-dbinstall.patch
|
|
Patch10: zoneminder-1.22.3-installfix.patch
|
|
|
|
Conflicts: zm <= 1.22.3
|
|
|
|
BuildRequires: automake
|
|
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)
|
|
Requires: httpd php php-mysql
|
|
Requires: perl(DBD::mysql)
|
|
Requires(post): /sbin/chkconfig
|
|
Requires(preun): /sbin/chkconfig
|
|
Requires(preun): /sbin/service
|
|
Requires(postun): /sbin/service
|
|
|
|
|
|
%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}
|
|
%patch1 -p0 -b .dbinstall
|
|
%patch10 -p0 -b .installfix
|
|
gunzip -c %{SOURCE1} | tar xf - cambozola-*/dist/cambozola.jar
|
|
cp %{SOURCE4} README.Fedora
|
|
|
|
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'@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 \
|
|
$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
|
|
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%{_prefix}/%{_lib}/perl5/vendor_perl/*.*/*-*
|
|
rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/*.*/*-*
|
|
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 -D -m 755 scripts/zm $RPM_BUILD_ROOT%{_initrddir}/zoneminder
|
|
install -D -m 644 cambozola-*/dist/cambozola.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cambozola.jar
|
|
install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/zoneminder.conf
|
|
install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/sounds/redalert.wav
|
|
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
%post
|
|
/sbin/chkconfig --add zoneminder
|
|
|
|
|
|
%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
|
|
%defattr(-,root,root,-)
|
|
%doc AUTHORS COPYING README README.html README.pdf README.Fedora
|
|
%config(noreplace) %attr(600,%{zmuid_final},%{zmgid_final}) %{_sysconfdir}/zm.conf
|
|
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/zoneminder.conf
|
|
%attr(755,root,root) %{_initrddir}/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}/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
|
|
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
|
- Fix licence tag
|
|
|
|
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
|
- Fixes from testing by Jitz including missing dependencies and database creation
|
|
|
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
|
- Disable crashtrace on ppc
|
|
|
|
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
|
- Fix uid for directories in /var/lib/zoneminder
|
|
|
|
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 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 <martin@zepler.org> - 1.22.3-3
|
|
- Changes recommended in review by Jason Tibbitts
|
|
|
|
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
|
- Standardised on package name of zoneminder
|
|
|
|
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
|
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|