]> git.pld-linux.org Git - packages/em8300.git/blobdiff - em8300.spec
- simplify %setup
[packages/em8300.git] / em8300.spec
index d3034e8d26f6d6be8a35b1464fa649038f49d3ac..51d33a9ccfb5f92bcf88fdfcdaecad137ba5a2da 100644 (file)
@@ -1,26 +1,49 @@
-Summary:       dxr3 and h+ driver
-Summary(pl):   sterowniki dla dxr3 i h+
+# TODO
+# - cc
+#
+# Conditional build:
+%bcond_without dist_kernel     # allow non-distribution kernel
+%bcond_without kernel          # don't build kernel modules
+%bcond_without smp             # don't build SMP module
+%bcond_without userspace       # don't build userspace tools
+%bcond_with    verbose         # verbose build (V=1)
+
+%ifarch sparc
+# kernel modules won't build on sparc32, no I2C in kernel
+%undefine      with_kernel
+%endif
+
+%if !%{with kernel}
+%undefine      with_dist_kernel
+%endif
+
+Summary:       DXR3 and H+ driver
+Summary(pl):   Sterowniki dla DXR3 i H+
 Name:          em8300
-Version:       0.12.0
-Release:       1
+Version:       0.15.2
+Release:       2
 License:       GPL
-Group:         Base/Kernel
-Source0:       http://dxr3.sourceforge.net/download/%{name}-%{version}.tar.gz
+Group:         Applications/System
+Source0:       http://dl.sourceforge.net/dxr3/%{name}-%{version}.tar.gz
+# Source0-md5: c203eade5e6002d279d50cae4a947964
 Source1:       %{name}.init
 Source2:       %{name}.sysconf
+Patch0:                %{name}-make.patch
 URL:           http://dxr3.sourceforge.net/
+%if %{with userspace}
 BuildRequires: autoconf
 BuildRequires: automake
-BuildRequires: libtool
-BuildRequires: gtk+-devel
-Requires(post,postun): /sbin/ldconfig
-Requires(post,postun): /sbin/depmod
+BuildRequires: gtk+-devel >= 1.2.0
+%endif
+%if %{with kernel}
+%{?with_dist_kernel:BuildRequires:     kernel-module-build >= 3:2.6.14}
+BuildRequires: rpmbuild(macros) >= 1.286
+%endif
 Requires(post,preun):  /sbin/chkconfig
 Provides:      dxr3
+Obsoletes:     em8300-libs
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _xbindir                %{_prefix}/X11R6/bin
-
 %description
 em8300 is a Linux driver for Creative DXR3 and Sigma Designs
 Hollywood+ cards. Both cards are hardware MPEG1, MPEG2, AC3 decoders.
@@ -37,72 +60,142 @@ telewizyjne tych kart nie tylko w/w format
 formatów video, które te programy rozpoznaj±.
 
 %package devel
-Summary:       Files required to develop programs using em8300
-Summary(pl):   Pliki potrzebne do tworzenia programów korzystaj±cych z em8300
-Group:         Base/Kernel
-Requires:      %{name} = %{version}
+Summary:       Header file to communicate with em8300 Linux kernel modules
+Summary(pl):   Plik nag³ówkowy do komunikacji z modu³ami j±dra Linuksa em8300
+Group:         Development/Libraries
+Obsoletes:     em8300-static
 
 %description devel
-Header files and additional scripts useful for developers of em8300
-apps.
+Header file to communicate with em8300 Linux kernel modules.
 
 %description devel -l pl
-Pliki nag³ówkowe i skrypty przydatne dla autorów aplikacji
-korzystaj±cych z em8300.
+Plik nag³ówkowy do komunikacji z modu³ami j±dra Linuksa em8300.
 
 %package gtk
-Summary:       Utility programs for em8300 using gtk+
-Summary(pl):   Programy u¿ytkowe em8300 u¿ywaj±ce bibliteki gtk+
-Group:         Base/Kernel
-Requires:      %{name} = %{version}
+Summary:       Utility programs for em8300 using GTK+
+Summary(pl):   Programy u¿ytkowe em8300 u¿ywaj±ce bibliteki GTK+
+Group:         X11/Applications
+Requires:      %{name} = %{version}-%{release}
 
 %description gtk
-Utility programs for em8300 using gtk+ toolkit.
+Utility programs for em8300 using GTK+ toolkit.
 
 %description gtk -l pl
-Programy u¿ytkowe em8300 u¿ywaj±ce biblioteki gtk+.
+Programy u¿ytkowe em8300 u¿ywaj±ce biblioteki GTK+.
+
+%package -n kernel-video-em8300
+Summary:       em8300 Linux kernel modules
+Summary(pl):   Modu³y j±dra Linuksa em8300
+Group:         Base/Kernel
+Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel_up
+Requires(postun):      %releq_kernel_up
+%endif
+
+%description -n kernel-video-em8300
+em8300 Linux kernel modules.
+
+%description -n kernel-video-em8300 -l pl
+Modu³y j±dra Linuksa em8300.
+
+%package -n kernel-smp-video-em8300
+Summary:       em8300 Linux SMP kernel modules
+Summary(pl):   Modu³y j±dra Linuksa SMP em8300
+Group:         Base/Kernel
+Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel_smp
+Requires(postun):      %releq_kernel_smp
+%endif
+
+%description -n kernel-smp-video-em8300
+em8300 Linux SMP kernel modules.
+
+%description -n kernel-smp-video-em8300 -l pl
+Modu³y j±dra Linuksa SMP em8300.
 
 %prep
 %setup -q
