Hi!

I polished my DVB spec file (using the current driver
version from http://linuxdvb.tv)
I also added a new patch so libdvb is compiled as
a shared library as well. See Changelog for details

Warning: mjpegtools conflict currently with the
dvb-progs package due to the fact that they have
the same binary names. I don't know if they are
identical.

Regards,

Reinhard Katzmann
-- 
Software-Engineer, Developer for Embedded Devices
Project: Pertergrin, a role playing game system
GnuPG Public Key available on request
%define version 0.9.4
%define libversion 0.0
%define sver    20020904
%define release 6sm
%define kver %(uname -r)
%define kernver %(uname -r | awk -F "-" '{ print$1 }' | awk -F "." '{ print$1$2$3 }')
Summary: video/tv player and modules for dvb
Name:           dvb
Version:        %version
Release:        %release
Copyright:      GPL
Group: System/Kernel and hardware
#Source: siemens_%{name}-%{version}-%{sver}.tar.bz2
Source: %{name}-%{sver}.tar.bz2
Patch:  %{name}-%{version}.patch
URL:            http://www.linuxdvb.tv
PreReq:         /sbin/install-info
Prefix:         /usr
Buildroot:      /var/tmp/%{name}-%{PACKAGE_VERSION}-root
BuildRequires: kernel >= 2.4.3, libtool >= 1.4
Vendor: [EMAIL PROTECTED] and CONTRIBUTORS
Packager: Reinhard Katzmann <[EMAIL PROTECTED]>
Provides: dvb-drivers

%description
This is another early release of a Linux driver for the Siemens/Fujitsu DVB
PCI card. As such there are many features still missing and not everything
might work as intended. But we are at a point where we think that the driver
is useful to some people and an exchange with a larger user base would be
benefitial.

Attention\: Install this package only if your kernel does not provide
           the DVB modules (or if this a more recent version :-)

%package -n libdvb%{libversion}
Summary: libraries for programs using DVB
Provides: libdvb
Group: Video

%description -n libdvb%{libversion}
This is another early release of a Linux driver for the Siemens/Fujitsu DVB
PCI card. As such there are many features still missing and not everything
might work as intended. But we are at a point where we think that the driver
is useful to some people and an exchange with a larger user base would be
benefitial.

Install this package if you have a program requiring libdvb libraries.

%package -n libdvb%{libversion}-devel
Summary: headers and libs for developing programs using DVB
Provides: libdvb-devel
Requires: libdvb
Group: Development/C

%description -n libdvb%{libversion}-devel
This is another early release of a Linux driver for the Siemens/Fujitsu DVB
PCI card. As such there are many features still missing and not everything
might work as intended. But we are at a point where we think that the driver
is useful to some people and an exchange with a larger user base would be
benefitial.

Install this package if you want to develop programs using libdvb.

%package -n dvb-progs
Summary: DVB programs using libdvb
Requires: libdvb
Group: Video

%description -n dvb-progs
This is another early release of a Linux driver for the Siemens/Fujitsu DVB
PCI card. As such there are many features still missing and not everything
might work as intended. But we are at a point where we think that the driver
is useful to some people and an exchange with a larger user base would be
benefitial.

Install this package if want to have some additional DVB tools and apps.
This package contains:
- tuxzap, a gui driven program for switching channels on a dvb card
- tuxview, a gui driven program to watch any v4l device (including DVB)
- ntuxplayer, a program to playback video using the DVB API (without v4l!)
- rtuxzap, a zapper using lirc driver and libraries for remote controls
- mpegtools, transforming between various MPEG stream formats
- szap, a simple zapping tool for linux DVB API

%prep
%setup -q -n DVB
chown -R root:root .
%patch -p1 -b .orig

%build
#Ok with 0.9 we have a make file, lets use it :)
mkdir -p Lost

#Problem with Makefile: No configure stuff, no makefile for tuxzap,
#so rpm failure on build :( We have to do all by hand...

(cd driver; %make)
(cd libdvb; %make)
(cd apps/mpegtools; %make)
(cd apps/tuxzap; ./autogen.sh; %configure; %make)

# Now lets do all the stuff this Makefile has forgotten :)

# Does not compile currently (unable to find out why, sorry :( )
#(cd driver/lirc; %%make)
(cd apps/szap; %make)

#Ok, we try the tests again
#cd apps/test
# Ooops.. where is the makefile ?
#cd ../..

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/lib/DVB
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/include/dvb
mkdir -p $RPM_BUILD_ROOT/%{prefix}/include/ost
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib

# Create init start script
cat >$RPM_BUILD_ROOT/etc/init.d/dvb <<EOF
#!/bin/sh
# -*- Shell-script -*-
# Time-stamp: <00/04/06 07:44:36 dvb [EMAIL PROTECTED]> 
#
# chkconfig: 345 86 15
# description: (un)Load kernel modules of DVB package.
#
# The modprobe/rmmod statements must correspond to the hardware configuration.
# It is recommanded to start lm_sensors modules script first

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "\$1" in
  start)
        msg='Loading DVB driver modules'
        echo -n "\$msg: "
        sync
        (
          rm -rf /dev/ost
          /usr/sbin/makedev.napi
          insmod dvbdev
          insmod dvb_net
          insmod i2c-core
          insmod videodev
          insmod dvb_filter
          insmod dmxdev
          insmod VES1893
          insmod VES1820
          insmod L64781
          insmod SP8870 debug=1
          insmod tda8083
          insmod stv0299
          insmod tuner
          insmod saa7146_core mode=0
          insmod saa7146_v4l
          insmod dvb_demux
          insmod dvb_frontend
          insmod dvb fdebug=1 init_chan=2 pids_off=0
          insmod msp3400
        )
        sync
        if [ \$? = 0 ] ; then
          success "\$msg"
        else
          failure "\$msg"
        fi
        echo
        ;;
  stop)
        msg='Removing DVB Driver Modules'
        echo -n "\$msg: "
        (
          rmmod msp3400
          rmmod dvb
          rmmod dvb_frontend
          rmmod dvb_demux
          rmmod dmxdev
          rmmod saa7146_v4l
          rmmod saa7146_core
          rmmod dvb_filter
          rmmod videodev
          rmmod VES1820
          rmmod VES1893
          rmmod L64781
          rmmod SP8870
          rmmod stv0299
          rmmod tda8083
#         rmmod i2c-core
          rmmod dvb_net
          rmmod tuner
          rmmod dvbdev
        )
        if [ \$? = 0 ] ; then
          success "\$msg"
        else
          failure "\$msg"
        fi
        echo
        ;;
  restart)
        \$0 stop
        \$0 start
        ;;
  reload)
        msg='Reloading DVB driver modules'
        echo -n "\$msg: "
        (
          rmmod msp3400
          rmmod dvb
          rmmod dvb_frontend
          rmmod dvb_demux
          rmmod dmxdev
          rmmod dvb_net
          insmod dvb_net.o
          insmod dmxdev
          insmod dvb_demux
          insmod dvb_frontend
          insmod dvb fdebug=1 init_chan=2 pids_off=0
          insmod msp3400
        )
        if [ \$? = 0 ] ; then
          success "\$msg"
        else
          failure "\$msg"
        fi
        echo
        ;;
  *)
        echo "Usage: \$0 {start|stop|reload|restart}"
        exit 1
