File vdr.spec of Package vdr
#
# spec file for package vdr
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: vdr
BuildRequires: fontconfig-devel
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: libjpeg-devel
BuildRequires: ncurses-devel
%if %suse_version > 1000
BuildRequires: libcap-devel
%else
BuildRequires: libcap
%endif
#
%define vdrname vdr
%define vdr_apiversion 1.6.0
%define vdr_localedir %{_datadir}/vdr/locale
%define vdr_libdir %{_libdir}/vdr/
%define vdr_includedir %{_includedir}/vdr
%define vdr_videodir /var/spool/video
%define vdr_sysconfdir /etc/vdr
#
Url: http://www.tvdr.de/
PreReq: /usr/sbin/useradd %fillup_prereq %insserv_prereq
Version: 1.6.0
Release: 0
Summary: Video Disk Recorder
License: GPL-2.0+
Group: Hardware/TV
Source: ftp://ftp.tvdr.de/vdr/vdr-%{version}.tar.bz2
Source1: rcvdr
Source2: sysconfig.vdr
Source3: vdr-shutdown.sh
Source4: runvdr
#Source5: README.SuSE-vdr
Source6: openvt.diff
Source7: vdr-genindex.c
Source8: channels.conf
Source9: remote.conf
Source10: vdr.macros
# generated from wiki page
Source90: README.SuSE-vdr.txt
Source91: README.SuSE-vdr.html
Source92: greenish.css
Source93: vdr-fetchwikipage
Source94: vdr-renderwikipage
Source95: vdr-doc.desktop
Patch0: ftp://ftp.tvdr.de/vdr/Developer/vdr-1.6.0-1.diff
Patch1: ftp://ftp.tvdr.de/vdr/Developer/vdr-1.6.0-2.diff
Patch20: vdr-1.6.0-ncurses.diff
Patch21: vdr-1.6.0-kernel-2.6.29.diff
Patch22: vdr-1.6.0-const.diff
# PATCH-FIX-UPSTREAM vdr-1.6.0-gcc46.patch idoenmez@suse.de -- Fix compilation with gcc 4.6
Patch23: vdr-1.6.0-gcc46.patch
# PATCH-FIX-UPSTREAM vdr-gcc47.patch dimstar@opensuse.org -- Fix build with gcc 4.7.
Patch25: vdr-gcc47.patch
# UPSTREAM 72c5ec3 to make it work with fontconfig-2.9
Patch26: vdr-FcFontSort-72c5ec3.diff
# PATCH-FIX-Upstream vdr-1.6.0-bnc786040-use-v4l2.patch seife@novel.slipkontur.de -- use v4l2.
Patch27: vdr-1.6.0-bnc786040-use-v4l2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: vdr-devel
Provides: vdr(abi) = %vdr_apiversion
Requires: xorg-x11-fonts-scalable
Recommends: vdr-plugins dvb
%package devel
Summary: Video Disk Recorder
Group: Hardware/TV
PreReq: vdr = %version
%description
Video Disk Recorder (VDR) is a digital satellite (DVB) receiver
program. It can record MPEG2 streams, as well as output the stream to
TV.
Authors:
--------
Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
Carsten Koch <Carsten.Koch@icem.de>
Plamen Ganev <pganev@com-it.net>
Heino Goldenstein <heino.goldenstein@microplex.de>
Guido Fiala <gfiala@s.netic.de>
Robert Schneider <Robert.Schneider@lotus.com>
Niels de Carpentier <niels@casema.net>
Martin Hammerschmid <martin@hammerschmid.com>
Bastian Guse <bastian@nocopy.de>
Matthias Schniedermeyer <ms@citd.de>
Miha Setina <mihasetina@softhome.net>
Alberto Carraro <bertocar@tin.it>
Deti Fliegl <deti@fliegl.de>
Dave Chapman <dave@dchapman.com>
Hans-Peter Raschke <Hans-Peter.Raschke@Wintermann-DatenService.de>
Peter Hofmann <software@pxh.de>
Axel Gruber <axel@agm.de>
Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>
Jürgen Sauer <jojo@automatix.de>
Benjamin Reichardt <reichard@math.uni-goettingen.de>
Henning Holtschneider <hh@holtschneider.com>
%description devel
Video Disk Recorder (VDR) is a digital satellite (DVB) receiver
program. It can record MPEG2 streams, as well as output the stream to
TV.
Authors:
--------
Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
Carsten Koch <Carsten.Koch@icem.de>
Plamen Ganev <pganev@com-it.net>
Heino Goldenstein <heino.goldenstein@microplex.de>
Guido Fiala <gfiala@s.netic.de>
Robert Schneider <Robert.Schneider@lotus.com>
Niels de Carpentier <niels@casema.net>
Martin Hammerschmid <martin@hammerschmid.com>
Bastian Guse <bastian@nocopy.de>
Matthias Schniedermeyer <ms@citd.de>
Miha Setina <mihasetina@softhome.net>
Alberto Carraro <bertocar@tin.it>
Deti Fliegl <deti@fliegl.de>
Dave Chapman <dave@dchapman.com>
Hans-Peter Raschke <Hans-Peter.Raschke@Wintermann-DatenService.de>
Peter Hofmann <software@pxh.de>
Axel Gruber <axel@agm.de>
Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>
Jürgen Sauer <jojo@automatix.de>
Benjamin Reichardt <reichard@math.uni-goettingen.de>
Henning Holtschneider <hh@holtschneider.com>
%prep
%setup -q -n vdr-%{version}
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE4} .
#
cat > Make.config <<EOF
### The C compiler options:
CFLAGS = $RPM_OPT_FLAGS -fPIC -Wall
CXXFLAGS = -fPIC $RPM_OPT_FLAGS -Wall -Woverloaded-virtual
### The directory environment:
MANDIR = %{_mandir}
BINDIR = %{_bindir}
LOCDIR = %{vdr_localedir}
VIDEODIR = %{vdr_videodir}
REMOTE = LIRC
PLUGINLIBDIR = %{vdr_libdir}
VDR_USER = vdr
WITH_CAPABILITIES = 1
EOF
#
APIVERSION=`sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$/\1/p' config.h`
if [ "%vdr_apiversion" != "$APIVERSION" ]; then
echo "*** APIVERSION must be $APIVERSION, fix definition!"
false
fi
%patch0 -p1
%patch1 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23
%patch25 -p1
%patch26 -p1
%patch27 -p1
%build
#cp %{SOURCE5} README.SuSE
cp %{SOURCE6} .
cp %{SOURCE7} .
make %{?jobs:-j%jobs}
make plugins
gcc -o vdr-genindex %{optflags} -funroll-loops vdr-genindex.c
%install
install -d -m 755 %{buildroot}%{_mandir}/man{1,5}
install -d -m 755 %{buildroot}%{_sbindir}
install -d -m 755 %{buildroot}%{_bindir}
install -d -m 755 %{buildroot}%{vdr_sysconfdir}
install -d -m 755 %{buildroot}%{vdr_sysconfdir}/plugins
install -d -m 755 %{buildroot}%{vdr_videodir}
install -d -m 755 %{buildroot}%{vdr_libdir}
install -d -m 755 %{buildroot}%{vdr_includedir}
install -d -m 755 %{buildroot}%{vdr_includedir}/libsi
make MANDIR=%{buildroot}%{_mandir} \
BINDIR=%{buildroot}%{_sbindir} \
VIDEODIR=%{buildroot}%{vdr_videodir} \
PLUGINLIBDIR=%{buildroot}%{vdr_libdir} \
LOCDIR=%{buildroot}%{vdr_localedir} \
install
#
install -m 644 *.conf %{buildroot}%{vdr_sysconfdir}
for i in epg2html.pl svdrpsend.pl PLUGINS/src/sky/getskyepg.pl; do
install -m 755 $i %{buildroot}%{_bindir}/${i##*/}
done
install -m 644 *.h %{buildroot}%{vdr_includedir}
install -m 644 libsi/*.h %{buildroot}%{vdr_includedir}/libsi
install -m 644 Make.config %{buildroot}%{vdr_includedir}
ln -s . %{buildroot}%{vdr_includedir}/vdr
ln -s . %{buildroot}%{vdr_includedir}/include
install -m 755 PLUGINS/lib/* %{buildroot}%{vdr_libdir}/
install -m 755 %{SOURCE3} %{buildroot}%{vdr_sysconfdir}/shutdown.sh
#sysconfig&init
install -d -m 755 %{buildroot}/var/adm/fillup-templates
install -m 644 sysconfig.vdr %{buildroot}/var/adm/fillup-templates/sysconfig.vdr
install -d -m 755 %{buildroot}/etc/init.d
install -m 755 rcvdr %{buildroot}/etc/init.d/vdr
ln -s ../../etc/init.d/vdr %{buildroot}%{_sbindir}/rcvdr
# create plugins doc dir
mkdir plugins
cp -a PLUGINS/src/sky/channels.conf.sky PLUGINS/src/sky/lircd.conf.sky plugins
cp -a PLUGINS/src/sky/README plugins/README.sky
cp -a PLUGINS/src/osddemo/README plugins/README.osddemo
rm %{buildroot}%{_sbindir}/runvdr
install -m 755 runvdr %{buildroot}%{_sbindir}/runvdr
install -m 644 %{SOURCE8} %{buildroot}%{vdr_sysconfdir}/channels.conf
install -m 644 %{SOURCE9} %{buildroot}%{vdr_sysconfdir}/remote.conf
install -m 755 vdr-genindex %{buildroot}%{_bindir}
#
# docu
#
cp %{SOURCE90} README.SuSE
cp %{SOURCE91} README.SuSE.html
cp %{SOURCE92} .
#
install -d -m 755 %{buildroot}%{_datadir}/susehelp/meta/Manuals/Productivity
install -m 644 %{SOURCE95} %{buildroot}%{_datadir}/susehelp/meta/Manuals/Productivity/vdr.desktop
# locale files
echo '%%defattr (644, root, root, 755)' > vdr.lang
find %{buildroot}%{vdr_localedir} -type f -printf '%%P\n' | while read f; do
echo "%%lang(${f%%%%/*}) %{vdr_localedir}/$f"
done >> vdr.lang
#
# rpm macro file
install -d -m 755 %{buildroot}/etc/rpm
cat > %{buildroot}/etc/rpm/macros.vdr <<EOF
%%vdrname %vdrname
%%vdr_apiversion %vdr_apiversion
%%vdr_localedir %vdr_localedir
%%vdr_libdir %vdr_libdir
%%vdr_includedir %vdr_includedir
%%vdr_videodir %vdr_videodir
%%vdr_sysconfdir %vdr_sysconfdir
%%vdr_prereq vdr(abi) = %{vdr_apiversion}
EOF
cat %{SOURCE10} >> %{buildroot}/etc/rpm/macros.vdr
%clean
rm -rf $RPM_BUILD_ROOT
%pre
/usr/sbin/useradd -r -d %{vdr_videodir} -s /bin/false -c "Video Disk Recorder" -g video vdr 2> /dev/null || :
%post
%{fillup_and_insserv vdr}
%postun
%{insserv_cleanup}
%preun
%stop_on_removal
%files -f vdr.lang
%defattr(-,root,root)
%doc README.SuSE README.SuSE.html greenish.css
%doc %{_datadir}/susehelp
%doc COPYING INSTALL README CONTRIBUTORS HISTORY
%doc MANUAL channels.conf.* PLUGINS.html plugins
%doc openvt.diff
%attr(755,vdr,root) %dir %{vdr_videodir}
%attr(755,vdr,root) %dir %{vdr_sysconfdir}
%dir %{vdr_libdir}
%dir %{_datadir}/vdr
%dir %{vdr_localedir}
%dir %{vdr_localedir}/*
%dir %{vdr_localedir}/*/LC_MESSAGES
%attr(-,vdr,root) %config(noreplace) %{vdr_sysconfdir}/*
%{_sbindir}/*
%{_bindir}/*
%{vdr_libdir}/*
%{_mandir}/man?/*
/etc/init.d/*
/var/adm/fillup-templates/*
%files devel
%defattr(-,root,root)
%config /etc/rpm/macros.vdr
%dir %{vdr_includedir}
%{vdr_includedir}/*
%changelog