+%patch0 -p0
 
 %build
-sh bootstrap
+%if %{with userspace}
+%{__aclocal} -I autotools
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %configure
 %{__make}
+%endif
+
+%if %{with kernel}
 cd modules
-make
+for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
+       if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
+               exit 1
+       fi
+       install -d o/include/linux
+       ln -sf %{_kernelsrcdir}/config-$cfg o/.config
+       ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
+       ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
+%if %{with dist_kernel}
+       %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
+%endif
+       install -d o/include/config
+       touch o/include/config/MARKER
+       ln -sf %{_kernelsrcdir}/scripts o/scripts
+
+       cp ../include/linux/em8300.h o/include/linux/em8300.h
+
+       %{__make} -C %{_kernelsrcdir} clean \
+               RCS_FIND_IGNORE="-name '*.ko' -o" \
+               SYSSRC=%{_kernelsrcdir} \
+               SYSOUT=$PWD/o \
+               M=$PWD O=$PWD/o \
+               %{?with_verbose:V=1}
+       %{__make} -C %{_kernelsrcdir} modules \
+               CC="%{__cc}" CPP="%{__cpp}" \
+               SYSSRC=%{_kernelsrcdir} \
+               SYSOUT=$PWD/o \
+               M=$PWD O=$PWD/o \
+               %{?with_verbose:V=1}
+
+       for i in em8300 adv717x bt865; do
+               mv $i{,-$cfg}.ko
+       done
+done
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT
 
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
-cd modules
-%{__make} install-newkern prefix=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT/lib/modules -name "*.o" -print | sed s,$RPM_BUILD_ROOT,, >../mods.lst
-mv INSTALL INSTALL.modules
-
-install -D em8300.uc $RPM_BUILD_ROOT/%{_datadir}/misc/em8300.uc
+%if %{with userspace}
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
 
-cd $RPM_BUILD_ROOT
-install -d ./%{_xbindir}
-mv ./%{_bindir}/* ./%{_xbindir}
+install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+%endif
 
-cd $RPM_BUILD_ROOT%{_datadir}
-install -m 755 em8300/microcode_upload.pl ../bin/em8300_microcode_upload
-install -D %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/%{name}
-install -D %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/%{name}
+%if %{with kernel}
+install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/video
+for i in adv717x bt865 em8300; do
+       install modules/$i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
+               $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/video/$i.ko
+done
+%if %{with smp} && %{with dist_kernel}
+for i in adv717x bt865 em8300; do
+       install modules/$i-smp.ko \
+               $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/video/$i.ko
+done
+%endif
+%endif
 
 %clean
-rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%{name}-%{version}
-
-%postun
-/sbin/ldconfig
-/sbin/depmod -a
+rm -rf $RPM_BUILD_ROOT
 
 %post
-/sbin/ldconfig
-/sbin/depmod -a
 /sbin/chkconfig --add %{name}
 if [ -f /var/lock/subsys/%{name} ]; then
        /etc/rc.d/init.d/%{name} restart 1>&2
@@ -118,25 +211,50 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del %{name}
 fi
 
-%files -f mods.lst
+%post  -n kernel-video-em8300
+%depmod %{_kernel_ver}
+
+%postun        -n kernel-video-em8300
+%depmod %{_kernel_ver}
+
+%post  -n kernel-smp-video-em8300
+%depmod %{_kernel_ver}smp
+
+%postun        -n kernel-smp-video-em8300
+%depmod %{_kernel_ver}smp
+
+%if %{with userspace}
+%files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog COPYING README 
-%doc modules/{README*,INSTALL*,devices.sh,devfs_symlinks}
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_datadir}/misc/*
-%attr(755,root,root) %{_libdir}/lib*.so.*
-%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
-%attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/%{name}
+%doc AUTHORS ChangeLog README modules/README*
+%attr(755,root,root) %{_bindir}/em8300setup
+/lib/firmware/em8300.bin
+%dir %{_datadir}/em8300
+%{_datadir}/em8300/em8300.pm
+%attr(755,root,root) %{_datadir}/em8300/*.pl
+%{_mandir}/man1/em8300setup.1*
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 
 %files devel
 %defattr(644,root,root,755)
-%{_includedir}/libdxr3
-%{_includedir}/linux/*
-%attr(755,root,root) %{_libdir}/lib*.so
-%attr(755,root,root) %{_libdir}/lib*.la
-%attr(755,root,root) %dir %{_datadir}/em8300
-%attr(755,root,root) %{_datadir}/em8300/*
+%{_includedir}/linux/em8300.h
 
 %files gtk
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_xbindir}/*
+%attr(755,root,root) %{_bindir}/autocal
+%attr(755,root,root) %{_bindir}/dhc
+%attr(755,root,root) %{_bindir}/dxr3view
+%endif
+
+%if %{with kernel}
+%files -n kernel-video-em8300
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}/kernel/drivers/video/*.ko*
+
+%if %{with dist_kernel} && %{with smp}
+%files -n kernel-smp-video-em8300
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}smp/kernel/drivers/video/*.ko*
+%endif
+%endif
This page took 0.090577 seconds and 4 git commands to generate.