esac

exit 0
EOF
chmod +x $RPM_BUILD_ROOT/etc/init.d/dvb

cd driver
cp -Rdp Root Dpram $RPM_BUILD_ROOT/lib/DVB
cp -Rdp makedev.napi $RPM_BUILD_ROOT%{prefix}/sbin
%if %{kernver}>=24
mkdir -p $RPM_BUILD_ROOT/lib/modules/%{kver}/kernel/drivers/media/video/
cp *.o $RPM_BUILD_ROOT/lib/modules/%{kver}/kernel/drivers/media/video/
%else
mkdir -p $RPM_BUILD_ROOT/lib/modules/%{kver}/misc
cp *.o $RPM_BUILD_ROOT/lib/modules/%{kver}/misc
%endif
cd ../apps
#cp gVideo/gVideo $RPM_BUILD_ROOT/%{prefix}/bin
#mkdir -p gVideo/gVideodoc
#cp gVideo/README gVideo/BUGS gVideo/gVideodoc
cd mpegtools 
mkdir -p mpegtoolsdoc
cp README mpegtoolsdoc
echo -n "cp -Rdvp mplex mpegtools " >tmp
echo "myprep:" >>Makefile
echo "  echo -n \$(LINKS) >>tmp" >>Makefile
make myprep
echo -n " $RPM_BUILD_ROOT/%{prefix}/bin" >>tmp
source tmp
#(cd $RPM_BUILD_ROOT/%{prefix}/bin ; source tmp ; rm -f tmp)
cp ../szap/szap $RPM_BUILD_ROOT/%{prefix}/bin
cp ../szap/tzap $RPM_BUILD_ROOT/%{prefix}/bin

cd ../tuxzap
mkdir -p tuxzapdoc

cp AUTHORS ChangeLog NEWS README tuxzapdoc
%makeinstall
cd ../../libdvb
cp conv merge_dvb $RPM_BUILD_ROOT/%{_bindir}
cp libdvb.a $RPM_BUILD_ROOT/%{prefix}/lib
cp libdvb.so.%{libversion}.0 $RPM_BUILD_ROOT/%{_libdir}
cp -Rdp include $RPM_BUILD_ROOT/%{prefix}
cp -Rdp *.h* $RPM_BUILD_ROOT/%{_includedir}/dvb

cd ../ost/include/ost
cp -Rdp *.h* $RPM_BUILD_ROOT/%{_includedir}/ost

