[ATrpms-devel] [ATrpms-users] RPM macros for kmdl stuff [was Re: How to get earlier version of the package.]
Phil Schaffner
P.R.Schaffner at IEEE.org
Sat Aug 19 23:39:03 CEST 2006
On Thu, 2006-08-17 at 07:28 -0400, Phil Schaffner wrote:
...
> Will watch atrpms-devel for updates. It would certainly be nice to have
> the latest-greatest kmdl macro stuff as well. Was just comparing
> my .rpmmacros to those posted in the quoted thread to prepare to try
> [again] to rebuild ipw3945 modules for the latest FC6test2/rawhide
> kernel. Some of the test1/2 ATrpms kmdl packages have worked when I was
> able to get the kernel and the RPM packages in sync, but updating from
> rawhide makes it near-impossible to do this, and I also realize it would
> be impossible to have ATrpms support at the furious pace of rawhide
> updates. ...
Replying to myself (and cross-posting to atrpms-devel as this seems more
relevant there) with an update on my FC6test2 rebuild efforts. After
much searching of list archives, googling, and trial/error I have
succeeded in building the packages I need to support my Intel IPW3945ABG
WiFi and nVidia GeForce Go 7300 video on a Lenovo 3000 N100 laptop with
a rawhide kernel.
My ~/.rpmmacros file is attached. Ran "fedora-buildrpmtree" to set up
to build as a normal user, per Fedora Release Notes. Downloaded the
following src.rpm files from ATrpms and installed with "rpm -ivh
<package>.src.rpm"
ieee80211-1.1.14-13.at.src.rpm
ipw3945-1.1.0-12_pre2.fc5.91.at.src.rpm
ipw3945d-1.7.19-2.at.src.rpm
ipw3945-ucode-1.13-1.at.src.rpm
nvidia-graphics-1.0.8762-10.at.src.rpm
nvidia-graphics8762-1.0_8762-74.at.src.rpm
nvidia-graphics-devices-1.0-4.fc5.91.at.src.rpm
nvidia-graphics-helpers-0.0.14-14.fc5.91.at.src.rpm
Built as a user with the following commands (hopefully I am correctly
reconstructing the ordering), moving packages to a local repo, running
createrepo, and installing as root along the line as required.
rpmbuild -bb --define 'kmdl_userland 1' ieee80211.spec
rpmbuild -bb --target=i686-redhat-linux ieee80211.spec
IEEE80211_IGNORE_DUPLICATE=y rpmbuild -bb --target=i686-redhat-linux ipw3945.spec
rpmbuild -bb --define 'kmdl_userland 1' ipw3945.spec
rpmbuild -bb ipw3945-ucode.spec
rpmbuild -bb ipw3945d.spec
rpmbuild -bb nvidia-graphics8762.spec
rpmbuild -bb --define 'kmdl_userland 1' nvidia-graphics8762.spec
rpmbuild -bb nvidia-graphics.spec
rpmbuild -bb nvidia-graphics-devices.spec
rpmbuild -bb nvidia-graphics-helpers.spec
rpmbuild -bb --define 'kmdl_userland 1' nvidia-graphics8762.spec
rpmbuild -bb --target=i686-redhat-linux nvidia-graphics8762.spec
Ended up with the following installed:
ieee80211-1.1.14-13
ieee80211-devel-1.1.14-13
ipw3945-1.1.0-12_pre2.rhfc5.91.1.prs
ipw3945d-1.7.19-2.rhfc5.91.1.prs
ipw3945-ucode-1.13-1.rhfc5.91.1.prs
kernel-module-ieee80211-2.6.17-1.2564.fc6-1.1.14-13
kernel-module-ipw3945-2.6.17-1.2564.fc6-1.1.0-12_pre2.rhfc5.91.1.prs
kernel-module-nvidia-graphics8762-2.6.17-1.2564.fc6-1.0_8762-74
nvidia-graphics-1.0.8762-10.rhfc5.91.1.prs
nvidia-graphics8762-1.0_8762-74.fc5.90.at
nvidia-graphics8762-kmdl-2.6.17-1.2517.fc6-1.0_8762-74.fc5.90.at
nvidia-graphics8762-libs-1.0_8762-74.fc5.90.at
nvidia-graphics-devices-1.0-4.fc5.91.at
nvidia-graphics-helpers-0.0.14-14.fc5.91.at
Seems to be working OK for me (until inevitably broken by the next
rawhide update :-). Hope this is helpful to other FC6 testers. Any
corrections or comments on the macros or procedures welcome.
Phil
P.S.
Axel - sorry the IRC kmdl/kmod dialog did not go well. I've been using
your packages in preference to Livna's for some time and would like to
see kmdl as the standard, but I'm sure that carries no weight with the
Fedora heavy hitters.
-------------- next part --------------
## Should unpackaged files in a build root terminate a build?
## Note: The default value should be 0 for legacy compatibility.
%_unpackaged_files_terminate_build 1
## Should missing %doc files in the build directory terminate a build?
## Note: The default value should be 0 for legacy compatibility.
%_missing_doc_files_terminate_build 1
## Disable the -debug symbol packages
%debug_package %{nil}
## Build directory
%_topdir %(echo $HOME)/rpmbuild
%_smp_mflags -j5
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
#---------------------------------------------------------------------
## ATRPMS macros
%distversion %((test -e /etc/fedora-release && rpm -q fedora-release --qf "%{VERSION}") || (test -e /etc/redhat-release && rpm -q redhat-release --qf "%{VERSION}") || echo unknown)
%distinitials rh%(grep -i fedora /etc/redhat-release >/dev/null && echo "fc")
%distname %(grep -i fedora /etc/redhat-release >/dev/null && echo "Fedora Core" || echo "Red Hat Linux")
%disttag %{distinitials}%{distversion}
%disttag2 %(echo %disttag | sed -e's,\\.,_,g')
%atrelease() %1.%{disttag}.prs
# Previous defs:
#%distversion %(rpm -qf --qf='%{VERSION}' /etc/redhat-release)
#%distinitials rh%(grep -i fedora /etc/redhat-release >/dev/null && echo "fc")
#%distname %(grep -i fedora /etc/redhat-release >/dev/null && echo "Fedora Core" || echo "Red Hat Linux")
#%disttag %{distinitials}%{distversion}
#%disttag2 %(echo %disttag | sed -e 's,\\.,_,g')
#%atrelease() %1.%{disttag}.at
%eversion %{?epoch:%{epoch}:}%{version}
%evr %{?epoch:%{epoch}:}%{version}-%{release}
################################################################
%_initdir %{_sysconfdir}/rc.d/init.d
%_varlibdir %{_localstatedir}/lib
%_varcachedir %{_localstatedir}/cache
%_logdir %{_localstatedir}/log
%_rundir %{_localstatedir}/run
%_subsysdir %{_localstatedir}/lock/subsys
%_sysconfigdir %{_sysconfdir}/sysconfig
%_logrotatedir %{_sysconfdir}/logrotate.d
###
## ATRPMS kernel macros
# Use in specfiles:
# %kernelmodule foo
# %kerneldesc
# %{_kernel} in depmod, %kaddcustomkernel
# %kmdl_name
# %if %{kmain}
# %kernelconfig, %kreqprov
# %kmdlinstall
# %kernelname
# kflavour access only in lirc, deprecated
%_kernel %(uname -r)
%kmdl_kernelsrcdir /lib/modules/%{_kernel}/build
%kmdl_userland %(test "%{_kernel}" = none && echo 1 || echo 0)
%_kflavour %(echo %{_kernel} | grep -E '(smp|enterprise|bigmem)' | sed -e 's/^.*\\(smp\\|enterprise\\|bigmem\\).*$/\\1/')
#%_kversion %(echo %{_kernel} | sed -e 's/^\\(.*\\)\\(smp\\|enterprise\\|bigmem\\).*$/\\1/')
%_kversion %(echo %{_kernel} | sed -e's/^\\(.*\\)\\(smp\\|enterprise\\|bigmem\\).*$/\\1/')
#%_kversion %(uname -r)
%_krelver %(echo %{_kversion} | sed -e 's/-/_/')
%_kname %(echo kernel-%{_kflavour} | sed -e 's/-$//')
%_kname2 %(echo kmodule-%{_kflavour} | sed -e 's/-$//')
%_kname3 %(echo kmdl-%{_kflavour} | sed -e 's/-$//')
%_modflags -include /tmp/atrpms-mykernel-%{_kernel}-%{_target_cpu}.h -DMODULE -DMODVERSIONS -include %{_kernelsrcdir}/include/linux/modversions.h
# "kernel": the output of "uname -r" of the kernel to build for
# (default: the running one)
# "_kernelsrcdir": The directory of the sources used to build "kernel"
# (default: /lib/modules/%{_kernel}/build)
%kmdl_name kernel-module-%{_kpkgname}-%{_kernel}
%kmdl_nameof() kernel-module-%1-%{_kernel}
%kmdl_namepure kernel-module-%{_kpkgname}
%kmdl_namepureof() kernel-module-%1
#_kmdl_name_old %{_kpkgname}-kmdl-%{_kernel}
#_kmdl_nameof_old() %1-kmdl-%{_kernel}
#_kmdl_name_old %{_kpkgname}-%{_kname3}-%{_kversion}
#_kmdl_nameof_old() %1-%{_kname3}-%{_kversion}
#_kmdl_namepure_old %{_kpkgname}-kmdl
#_kmdl_namepureof_old() %1-kmdl
%_kernelbuildreq %{nil}
%kmdl() \
%{expand:%%global _kpkgname %1} \
%_kernelbuildreq \
%{nil}
%kmdl_parentdependencies\
Requires: %{kmdl_namepure}-%{evr}
%kmdl_dependencies\
Requires: atrpms-kmdl-helper \
#Requires: strictdep-%{_kname}-%{_target_cpu} = %{_kversion}\
Requires: /boot/vmlinuz-%{_kernel}\
Requires: %{_kname} = %{_kversion}, /sbin/depmod, modutils >= 2.4.14\
BuildRequires: %_kernelcompiler\
Provides: %kmdl_namepure-%{evr}\
Provides: %kmdl_namepure-%_kernel = %{evr}\
#\
# backward compatibility foo-kmdl\
Provides: Provides: %{_kpkgname}-%{_kname3}-%{_kversion} = %{evr}\
Provides: %{_kpkgname}-kmdl\
# backward compatibility with foo-kernel-...\
Provides: %{_kpkgname}-kernel\
%{?_kflavour:Provides: %{_kpkgname}-%{_kname}}\
Provides: %{_kpkgname}-%{_kname}-%{_kversion} = %{evr}\
Provides: %{_kpkgname}-%{_kname}-%{_kversion}-%{_target_cpu} = %{evr}\
# backward compatibility with unversioned kernel-module-foo\
Provides: kernel-module-%{_kpkgname}\
%{?_kflavour:Provides: %{_kname}-module-%{_kpkgname}}
%_kernelcompiler_rhfc6 /usr/bin/gcc
%_kernelcompiler_rhfc5_92_1 /usr/bin/gcc
%_kernelcompiler_rhfc5_91_1 /usr/bin/gcc
%_kernelcompiler_rhfc5_90_1 /usr/bin/gcc
%_kernelcompiler_rhfc5 /usr/bin/gcc
%_kernelcompiler_rhfc4 /usr/bin/gcc
%_kernelcompiler_rhfc3 /usr/bin/gcc
%_kernelcompiler_rhfc2 /usr/bin/gcc
%_kernelcompiler_rhfc1 /usr/bin/gcc32
%_kernelcompiler_rh9 /usr/bin/gcc
%_kernelcompiler_rh8_0 /usr/bin/gcc
%_kernelcompiler_rh7_3 /usr/bin/gcc
%_kernelcompiler %{expand:%%_kernelcompiler_%{disttag2}}
%kmdl_moduledir /lib/modules/%{_kernel}/updates
%kmdl_config\
export CC=%_kernelcompiler\
#/sbin/mkkerneldoth.atrpms %{_kernel} %{_target_cpu} > /tmp/atrpms-mykernel-%{_kernel}-%{_target_cpu}.h\
#mkdir -p %{buildroot}%{kmdl_moduledir}
%kmdl_desc\
This package contains the %kmdl_name kernel modules for the Linux kernel package:\
%{_kname}-%{_kversion}.%{_target_cpu}.rpm.
%_kernelname %{_kname}-%{_kversion}.%{_target_cpu}.rpm
%kmdl_install\
%{_datadir}/atrpms/addcustomkmdl '/lib/modules/`uname -r`/updates'\
depmod -ae -F /boot/System.map-%{_kernel} %{_kernel}
%kmdl_remove\
depmod -ae -F /boot/System.map-%{_kernel} %{_kernel}
# per Axel in http://www.gossamer-threads.com/lists/ivtv/devel/29217
%_x_includes %{_includedir}
%_x_libraries %{_libdir}
%_x_module_path %{_libdir}/xorg/modules
%_x_bindir %{_bindir}
#---------------------------------------------------------------------
## Unused/Historical??
#%_sourcedir %{_topdir}/SOURCES/%{name}
#%_initdir %{_sysconfdir}/rc.d/init.d
#%_varlibdir %{_localstatedir}/lib
#%_varcachedir %{_localstatedir}/cache
#%_logdir %{_localstatedir}/log
#%_rundir %{_localstatedir}/run
#%_subsysdir %{_localstatedir}/lock/subsys
#%_sysconfigdir %{_sysconfdir}/sysconfig
#%_logrotatedir %{_sysconfdir}/logrotate.d
#%__home %(echo $HOME)
#%_distversion %((test -e /etc/fedora-release && rpm -q fedora-release --qf "fc%{VERSION}") || (test -e /etc/redhat-release && rpm -q redhat-release --qf "%{VERSION}") || echo unknown)
#%_builddir %{_tmppath}/BUILD
#%_rpmdir %{_topdir}/RPMS/%{_distversion}
#%atrelease() %1.%{_distversion}.at
#%_initdir %{_sysconfdir}/rc.d/init.d
#%_varlibdir %{_localstatedir}/lib
#%_varcachedir %{_localstatedir}/cache
#%_logdir %{_localstatedir}/log
#%_rundir %{_localstatedir}/run
#%_subsysdir %{_localstatedir}/lock/subsys
#%_sysconfigdir %{_sysconfdir}/sysconfig
#%_logrotatedir %{_sysconfdir}/logrotate.d
More information about the atrpms-devel
mailing list