]> git.pld-linux.org Git - packages/em8300.git/blobdiff - em8300.spec
- simplify %setup
[packages/em8300.git] / em8300.spec
index 070c194981d2416ee7956a57672616c4348efa66..51d33a9ccfb5f92bcf88fdfcdaecad137ba5a2da 100644 (file)
@@ -1,41 +1,47 @@
+# TODO
+# - cc
 #
 # Conditional build:
-%bcond_without dist_kernel     # without distribution kernel
+%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
-#
-# sparc(32) disabled - no I2C_ALGOBIT in kernel24
-%ifarch %{ix86} alpha ppc sparc64
-%define                _kernelsrcdir   /usr/src/linux-2.4
-%else
+%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.14.0
+Version:       0.15.2
 Release:       2
 License:       GPL
 Group:         Applications/System
 Source0:       http://dl.sourceforge.net/dxr3/%{name}-%{version}.tar.gz
-# Source0-md5: b0ea281df97c830642c5917cfc435d6c
+# Source0-md5: c203eade5e6002d279d50cae4a947964
 Source1:       %{name}.init
 Source2:       %{name}.sysconf
-Patch0:                %{name}-automake.patch
+Patch0:                %{name}-make.patch
 URL:           http://dxr3.sourceforge.net/
 %if %{with userspace}
 BuildRequires: autoconf
 BuildRequires: automake
-BuildRequires: libtool
 BuildRequires: gtk+-devel >= 1.2.0
 %endif
-%if %{with kernel} && %{with dist_kernel}
-BuildRequires: kernel24-headers >= 2.4
-BuildRequires: rpmbuild(macros) >= 1.118
+%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
-Requires:      %{name}-libs = %{version}-%{release}
 Provides:      dxr3
+Obsoletes:     em8300-libs
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -53,88 +59,68 @@ pozwalaj
 telewizyjne tych kart nie tylko w/w formatów, ale tak¿e wszystkich
 formatów video, które te programy rozpoznaj±.
 
-%package libs
-Summary:       libdxr3 library for DXR3/Hollywood+ cards
-Summary(pl):   Biblioteka libdxr3 do kart DXR3/Hollywood+
-Group:         Libraries
-
-%description libs
-libdxr3 library for DXR3/Hollywood+ cards.
-
-%description libs -l pl
-Biblioteka libdxr3 do kart DXR3/Hollywood+.
-
 %package devel
-Summary:       Files required to develop programs using em8300
-Summary(pl):   Pliki potrzebne do tworzenia programów korzystaj±cych z em8300
+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
-Requires:      %{name}-libs = %{version}-%{release}
+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.
-
-%package static
-Summary:       Static libraries for em8300
-Summary(pl):   Statyczne biblioteki dla em8300
-Group:         Development/Libraries
-Requires:      %{name}-devel = %{version}-%{release}
-
-%description static
-Static libraries for em8300.
-
-%description static -l pl
-Statyczne biblioteki dla 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+
+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 kernel24-video-em8300
+%package -n kernel-video-em8300
 Summary:       em8300 Linux kernel modules
 Summary(pl):   Modu³y j±dra Linuksa em8300
 Group:         Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_up}
 Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel_up
+Requires(postun):      %releq_kernel_up
+%endif
 
-%description -n kernel24-video-em8300
+%description -n kernel-video-em8300
 em8300 Linux kernel modules.
 
-%description -n kernel24-video-em8300 -l pl
+%description -n kernel-video-em8300 -l pl
 Modu³y j±dra Linuksa em8300.
 
-%package -n kernel24-smp-video-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
-%{?with_dist_kernel:%requires_releq_kernel_smp}
 Requires(post,postun): /sbin/depmod
+%if %{with dist_kernel}
+%requires_releq_kernel_smp
+Requires(postun):      %releq_kernel_smp
+%endif
 
