RFC: kernel-modules in Fedora Extras

Thorsten Leemhuis fedora at leemhuis.info
Sun Jan 8 17:48:51 UTC 2006


Am Samstag, den 07.01.2006, 23:19 +0200 schrieb Ville Skyttä:
> On Sat, 2006-01-07 at 13:12 +0000, David Woodhouse wrote:
> > On Sat, 2006-01-07 at 13:50 +0100, Thorsten Leemhuis wrote:
> > > Panu (or everybody else of course), any idea how to implement it? I
> > > searched a bit for the syntax of "%foreach", but wasn't able to find
> > > anything. We of course could add a lot of "--with smp" "--with foo",
> > > put we still would have to hardcode the names :-| . 
> > 
> > I did tell you it wasn't pretty.
> > 
> > http://david.woodhou.se/modspec.tar.gz
> 
> Something like this sounds ok to me provided the helpers will find their
> way to eg. redhat-rpm-config and the ugliness doesn't need to be put
> into every kmod specfile.

How about the attached stuff? Find a SRPM for experiments at
http://www.leemhuis.info/files/fedorarpms/SRPMS.fdr/lirc-kmod-0.8.0-0.7.pre3.2.6.14_1.1776_FC4.src.rpm

I planed to bury fedora-kmodhelper, but then I thought this would be the
moment to kick it back to live. Old cruft removed. Maybe we should name
it fedora-kmodhelper2 to avoid problems, but on on a second though it's
probably not worth the trouble because (hopefully) nobody is using the
old version anymore anyway. 

Comments?
-- 
Thorsten Leemhuis <fedora at leemhuis.info>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fedora-kmodhelper
Type: application/x-shellscript
Size: 4600 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-extras-list/attachments/20060108/ea6beb97/attachment.bin>
-------------- next part --------------
# TODO: cmdir: (req: extra hw driver, http://www.innovationone.ca/)

# this {sh,c}ould be external and a BR
Source10:	fedora-kmodhelper

                %define kmod_name  lirc
                %define kverrel    %(%SOURCE10 verrel %{?kver} 2>/dev/null)
%{!?kvariants:  %global kvariants  %(%SOURCE10 variant %{?kver} 2>/dev/null)}

Name:           %{kmod_name}-kmod
Version:        0.8.0
Release:        0.7.pre3.%(echo %{kverrel} | tr - _)
Summary:        LIRC kernel modules

Group:          System Environment/Kernel
License:        GPL
#Source0:        http://download.sourceforge.net/lirc/%{name}-%{version}.tar.bz2
Source0:        http://lirc.sf.net/software/snapshots/lirc-0.8.0pre3.tar.bz2
Patch0:         %{name}-0.8.0pre2-gpio-no-bttvp.patch
URL:            http://www.lirc.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
LIRC is a package that allows you to decode and send infra-red and
other signals of many (but not all) commonly used remote controls.
Included applications include daemons which decode the received
signals as well as user space applications which allow controlling a
computer with a remote control.  This package contains additional
kernel modules to support additional remote control units.

# magic hidden here:
%{expand:%(%{SOURCE10} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)}

%prep
# to understand the magic easier s/#/% the next line:
#{SOURCE10} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null ; sleep 5
%setup -q -n lirc-0.8.0pre3
%{__patch} -p0 < %{PATCH0}
# save configure (is patches for some smp targets)
cp configure configure.org
# temp target dir for modules
mkdir "$(pwd)"/.modules_dir

%build
for kvariant in %{kvariants}
do
    [[ "${kvariant}" ]] || kvariant=up
    # cmdir: unknown symbols (cmdir_{read,write}, set_tx_channels), needs
    # additional hw driver from http://www.innovationone.ca/
    # gpio: missing drivers/media/video/bttv.h in kernel-devel (?)
    ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant#up}-%{_target_cpu}
    nobuild="cmdir"
    [ -e $ksrc/drivers/media/video/bttv.h ] || nobuild="$nobuild gpio"
    [ "${kvariant}" = "smp" ] && nobuild="$nobuild parallel"
    for drv in $nobuild ; do
        sed -i -e "/^\\s*(lirc_dev lirc_$drv)/d" -e "/^\\s*lirc_$drv/d" \
            configure*
    done
    touch -r aclocal.m4 configure.in # avoid autofoo re-run
    %configure \
        --enable-sandboxed \
        --with-kerneldir=%{_usrsrc}/kernels/%{kverrel}${kvariant#up}-%{_target_cpu} \
        --with-moduledir=/lib/modules/%{kverrel}${kvariant#up}/extra/%{kmod_name} \
        --with-driver=all
    make %{?_smp_mflags} -C drivers
    make -C drivers install \
        DESTDIR="$(pwd)"/.modules_dir
    make -C drivers clean
    # reinstall old configure
    cp configure.org configure
done


%install
rm -rf $RPM_BUILD_ROOT
cp -av "$(pwd)"/.modules_dir $RPM_BUILD_ROOT
rm -rf "$(pwd)"/.modules_dir
chmod u+x $RPM_BUILD_ROOT/lib/modules/*/extra/%{kmod_name}/*


%clean
rm -rf $RPM_BUILD_ROOT


%changelog
* Sun Jan  8 2006 Thorsten Leemhuis <fedora at leemhuis.info> - 0.8.0-0.7.pre3
- Experiment with a new fedora-kmodhelper
- use a different approach for extracting/build/install

* Wed Jan  4 2006 Ville Skyttä <ville.skytta at iki.fi> - 0.8.0-0.6.pre3
- Drop 2.6.15pre support hack.
- Clean up unneeded kernel-devel build dependency.

* Sun Jan  1 2006 Ville Skyttä <ville.skytta at iki.fi> - 0.8.0-0.5.pre3
- 0.8.0pre3.

* Wed Dec 28 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.8.0-0.5.pre2
- Build non-UP modules against the correct source tree, D'oh!
- Patch gpio driver to not require bttvp.h (private), build and ship it
  if bttv.h is in kernel-devel.
- Disable parallel driver with SMP.

* Wed Dec 28 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.8.0-0.4.pre2
- s/kmod-config(lirc)/lirc-kmod-common/

* Tue Dec 27 2005 Ville Skyttä <ville.skytta at iki.fi> - 0.8.0-0.3.pre2
- Split from the main lirc package, adapt to new kmod standard.
- Disable debugging features.


More information about the fedora-extras-list mailing list