%define devtool b25dvr

Name:           fuse_b25
Version:        0.3.0
Summary:	FUSE filesystem to descramble streams from ISDB-T/S DVB devices
Release: 	2%{?_dist_release}
Source0:	http://2sen.dip.jp/cgi-bin/dtvup/source/up0543.zip
Source1:	http://2sen.dip.jp/cgi-bin/dtvup/source/up0548.zip
Patch0:		fuse_b25-0.3.0-b25dvr-console_apps.patch
Group:		System Environment/Base
License:        GPLv3

BuildRequires:  unzip
BuildRequires:  fuse-devel >= 2.8, pcsc-lite-devel
Requires:       fuse >= 2.8, pcsc-lite

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Packager:	munepi


%description
Fuse filesystems which mounts on a backed-up /dev/dvb/adapterN/dvr0 and
relays output streams from the real device to standard DVB applications,
as well as descrambling MULTI2 with pcscd.
 
This package includes a helper script to backup/restore the real dvr0 device.

%prep
[ -d %{name}-%{version} ] && %__rm -rf %{name}-%{version}

%__unzip -o %{SOURCE0}
%__unzip -o %{SOURCE1}

%__tar zxf %{name}-%{version}/%{name}-%{version}.tar.gz

%setup -D -T %{name}-%{version}

%__patch -p1 -b < ../add-crc.diff

%patch0 -p1 -b .vine


%build
%configure
%__make %{?_smp_mflags}


%install
%__rm -rf $RPM_BUILD_ROOT
%__make install DESTDIR=$RPM_BUILD_ROOT
%__rm $RPM_BUILD_ROOT%{_bindir}/fuse_b25.org
%__rm $RPM_BUILD_ROOT%{_sbindir}/rendvr0
%__install -d $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
%__install -p -m 0644 helper/pam.d/%{devtool} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/
%__install -d $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps
%__install -p -m 0644 helper/console.apps/%{devtool} $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/
%__ln_s /usr/bin/consolehelper $RPM_BUILD_ROOT%{_bindir}/%{devtool}

%clean
%__rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README
%doc helper/80-dvr-b25.rules helper/rendvr0 src/fuse_b25.org
%{_bindir}/%{name}
%{_bindir}/%{devtool}
%{_sbindir}/%{devtool}
%config %{_sysconfdir}/security/console.apps/%{devtool}
%config %{_sysconfdir}/pam.d/%{devtool}


%changelog
* Mon Feb 07 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.3.0-2
- fixed PROGRAM and added GUI=no in console.apps/b25dvr

* Sun Feb 06 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.3.0-1
- initial build

* Mon Dec 6 2010 0p1pp1 - 0.2.1-1
- updated to ver. 0.2.1

* Fri Sep 17 2010 0p1pp1 - 0.2-1
- updated to ver.0.2

* Fri Dec 11 2009 0p1pp1 - 0.1
- initial release
