define variables to toggle x10 & ffmpeg support

This commit is contained in:
Andrew Bauer 2013-12-23 19:41:00 -06:00
parent c4d22672ac
commit dbd2ee348e
2 changed files with 30 additions and 27 deletions

View File

@ -3,6 +3,10 @@
%define zmuid_final apache
%define zmgid_final apache
### Delete the lines below to build with ffmpeg and/or x10
%define _without_ffmpeg 1
%define _without_x10 1
Name: zoneminder
Version: 1.26.5
Release: 1%{?dist}
@ -17,8 +21,6 @@ URL: http://www.zoneminder.com/
Source: ZoneMinder-%{version}.tar.gz
Patch1: zoneminder-1.26.0-defaults.patch
# Enable this patch to disable ffmpeg support
#Patch2: zoneminder-1.26.3-noffmpeg.patch
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: community-mysql-devel pcre-devel libjpeg-turbo-devel
@ -30,17 +32,16 @@ BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect)
BuildRequires: gcc gcc-c++
# Comment out for no ffmpeg
BuildRequires: ffmpeg-devel
# Uncomment for X10 support
#BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
Requires: httpd php php-mysql cambozola
Requires: libjpeg-turbo ffmpeg
Requires: libjpeg-turbo
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
Requires: perl(LWP::Protocol::https)
%{!?_without_ffmpeg:Requires: ffmpeg}
Requires(post): systemd-units systemd-sysv
Requires(post): /usr/bin/gpasswd
@ -64,7 +65,12 @@ too much degradation of performance.
#%patch2 -p0 -b .noffmpeg
%build
%cmake -DZM_TARGET_DISTRO="f19" -DZM_NO_X10=ON -DZM_NO_FFMPEG=ON -DZM_PERL_SUBPREFIX=`x="%{perl_vendorlib}" ; echo ${x#"%{_prefix}"}` .
%cmake \
-DZM_TARGET_DISTRO="f19" \
-DZM_PERL_SUBPREFIX=`x="%{perl_vendorlib}" ; echo ${x#"%{_prefix}"}` \
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
%{?_without_x10:-DZM_NO_X10=ON} \
.
make %{?_smp_mflags}
@ -137,8 +143,7 @@ fi
%{_bindir}/zmupdate.pl
%{_bindir}/zmvideo.pl
%{_bindir}/zmwatch.pl
# Uncomment this for x10 support
#%{_bindir}/zmx10.pl
%{!?_without_x10:%{_bindir}/zmx10.pl}
%{perl_vendorlib}/ZoneMinder*
%{perl_vendorlib}/%{_arch}-linux-thread-multi/auto/ZoneMinder*

View File

@ -7,6 +7,10 @@
%define zmuid_final apache
%define zmgid_final apache
### Delete the lines below to build with ffmpeg and/or x10
%define _without_ffmpeg 1
%define _without_x10 1
Name: zoneminder
Version: 1.26.5
Release: 1%{?dist}
@ -28,11 +32,9 @@ Source2: jscalendar-%{jscrev}.zip
# here.
#Source3: http://mootools.net/download/get/mootools-core-%{moorev}-full-compat-yc.js
#Patch1: zoneminder-1.26.4-dbinstall.patch
Patch2: zoneminder-1.24.3-runlevel.patch
Patch3: zoneminder-1.26.0-defaults.patch
# Enable this patch to disable ffmpeg support
#Patch4: zoneminder-1.26.3-noffmpeg.patch
Patch1: zoneminder-1.24.3-runlevel.patch
Patch2: zoneminder-1.26.0-defaults.patch
%{?_without_ffmpeg:Patch3: zoneminder-1.26.3-noffmpeg.patch}
BuildRequires: automake gnutls-devel systemd-units
BuildRequires: libtool bzip2-devel
@ -46,10 +48,8 @@ BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++
BuildRequires: autoconf autoconf-archive
# Comment out for no ffmpeg
BuildRequires: ffmpeg-devel
# Uncomment for X10 support
#BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
Requires: httpd php php-mysql cambozola
Requires: libjpeg-turbo ffmpeg
@ -84,10 +84,9 @@ mv *html *php doc/* README ../jscalendar-doc
rmdir doc
popd
#%patch1 -p0 -b .dbinstall
%patch2 -p0 -b .runlevel
%patch3 -p0 -b .defaults
#%patch4 -p0 -b .noffmpeg
%patch1 -p0 -b .runlevel
%patch2 -p0 -b .defaults
%{?_without_ffmpeg:%patch3 -p0 -b .noffmpeg}
chmod -x src/zm_event.cpp src/zm_user.h
@ -132,8 +131,7 @@ install -d %{buildroot}/%{_localstatedir}/run
make install DESTDIR=%{buildroot} \
INSTALLDIRS=vendor
rm -rf %{buildroot}/%{perl_vendorarch} %{buildroot}/%{perl_archlib}
# Comment out for x10 support
rm -f %{buildroot}/%{_bindir}/zmx10.pl
%{?_without_x10:%{__rm} -f %{buildroot}/%{_bindir}/zmx10.pl}
install -m 755 -d %{buildroot}/var/log/zoneminder
for dir in events images temp
@ -159,7 +157,7 @@ cp -rp jscalendar-1.0/* %{buildroot}/%{_datadir}/zoneminder/www/jscalendar
# Set up cambozola
pushd %{buildroot}/%{_datadir}/zoneminder/www
ln -s ../../java/cambozola.jar
%{__ln_s} ../../java/cambozola.jar
popd
# Set up mootools
@ -239,7 +237,7 @@ fi
%{_bindir}/zmupdate.pl
%{_bindir}/zmvideo.pl
%{_bindir}/zmwatch.pl
#%{_bindir}/zmx10.pl
%{!?_without_x10:%{_bindir}/zmx10.pl}
%{perl_vendorlib}/ZoneMinder*
%{_mandir}/man*/*