File vdr-plugin-live.spec of Package vdr-plugin-live

#
# spec file for package vdr-plugin-live (Version 0.2.0)

%define name          vdr-plugin-live
%define version       0.2.0
%define release       0
%define vdrapiversion %(sed -ne '/define APIVERSION/s/^.*"\\(.*\\)".*$/\\1/p' /usr/include/vdr/config.h)
%define gccversion    %(gccver="`rpm -q --queryformat='%{VERSION}' gcc 2> /dev/null | tr . : | sed s/:/0/g`" ; if test $? != 0 ; then gccver="" ; fi ; echo "$gccver")

Name:           %{name}
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  vdr-devel >= 1.6.0
BuildRequires:  libcxxtools7-devel >= 1.4.7
BuildRequires:  libtntnet-devel >= 1.6.1
BuildRequires:  tntnet >= 1.6.1
%if %{suse_version} > 1020
BuildRequires:  fdupes
%endif
%if %{gccversion} < 401
BuildRequires: boost-devel >= 1.32.0
%endif
Url:            http://live.vdr-developer.org
License:        GPL v2 or later
Group:          Productivity/Multimedia/Other

AutoReqProv:    on
Version:        %{version}
Release:        %{release}
Summary:        LIVE Plugin for the Video Disc Recorder VDR
Source0:        http://live.vdr-developer.org/downloads/vdr-live-%{version}.tar.gz
Source9:        sysconfig.vdr-plugin-live
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# PreReq:         vdrapi = %{vdrapiversion}
PreReq:         %{fillup_prereq}
PreReq:         vdr(abi) = %{vdrapiversion}

%description
This package contains the LIVE plugin for the video disc recorder VDR.

LIVE, the LIVE Interactive VDR Environment, allows a comfortable operation of VDR and some of its plugins trough a web interface.

Unlike external programs, which communicate with VDR and its plugins through the SVDRP interface, LIVE has direct access to the internal data structures of VDR. This makes LIVE very fast.

Additionally LIVE introduces an interface which allows the direct integration of user interfaces for VDR plugins.

Currently this interface was implemented for the EPGSearch plugin. A substantial part of the LIVE web interface is based on this implementation. There exist plans to extend other plugins (like taste, burn, femon and others) with this interface too.

LIVE works even when these plugins are missing. LIVE detects the available plugins and adapts its user interface accordingly. Therefor it can happen, that certain functions appear and can be used only when the appropriate plugin is activated in VDR. 

Edit /etc/sysconfig/vdr to activate the plugins.

%debug_package

%prep
%setup -q -c -n vdr-plugin-live

plugins="live-0.2.0"
echo "SUBDIRS =" > Makefile
for i in $plugins; do
    test -e $i/skipvdr || echo "SUBDIRS += $i" >> Makefile
done
cat >> Makefile <<'EOF'

all: $(SUBDIRS)
$(SUBDIRS):
	$(MAKE) -C $@ all VDRDIR=/usr/include/vdr LIBDIR=. LOCALEDIR=locale

.PHONY: all $(SUBDIRS)
EOF

%build
make %{?jobs:-j%jobs}

%install
install -d -m 755 %{buildroot}%{_docdir}/vdr/plugins
#install -d -m 755 %{buildroot}%{_bindir}
install -d -m 755 %{buildroot}%{_libdir}/vdr

installdoc()
{
    plugin="$1"
    shift
    install -d -m 755 %{buildroot}%{_docdir}/vdr/plugins/$plugin
    for i in "$@"; do
	install -m 644 $i %{buildroot}%{_docdir}/vdr/plugins/$plugin/$i
    done
}

installib()
{
    for i in "$@"; do
	install -m 755 libvdr-$i.so %{buildroot}%{_libdir}/vdr/libvdr-$i.so.%{vdrapiversion}
    done
}

installlocale()
{
	cd locale

	install -d -m 755 %{buildroot}%{_datadir}/vdr/locale

	for i in *_*; do
		install -d -m 755 %{buildroot}%{_datadir}/vdr/locale/$i/LC_MESSAGES
		install -m 644 $i/LC_MESSAGES/*.mo %{buildroot}%{_datadir}/vdr/locale/$i/LC_MESSAGES
	done

	cd ..
}

# plugins
pushd live-0.2.0
    installib live
    installdoc live COPYING HISTORY README
    installlocale

    install -d -m 755 %{buildroot}/etc/vdr/plugins/live
    cp -r live/* %{buildroot}/etc/vdr/plugins/live
popd

# sysconfig
install -d -m 755 %{buildroot}/var/adm/fillup-templates
install -m 644 %{SOURCE9} %{buildroot}/var/adm/fillup-templates/sysconfig.vdr-plugin-live

%if %suse_version > 1020
%fdupes -s $RPM_BUILD_ROOT
%endif

# locale files
echo '%%defattr (644, root, root, 755)' > vdr.lang
find %{buildroot}%{_datadir}/vdr/locale -type f -printf '%%P\n' | while read f; do
        echo "%%lang(${f%%%%/*}) %{_datadir}/vdr/locale/$f"
done >> vdr.lang

%clean
rm -rf %{buildroot}

%post
%{fillup_only -n vdr -s plugin-live}

%files -f vdr.lang
%defattr(-,root,root)
%attr(755,vdr,root) %dir /etc/vdr
%attr(755,vdr,root) %dir /etc/vdr/plugins
%dir %{_libdir}/vdr
%config(noreplace) /etc/vdr/plugins/[^x]*
%{_libdir}/vdr/libvdr*
%{_docdir}/vdr/plugins/
#%{_bindir}/*
/var/adm/fillup-templates/sysconfig.vdr-plugin-live

%changelog
* Wed Aug  6 2008 Kai Schröder <cyberian@arcor.de>
- initial release
openSUSE Build Service is sponsored by