cd  $RPM_BUILD_ROOT/%{_libdir}
ln -s libdvb.so.%{libversion}.0 libdvb.so.0 
ln -s libdvb.so.%{libversion}.0 libdvb.so

%clean
rm -fr $RPM_BUILD_ROOT

%post
/sbin/ldconfig

%postun
rm -f /etc/rc.d/init.d/dvb
/sbin/ldconfig

%files
%defattr(-, root, root)
%config /lib/DVB/*
%doc CONTRIBUTORS COPYING* NEWS README
%doc driver/modules.conf driver/devfsd.conf
/etc/init.d/dvb
/lib/modules/*
%{_sbindir}/*

%files -n libdvb%{libversion}
%defattr(-, root, root)
%doc CONTRIBUTORS COPYING* NEWS README
%{_libdir}/*.so.*

%files -n libdvb%{libversion}-devel
#%doc apps/CyberLogin/CyberLogin.ini
%doc libdvb/newtest* libdvb/TEST libdvb/astra.xml libdvb/nokia.dat 
%doc libdvb/README doc
%{_includedir}/dvb/*
%{_includedir}/ost/*
%{_libdir}/*.so.*

%files -n dvb-progs
%doc apps/dvbrc.* apps/dvbfav* apps/lircrc* apps/szap/vdr-channels.txt
%doc apps/szap/channels*
%doc apps/mpegtools/mpegtoolsdoc apps/tuxzap/tuxzapdoc apps/test
%{_bindir}/*

%changelog
* Wed Sep 04 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Update to snapshot from libdvb.tv (Change URL accordingly)
- Change dvb version management to new packaging structure
- Add new patch for libdvb shared library building
- separate the whole DVB mass into subpackages:
  libdvb, libdvb-devel, dvb-progs, dvb (drivers)
- Change group accordingly

* Sun Jun 02 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Use a more recent version, with the officially fixed
  liba52dec0 problem (current for vdr-1.0.3)
- Remove DVB patches (corresponding code seems to be gone)

* Sun May 12 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Fix problem with new liba52dec0 version

* Fri Apr 06 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Oh, updates are coming quickly now :)

* Fri Apr 05 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Simple update this time, no modification needed :-)))
- Version 0.9.4 required by vdr

* Thu Jan 17 2002 Reinhard Katzmann <[EMAIL PROTECTED]>
- Update (nearly ;) newest CVS snapshot
- Removed all libsi changes (this part was removed from dvb)
- Removed output patch which additionally shows the line of the
  file where an unrecognized keyword appeared (too lazy to find
  all the places where such messages appear now in libdvb)
- usual start script adaptions
- removed ptest, stest (no longer available)

* Thu Oct 04 2001 Reinhard Katzmann <[EMAIL PROTECTED]>
- Update to a CVS daily snapshot
- Remove patch part for dvb.c

* Sat Aug 19 2001 Reinhard Katzmann <[EMAIL PROTECTED]>
- Update to latest Version 20010816
- Finally corrected the GROUP ;-)
- Added conv and szap to binaries
- Adapted patch for Makefile, removed configure/ntuxzap patch for tuxzap
- Removed locale (gone from tuxzap ??)
- Adapted /etc/rc.d/init.d/dvb start script for new version
- New Buildrequires: lirc 0.6.4 or later (for rtuxzap)
- ToDo: Make a devel package (headers, libdvb, api doc)

* Sat Jun 09 2001 Reinhard Katzmann <[EMAIL PROTECTED]>
- Update to 0.9
- Removed makefile patch concerning gVideo (this app is gone away)
- The new Makefile is now being used
- i2c-core finally removed from Makefile and patch no longer needed
--- DVB/libdvb/Makefile.~1.11.~ 2002-06-03 17:04:45.000000000 +0200
+++ DVB/libdvb/Makefile 2002-09-04 20:06:32.000000000 +0200
@@ -3,15 +3,19 @@
 INCLUDES=-I./include -I./src -I. -I../driver -I../include -I ../ost/include
 LIBS=-Lsrc/si -L./ -lpthread
 
-main: libdvb.a merge_dvb conv newtest
+main: libdvb.a libdvb.so merge_dvb conv newtest
 
 install: libdvb.a
-       cp libdvb.a /usr/local/lib/
+       cp libdvb.* /usr/local/lib/
        chmod 644 /usr/local/lib/libdvb.a
+       ln -s libdvb.so.0.0.0 /usr/local/lib/libdvb.so
 
 libdvb.a: $(OBJS)
        ar -r libdvb.a $(OBJS) 
 
+libdvb.so: $(OBJS)
+       gcc -shared -o libdvb.so.0.0.0 $(OBJS) 
+
 merge_dvb: merge.cc libdvb.a DVB.hh
        g++ $(LIBS) $(INCLUDES) $(CFLAGS) -o merge_dvb merge.cc -ldvb 
 

Attachment: msg73630/pgp00000.pgp
Description: PGP signature

Reply via email to