File dvb.spec of Package dvb
#
# spec file for package dvb
#
# Copyright (c) 2013 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/
#
%if !%{defined snapver}
%define snapver 20120913
%endif
Name: dvb
BuildRequires: fdupes
BuildRequires: libusb-devel
%if 0%{?suse_version} >= 1210
BuildRequires: libv4l-devel >= 0.8.4
%endif
BuildRequires: xz
%define firmwaredir /lib/firmware
Url: http://linuxtv.org/
PreReq: %fillup_prereq %insserv_prereq
Version: 1.1.1%{?snapver:_%snapver}
Release: 0
Summary: Tools for Digital (DVB) TV Cards
License: GPL-2.0+
Group: Hardware/TV
Source: dvb-apps-%{version}.tar.xz
Source2: rcdvb
Source3: sysconfig.dvb
Source4: http://linuxtv.org/downloads/firmware/dvb-ttpci-01.fw-2622
#Source4: http://212.227.36.83/linuxtv/downloads/firmware/dvb-ttpci-01.fw-261d
Patch: dvb-apps-dvbnet.diff
Patch1: dvb-includes.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# This package provides the firmware for some cards supported by the
# dvb-ttpci.ko module. Add the modalias dependencies for this module:
# Modules: dvb-ttpci.ko
Supplements: modalias(pci:v00001131d00007146sv0000110Asd00000000bc*sc*i*)
Supplements: modalias(pci:v00001131d00007146sv000013C2sd0000000[0123468AE]bc*sc*i*)
Supplements: modalias(pci:v00001131d00007146sv000013C2sd00001002bc*sc*i*)
# Generated with: extract-modaliases -i dvb-ttpci kernel-default.rpm
Requires: dtv-scan-tables
%description
DVB tools and transponder files useful for DVB TV Cards
%prep
%setup -q -n dvb-apps-%{version}
%patch
%patch1
find -name .hg -type d | xargs rm -rfv
find -name .cvsignore -type f | xargs rm -fv
find -name '*.orig' -type f | xargs rm -fv
%build
rm -rf include/linux
make %{?_smp_mflags} CFLAGS="%{optflags} -fno-strict-aliasing -fPIC" \
CC=gcc \
bindir=%{_bindir} \
libdir=%{_libdir} \
V=1 \
ttusb_dec_reset=1
%install
export DESTDIR=%{buildroot}
## directories
install -d -m 755 $DESTDIR/usr/{,s}bin $DESTDIR/etc/init.d $DESTDIR/usr/include \
$DESTDIR/var/adm/fillup-templates
#
## docu
install -d -m 755 $DESTDIR%{_docdir}/dvb
install -m 644 README $DESTDIR%{_docdir}/dvb
#
##
make \
bindir=%{_bindir} \
libdir=%{_libdir} \
prefix=%{_prefix} \
includedir=%{_includedir} \
DESTDIR=%{buildroot} \
install
install -d -m 755 $DESTDIR/%{_docdir}/%{name}/szap
install -m 644 util/szap/README $DESTDIR/%{_docdir}/%{name}/szap
install -m 644 util/ttusb_dec_reset/README $DESTDIR/%{_docdir}/%{name}/README.ttusb_dec_reset
install -m 644 util/av7110_loadkeys/README $DESTDIR/%{_docdir}/%{name}/README.av7110_loadkeys
#
# dvbnet
install -m 644 util/dvbnet/net_start.* $DESTDIR/%{_docdir}/%{name}/
## sysconfig & init
install -m 644 %{SOURCE3} $DESTDIR/var/adm/fillup-templates
ln -sf /etc/init.d/dvb $DESTDIR/usr/sbin/rcdvb
install -m 755 %{SOURCE2} $DESTDIR/etc/init.d/dvb
#
## firmware
install -d -m 755 %{buildroot}%{firmwaredir}
install -m 644 %{SOURCE4} %{buildroot}%{firmwaredir}
cd %{buildroot}%{firmwaredir}
for i in dvb-ttpci-01.fw*; do
ln -s $i dvb-ttpci-01.fw
break
done
cd -
#
# noone really uses this so far AFAIK
rm -r %{buildroot}%{_includedir} %{buildroot}%{_libdir}/*.a
# dvbscan is incomplete and defunct
rm %{buildroot}%{_bindir}/dvbscan
# dvb scan data are provided by dtv-scan-tables
rm -r %{buildroot}%{_datadir}/dvb/{atsc,dvb-c,dvb-s,dvb-t}
#
%fdupes $RPM_BUILD_ROOT
%preun
%stop_on_removal dvb
%post
%{fillup_and_insserv dvb}
%postun
%restart_on_update dvb
%insserv_cleanup
%files
%defattr(-, root, root)
%{_docdir}/dvb
%{_datadir}/dvb
/var/adm/fillup-templates/sysconfig.dvb
%config /etc/init.d/dvb
/usr/sbin/rcdvb
/usr/bin/*
%if %suse_version <= 1020
%dir %{firmwaredir}
%endif
%{_libdir}/*.so
%{firmwaredir}/*
%changelog