-%description -n kernel24-smp-video-em8300
+%description -n kernel-smp-video-em8300
 em8300 Linux SMP kernel modules.
 
-%description -n kernel24-smp-video-em8300 -l pl
+%description -n kernel-smp-video-em8300 -l pl
 Modu³y j±dra Linuksa SMP em8300.
 
 %prep
 %setup -q
-%patch0 -p1
+%patch0 -p0
 
 %build
 %if %{with userspace}
-%{__libtoolize}
 %{__aclocal} -I autotools
 %{__autoconf}
 %{__autoheader}
@@ -144,19 +130,41 @@ Modu
 %endif
 
 %if %{with kernel}
-%{__make} -C modules \
-       KERNEL_LOCATION="%{_kernelsrcdir}" \
-       EM8300_DEBUG="%{rpmcflags} -D__KERNEL_SMP"
-
-for f in em8300.o adv717x.o bt865.o; do
-       mv -f modules/$f modules/$f.smp
+cd modules
+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
-
-%{__make} -C modules clean
-
-%{__make} -C modules \
-       KERNEL_LOCATION="%{_kernelsrcdir}" \
-       EM8300_DEBUG="%{rpmcflags}"
 %endif
 
 %install
@@ -166,27 +174,23 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
-mv -f modules/{INSTALL,INSTALL.modules}
-
-install -D modules/em8300.uc $RPM_BUILD_ROOT%{_datadir}/misc/em8300.uc
-
-install scripts/microcode_upload.pl $RPM_BUILD_ROOT%{_bindir}/em8300_microcode_upload
-
 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-
-rm -f $RPM_BUILD_ROOT%{_datadir}/em8300/{modules.tar.gz,em8300.sysv}
 %endif
 
 %if %{with kernel}
 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/video
-for f in em8300.o adv717x.o bt865.o; do
-       install modules/$f \
-               $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/video/$f
-       install modules/$f.smp \
-               $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/video/$f
+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
@@ -207,62 +211,50 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del %{name}
 fi
 
-%post  libs -p /sbin/ldconfig
-%postun        libs -p /sbin/ldconfig
-
-%post  -n kernel24-video-em8300
+%post  -n kernel-video-em8300
 %depmod %{_kernel_ver}
-%postun        -n kernel24-video-em8300
+
+%postun        -n kernel-video-em8300
 %depmod %{_kernel_ver}
 
-%post  -n kernel24-smp-video-em8300
+%post  -n kernel-smp-video-em8300
 %depmod %{_kernel_ver}smp
-%postun        -n kernel24-smp-video-em8300
+
+%postun        -n kernel-smp-video-em8300
 %depmod %{_kernel_ver}smp
 
 %if %{with userspace}
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README modules/{README*,INSTALL*,devices.sh,devfs_symlinks}
-%attr(755,root,root) %{_bindir}/em8300_microcode_upload
-%{_datadir}/misc/em8300.uc
+%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 size mtime md5) /etc/sysconfig/%{name}
-
-%files libs
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
-%{_includedir}/libdxr3
 %{_includedir}/linux/em8300.h
 
-%files static
-%defattr(644,root,root,755)
-%{_libdir}/lib*.a
-
 %files gtk
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/autocal
 %attr(755,root,root) %{_bindir}/dhc
 %attr(755,root,root) %{_bindir}/dxr3view
-%attr(755,root,root) %{_bindir}/em8300setup
 %endif
 
 %if %{with kernel}
-%files -n kernel24-video-em8300
+%files -n kernel-video-em8300
 %defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/kernel/drivers/video/*.o*
+/lib/modules/%{_kernel_ver}/kernel/drivers/video/*.ko*
 
-%files -n kernel24-smp-video-em8300
+%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/*.o*
+/lib/modules/%{_kernel_ver}smp/kernel/drivers/video/*.ko*
+%endif
 %endif
This page took 0.089275 seconds and 4 git commands to generate.