rpms/buildsys-build-rpmfusion/devel buildsys-build-rpmfusion-list-kernels.sh, 1.2, 1.3
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/buildsys-build-rpmfusion/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv25452
Modified Files:
buildsys-build-rpmfusion-list-kernels.sh
Log Message:
fix another leftover in buildsys-build-rpmfusion-list-kernels.sh
Index: buildsys-build-rpmfusion-list-kernels.sh
===================================================================
RCS file: /cvs/free/rpms/buildsys-build-rpmfusion/devel/buildsys-build-rpmfusion-list-kernels.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- buildsys-build-rpmfusion-list-kernels.sh 2 Oct 2008 18:38:38 -0000 1.2
+++ buildsys-build-rpmfusion-list-kernels.sh 2 Oct 2008 19:11:59 -0000 1.3
@@ -86,7 +86,7 @@
# go
${this_command} ${this_grepoptions} ${this_kernellistfiles} | while read this_kernel; do
- this_kernel_verrel=${this_kernel%%$kernels_known_variants}
+ this_kernel_verrel=${this_kernel%%-$kernels_known_variants}
this_kernel_variant=${this_kernel##$this_kernel_verrel}
if [[ "${requires}" ]] || [[ "${buildrequires}" ]]; then
@@ -100,11 +100,11 @@
fi
else
if [[ "${requires}" ]]; then
- echo "Requires: kernel-devel-uname-r = ${this_kernel}.${this_target}"
+ echo "Requires: kernel-devel-uname-r = ${this_kernel_verrel}.${this_target}${this_kernel_variant:+.${this_kernel_variant##-}}"
fi
if [[ "${buildrequires}" ]]; then
- echo "BuildRequires: kernel-devel-uname-r = ${this_kernel}.${this_target}"
+ echo "BuildRequires: kernel-devel-uname-r = ${this_kernel_verrel}.${this_target}${this_kernel_variant:+.${this_kernel_variant##-}}"
fi
fi
else
16 years, 1 month
rpms/buildsys-build-rpmfusion/devel buildsys-build-rpmfusion-list-kernels.sh, 1.1, 1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/buildsys-build-rpmfusion/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv23504
Modified Files:
buildsys-build-rpmfusion-list-kernels.sh
Log Message:
fix leftover in buildsys-build-rpmfusion-list-kernels.sh
Index: buildsys-build-rpmfusion-list-kernels.sh
===================================================================
RCS file: /cvs/free/rpms/buildsys-build-rpmfusion/devel/buildsys-build-rpmfusion-list-kernels.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- buildsys-build-rpmfusion-list-kernels.sh 2 Oct 2008 17:05:32 -0000 1.1
+++ buildsys-build-rpmfusion-list-kernels.sh 2 Oct 2008 18:38:38 -0000 1.2
@@ -100,11 +100,11 @@
fi
else
if [[ "${requires}" ]]; then
- echo "Requires: kernel-devel-uname-r = ${this_kernel}"
+ echo "Requires: kernel-devel-uname-r = ${this_kernel}.${this_target}"
fi
if [[ "${buildrequires}" ]]; then
- echo "BuildRequires: kernel-devel-uname-r = ${this_kernel}"
+ echo "BuildRequires: kernel-devel-uname-r = ${this_kernel}.${this_target}"
fi
fi
else
16 years, 1 month
rpms/buildsys-build-rpmfusion/devel buildsys-build-rpmfusion.spec, 1.2, 1.3
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/buildsys-build-rpmfusion/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv21533
Modified Files:
buildsys-build-rpmfusion.spec
Log Message:
always think of the epochs; and make debugging outbit a bit more verbose
Index: buildsys-build-rpmfusion.spec
===================================================================
RCS file: /cvs/free/rpms/buildsys-build-rpmfusion/devel/buildsys-build-rpmfusion.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- buildsys-build-rpmfusion.spec 2 Oct 2008 17:09:00 -0000 1.2
+++ buildsys-build-rpmfusion.spec 2 Oct 2008 18:01:58 -0000 1.3
@@ -36,7 +36,7 @@
%package kerneldevpkgs-current
Summary: Meta-package to get all current kernel-devel packages into the buildroot
Group: Development/Tools
-Requires: %{name} = %{version}-%{release}
+Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-kerneldevpkgs-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-kerneldevpkgs-current-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-kerneldevpkgs-newest-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
@@ -58,7 +58,7 @@
%prep
# for debugging purposes output the stuff we use during the rpm generation
-bash %{SOURCE2} --current --requires --buildrequires --prefix %{_sourcedir}/%{name}- | grep -v '^Requires'
+bash %{SOURCE2} --current --requires --buildrequires --prefix %{_sourcedir}/%{name}-
sleep 2
16 years, 1 month
rpms/gspca-kmod/devel gspca-kmod.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 Makefile, 1.1, 1.2 sources, 1.1, 1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/gspca-kmod/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv20622
Modified Files:
.cvsignore Makefile sources
Added Files:
gspca-kmod.spec
Log Message:
initial import to RPM Fusion; also test build for kmod stuff (testing newest hadling in devel branch and ppc/ppc64 building)
--- NEW FILE gspca-kmod.spec ---
# buildforkernels macro hint: when you build a new version or a new release
# that contains bugfixes or other improvements then you must disable the
# "buildforkernels newest" macro for just that build; immediately after
# queuing that build enable the macro again for subsequent builds; that way
# a new akmod package will only get build when a new one is actually needed
%define buildforkernels newest
%define tarball_name gspcav1-20071224
Name: gspca-kmod
Version: 1.00.20
Release: 30%{?dist}.1
Summary: gspca Webcam Kernel Module
Group: System Environment/Kernel
License: GPLv2+
URL: http://mxhaard.free.fr/download.html
Source0: http://mxhaard.free.fr/spca50x/Download/%{tarball_name}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i586 i686 x86_64 ppc ppc64
# get the needed BuildRequires (in parts depending on what we build for)
BuildRequires: %{_bindir}/kmodtool
%{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} }
# kmodtool does its magic here
%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
This RPM contains the gspca binary Linux kernel module build for %{kernel}. It
provides support for up to 260 different webcams not included in the default
kernel
%prep
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
# go
%setup -q -c -T -a 0
for kernel_version in %{?kernel_versions}; do
cp -a %{tarball_name} _kmod_build_${kernel_version%%___*}
done
%build
for kernel_version in %{?kernel_versions}; do
make V=1 -C "${kernel_version##*___}" SUBDIRS=${PWD}/_kmod_build_${kernel_version%%___*}
done
%install
rm -rf $RPM_BUILD_ROOT
for kernel_version in %{?kernel_versions}; do
install -D -m 755 _kmod_build_${kernel_version%%___*}/gspca.ko $RPM_BUILD_ROOT%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/gspca.ko
done
%{?akmod_install}
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Oct 02 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.20-30
- build for rpmfusion
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.20-4
- build for f9
* Sat Jan 26 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.20-3
- rebuild for new kmodtools, akmod adjustments
* Sun Jan 20 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.20-2
- build akmods package
* Thu Dec 27 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.20-1
- Rebase to upstream
* Thu Dec 20 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.18-7
- rebuilt for 2.6.21-2952.fc8xen 2.6.23.9-85.fc8
* Mon Dec 03 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.18-6
- remove leftover from old kmodtool
- add dist
* Mon Dec 03 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.18-5
- rebuilt for 2.6.23.8-63.fc8 2.6.21-2952.fc8xen
- enable debuginfo packages again and build verbosely
* Sat Nov 10 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 1.00.18-4
- rebuilt for 2.6.23.1-49.fc8
* Mon Nov 5 2007 Thorsten Leemhuis <fedora [AT] leemhuis.info> - 1.00.18-3
- Fix copy call in prep, as it breaks when building for multiple kernels
- adjust to recent kmod model in livna devel
- disable debuginfo, as xen build will fail otherwise
* Sun Nov 4 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.18-2
- Spec file cleanup
* Sun Oct 28 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.18-1
- Initial release
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/gspca-kmod/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 30 Sep 2008 16:44:58 -0000 1.1
+++ .cvsignore 2 Oct 2008 17:49:08 -0000 1.2
@@ -0,0 +1 @@
+gspcav1-20071224.tar.gz
Index: Makefile
===================================================================
RCS file: /cvs/free/rpms/gspca-kmod/devel/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 30 Sep 2008 16:44:58 -0000 1.1
+++ Makefile 2 Oct 2008 17:49:08 -0000 1.2
@@ -1,18 +1,18 @@
-# Makefile for source rpm: gspca-kmod
+# Makefile for source rpm: ntfs-kmod
# $Id$
NAME := gspca-kmod
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ../../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/.svn/entries -a -w $$/Makefile.common ] ; then cd $$d ; svn -q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+test -f .svn/entries && { svn -q checkout $$(svn info |grep '^URL :'|cut -d' ' -f 3|cut -d/ -f -4)/common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' directory module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
Index: sources
===================================================================
RCS file: /cvs/free/rpms/gspca-kmod/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 30 Sep 2008 16:44:58 -0000 1.1
+++ sources 2 Oct 2008 17:49:09 -0000 1.2
@@ -0,0 +1 @@
+14853ba1f4edc1e685039fca56e5ebf2 gspcav1-20071224.tar.gz
16 years, 1 month
rpms/gspca/devel gspca.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 Makefile, 1.1, 1.2 sources, 1.1, 1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/gspca/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv19140
Modified Files:
.cvsignore Makefile sources
Added Files:
gspca.spec
Log Message:
inital import to rpmfusion
--- NEW FILE gspca.spec ---
Name: gspca
Version: 1.00.20
Release: 2%{?dist}
Summary: Common parts belonging to the gspca Webcam Kernel Module
Group: System Environment/Kernel
License: GPLv2+
URL: http://mxhaard.free.fr/download.html
Source0: http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: gspca-kmod >= %{version}
Provides: gspca-kmod-common = %{version}-%{release}
BuildArch: noarch
%description
This RPM contains the common parts belonging to the gspca Webcam Kernel Module,
which provides support for up to 260 different webcams not included in the
default kernel
%prep
%setup -c -q
%build
iconv -f ISO_8859-1 -t UTF-8 gspcav1-20071224/changelog --output gspcav1-20071224/changelog.utf8
cp -af gspcav1-20071224/changelog.utf8 gspcav1-20071224/changelog
%install
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc gspcav1-20071224/changelog
%changelog
* Thu Oct 02 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 1.00.20-2
- rebuild for rpm fusion
* Thu Dec 27 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.20-1
- Rebase to upstream
* Mon Nov 5 2007 Thorsten Leemhuis <fedora [AT] leemhuis.info> - 1.00.18-3
- create RPM_BUILD_ROOT during install, as find-debuginfo.sh from F8
will complain otherwise
* Sun Nov 4 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.18-2
- Spec file cleanup
* Sun Oct 28 2007 Jonathan Dieter <jdieter(a)gmail.com> - 1.00.18-1
- Initial release
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/gspca/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 30 Sep 2008 16:44:46 -0000 1.1
+++ .cvsignore 2 Oct 2008 17:32:41 -0000 1.2
@@ -0,0 +1 @@
+gspcav1-20071224.tar.gz
Index: Makefile
===================================================================
RCS file: /cvs/free/rpms/gspca/devel/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 30 Sep 2008 16:44:46 -0000 1.1
+++ Makefile 2 Oct 2008 17:32:41 -0000 1.2
@@ -1,18 +1,18 @@
-# Makefile for source rpm: gspca
+# Makefile for source rpm: ntfs-kmod
# $Id$
NAME := gspca
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ../../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/.svn/entries -a -w $$/Makefile.common ] ; then cd $$d ; svn -q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+test -f .svn/entries && { svn -q checkout $$(svn info |grep '^URL :'|cut -d' ' -f 3|cut -d/ -f -4)/common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' directory module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
Index: sources
===================================================================
RCS file: /cvs/free/rpms/gspca/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 30 Sep 2008 16:44:46 -0000 1.1
+++ sources 2 Oct 2008 17:32:41 -0000 1.2
@@ -0,0 +1 @@
+14853ba1f4edc1e685039fca56e5ebf2 gspcav1-20071224.tar.gz
16 years, 1 month
rpms/akmods/devel akmods, NONE, 1.1 akmods.spec, NONE, 1.1 akmodsbuild, NONE, 1.1 akmodsbuild.1, NONE, 1.1 akmodsinit, NONE, 1.1 akmodsposttrans, NONE, 1.1
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/akmods/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv18556
Added Files:
akmods akmods.spec akmodsbuild akmodsbuild.1 akmodsinit
akmodsposttrans
Log Message:
inital import to rpmfusion
--- NEW FILE akmods ---
#!/bin/bash -
############################################################################
#
# akmods - Rebuilds and install akmod RPMs
# Copyright (c) 2007, 2008 Thorsten Leemhuis <fedora(a)leemhuis.info>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
############################################################################
#
# ToDo:
# - use yum on install required kernel-devel pacakges?
# - subprocess on dameon stop?
# - better way to detect if a earlier build failed or succeed
# - manpage
# - make use of the new posttrans hook in kenrel package?
# - locking?
# - special kernel "all" (all that are installed with a matching -devel package; could be called from posttrans in akmods packages)
# global vars
myprog="akmods"
myver="0.3.3"
kmodlogfile=
continue_line=""
tmpdir=
kernels=
verboselevel=2
akmods_echo()
{
# where to output
local this_fd=${1}
shift
# verboselevel
local this_verbose=${1}
shift
# output to console
if [[ ! ${daemon} ]] && (( ${verboselevel} >= ${this_verbose} )) ; then
if [[ "${1}" == "--success" ]] ; then
echo_success
continue_line=""
echo
return 0
elif [[ "${1}" == "--failure" ]]; then
echo_failure
echo
continue_line=""
return 0
elif [[ "${1}" == "--warning" ]]; then
echo_warning
echo
continue_line=""
return 0
elif [[ "${1}" == "-n" ]]; then
continue_line="true"
fi
echo "$@" >&${this_fd}
fi
# no need to print the status flags in the logs
if [[ "${1}" == "--success" ]] || [[ "${1}" == "--failure" ]] || [[ "${1}" == "--warning" ]]; then
return 0
fi
# no need to continues in the log
if [[ "${1}" == "-n" ]]; then
shift
fi
# global logfile
echo "$(date +%d\ %b\ %H:%M:%S) akmods: $@" >> "/var/cache/akmods/akmods.log"
# the kmods logfile as well, if we work on a kmod
if [[ "${kmodlogfile}" ]]; then
echo "$(date +%d\ %b\ %H:%M:%S) akmods: $@" >> "${kmodlogfile}"
fi
}
finally()
{
# remove tmpfiles
remove_tmpdir
# remove pidfile
[[ "${daemon}" ]] && rm -f /var/run/${myprog}.pid
exit 128
}
trap "finally" ABRT EXIT HUP INT QUIT
create_tmpdir()
{
if ! tmpdir="$(mktemp -d -t ${myprog}.XXXXXXXX)/" ; then
akmods_echo 2 1 "ERROR: failed to create tmpdir."
akmods_echo 2 1 --failure; return 1
fi
if ! mkdir "${tmpdir}"results ; then
akmods_echo 2 1 "ERROR: failed to create result tmpdir."
akmods_echo 2 1 --failure; return 1
fi
}
remove_tmpdir()
{
# remove tmpfiles
if [[ "${tmpdir}" ]] && [[ -d "${tmpdir}" ]]; then
rm -f "${tmpdir}"results/* "${tmpdir}"*.log
rmdir "${tmpdir}"results/ "${tmpdir}"
fi
}
cleanup_cachedir ()
{
create_tmpdir
find /boot/ -maxdepth 1 -name 'vmlinuz*' | sed 's|/boot/vmlinuz-||' > "${tmpdir}"results/kernels
find "/var/cache/akmods/" -maxdepth 2 -mtime +14 -type f \( -name '*.rpm' -or -name '*.log' \) | grep -v --file "${tmpdir}"results/kernels | xargs --no-run-if-empty rm
remove_tmpdir
}
init ()
{
# some security provisions
\export PATH='/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
\unalias -a
hash -r
ulimit -H -c 0 --
IFS=$' \t\n'
UMASK=022
umask ${UMASK}
# fall back to current kernel if user didn't provide one
if [[ ! "${kernels}" ]]; then
kernels="$(uname -r)"
fi
# we get the echo_{success,failure} stuff and the daemon method from there
if [[ -r /etc/rc.d/init.d/functions ]]; then
source /etc/rc.d/init.d/functions
else
echo "/etc/rc.d/init.d/functions not found" >&2
exit 1
fi
# needs root permissions
if [[ ! -w / ]]; then
echo -n "Needs to run as root to be able to install rpms." >&2
echo_failure; echo; exit 1
fi
# no akmods
if [[ ! -d "/usr/src/akmods/" ]] ; then
echo -n "/usr/src/akmods/ not found." >&2
echo_failure; echo; exit 1
fi
# if there are no akmod packages installed there is nothing to do for us
if ! ls /usr/src/akmods/*-kmod.latest &> /dev/null ; then
echo -n "No akmod packages found." >&2
echo_failure; echo; exit 1
fi
# now that we know that we're root make sure our dir for logging and results is avilable
if [[ ! -d "/var/cache/akmods/" ]] ; then
if ! mkdir -p "/var/cache/akmods/" ; then
echo -n "/var/cache/akmods/ not found and could not be created" >&2
echo_failure; echo; exit 1
fi
fi
if [[ ! -w "/var/cache/akmods/" ]] ; then
echo -n "${directory} not writable" >&2
echo_failure; echo; exit 1
fi
# tools needed
for tool in akmodsbuild chown sed rpmdev-vercmp; do
if ! which "${tool}" &> /dev/null ; then
echo -n "${tool} not found" >&2
echo_failure; echo; exit 1
fi
done
}
buildinstall_kmod()
{
local this_kernelver=${1}
local this_kmodname=${2}
local this_kmodsrpm=${3}
local this_kmodverrel=${4}
if [[ ! -r "${this_kmodsrpm}" ]]; then
akmods_echo 2 1 "ERROR: ${this_kmodsrpm} not found."
akmods_echo 2 1 --failure; return 1
fi
# result and logdir
if [[ ! -d "/var/cache/akmods/${this_kmodname}" ]]; then
if ! mkdir "/var/cache/akmods/${this_kmodname}" ; then
akmods_echo 2 1 "ERROR: could not create /var/cache/akmods/${this_kmodname}."
akmods_echo 2 1 --failure; return 1
fi
fi
## preparations
# tmpdir
create_tmpdir
# akmods needs to write there (and nobody else, but mktemp takes care fo that!)
chown akmods "${tmpdir}" "${tmpdir}"results
# remove old logfiles if they exist
rm -f "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.log" "/var/cache/akmods/${this_kmodname}/.last.log"
# create a per kmod logfile
if ! touch "/var/cache/akmods/${this_kmodname}/.last.log" ; then
akmods_echo 2 1 "ERROR: failed to create kmod specific logfile."
return 1
fi
# akmods_echo will log to this file from now on as well
kmodlogfile="/var/cache/akmods/${this_kmodname}/.last.log"
# build module using akmod
akmods_echo 1 4 "Building RPM using the command '$(which akmodsbuild) --target $(uname -m) --kernels ${this_kernelver} ${this_kmodsrpm}'"
/sbin/runuser -s /bin/bash -c "$(which akmodsbuild) --quiet --quiet --target $(uname -m) --kernels ${this_kernelver} --outputdir ${tmpdir}results --logfile ${tmpdir}/akmodsbuild.log ${this_kmodsrpm}" akmods >> "${kmodlogfile}" 2>&1
local returncode=$?
# copy rpmbuild log to kmod specific logfile
if [[ -s "${tmpdir}"/akmodsbuild.log ]]; then
while read line ; do
echo "$(date +%d\ %b\ %H:%M:%S) akmodsbuild: ${line}" >> "${kmodlogfile}"
done < "${tmpdir}"/akmodsbuild.log
fi
# result
if (( ! ${returncode} == 0 )); then
if [[ "${continue_line}" ]]; then
akmods_echo 1 2 --failure
fi
akmods_echo 2 1 "Building rpms failed; see /var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.failed.log for details"
cp -l "${kmodlogfile}" "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.failed.log"
kmodlogfile=""
remove_tmpdir
return 4
fi
# install
akmods_echo 1 4 "Installing newly built rpms"
rpm -U $(find "${tmpdir}results" -type f -name '*.rpm' | grep -v debuginfo) >> "${kmodlogfile}" 2>&1
local returncode=$?
# place the newly built rpms where user expects them
cp "${tmpdir}results/"* "/var/cache/akmods/${this_kmodname}/"
# everything fine?
if (( ${returncode} != 0 )); then
if [[ "${continue_line}" ]]; then
akmods_echo 1 2 --failure
fi
akmods_echo 2 1 "Could not install newly built RPMs. You can find them and the logfile"
akmods_echo 2 1 "${this_kmodverrel}-for-${this_kernelver}.failed.log in /var/cache/akmods/${this_kmodname}/"
cp -l "${kmodlogfile}" "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.failed.log"
kmodlogfile=""
remove_tmpdir
return 8
fi
# finish
akmods_echo 1 4 "Successful."
cp -l "${kmodlogfile}" "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}.log"
kmodlogfile=""
remove_tmpdir
return 0
}
check_kmod_up2date()
{
local this_kernelver=${1}
local this_kmodname=${2}
# kmod present?
if [[ ! -d /lib/modules/${this_kernelver}/extra/${this_kmodname}/ ]] ; then
# build it
return 1
fi
# kmod up2date?
local kmodpackage="$(rpm -qf /lib/modules/${this_kernelver}/extra/${this_kmodname}/ 2> /dev/null)"
if [[ ! "${kmodpackage}" ]]; then
# seems we didn't get what we wanted
# well, better to do nothing in this case
akmods_echo 1 2 -n "Warning: Could not determine what package owns /lib/modules/${this_kernelver}/extra/${this_kmodname}/"
return 0
fi
local kmodver=$(rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}\n' "${kmodpackage}" | sed 's|(none)|0|; s!\.\(fc\|lvn\)[0-9]*!!g')
local akmodver=$(rpm -qp --qf '%{EPOCH}:%{VERSION}-%{RELEASE}\n' /usr/src/akmods/"${this_kmodname}"-kmod.latest | sed 's|(none)|0|; s!\.\(fc\|lvn\)[0-9]*!!g')
# are they equal?
if [[ "${kmodver}" == "${akmodver}" ]]; then
return 0
fi
local newestpkgver=$(rpmdev-vercmp "${kmodver}" "${akmodver}" 2>/dev/null | awk '{print $1}')
if [[ ! "${kmodver}" ]] || [[ ! "${akmodver}" ]] || [[ ! "${newestpkgver}" ]] ; then
# seems we didn't get what we wanted
# well, better to do nothing in this case
akmods_echo 1 2 -n "Warning: Could not determine if akmod is newer then the installed kmod"
return 0
elif [[ "${akmodver}" == "${newestpkgver}" ]] ; then
# build it
return 1
else
return 0
fi
}
check_kmods()
{
local this_kernelver="${1}"
akmods_echo 1 2 -n "Checking kmods exist for ${this_kernelver}"
for akmods_kmodfile in /usr/src/akmods/*-kmod.latest ; do
local this_kmodname="$(basename ${akmods_kmodfile%%-kmod.latest})"
# actually check this akmod?
if [[ "${akmods}" ]]; then
for akmod in ${akmods} ; do
if [[ "${this_kmodname}" != "${akmod}" ]] ; then
# ignore this one
continue 2
fi
done
fi
# go
if ! check_kmod_up2date ${this_kernelver} ${this_kmodname} ; then
# okay, kmod wasn't found or is not up2date
if [[ "${continue_line}" ]]; then
akmods_echo 1 2 --warning
# if the files for building modules are not avilable don't even try to build modules
if [[ ! -r /usr/src/kernels/"${this_kernelver}"/Makefile ]] || [[ ! -r /lib/modules/${this_kernelver}/build/Makefile ]]; then
akmods_echo 1 2 "Files needed for building modules against kernel"
akmods_echo 1 2 "${this_kernelver} could not be found as the following"
akmods_echo 1 2 "directories are missing:"
akmods_echo 1 2 "/usr/src/kernels/${this_kernelver}/"
akmods_echo 1 2 -n "/lib/modules/${this_kernelver}/build/"
akmods_echo 1 2 --failure
return 1
fi
fi
local this_kmodverrel="$(rpm -qp --qf '%{VERSION}-%{RELEASE}' "${akmods_kmodfile}" | sed 's!\.\(fc\|lvn\)[0-9]*!!g' )"
if [[ ! "${alwaystry}" ]] && [[ -e "/var/cache/akmods/${this_kmodname}/${this_kmodverrel}-for-${this_kernelver}".failed.log ]]; then
akmods_echo 1 2 -n "Ignoring ${this_kmodname}-kmod as it failed earlier"
akmods_echo 1 2 --warning
local someignored="true"
else
akmods_echo 1 2 -n "Building and installing ${this_kmodname}-kmod"
if buildinstall_kmod ${this_kernelver} ${this_kmodname} ${akmods_kmodfile} ${this_kmodverrel} ; then
akmods_echo 1 2 --success
else
local somefailed="true"
fi
fi
fi
done
if [[ "${continue_line}" ]]; then
akmods_echo 1 2 --success
elif [[ "${someignored}" ]] || [[ "${somefailed}" ]] ; then
echo
akmods_echo 1 2 "Hint: Some kmods were ignored or failed to build or install."
akmods_echo 1 2 "You can try to rebuild and install them by by calling"
akmods_echo 1 2 "'/usr/sbin/akmods --force' as root."
echo
sleep 2
fi
}
myprog_help ()
{
echo "Usage: ${myprog} [OPTIONS]"
echo $'\n'"Checks the akmod packages and rebuilds them if needed"
echo $'\n'"Available options:"
echo " --force -- try all, even if they failed earlier"
echo " --kernels <kernel> -- build and install only for kernel <kernel>"
echo " --akmod <akmod> -- build and install only akmod <akmod>"
}
# first parse command line options
while [ "${1}" ] ; do
case "${1}" in
--kernel|--kernels)
shift
if [[ ! "${1}" ]] ; then
echo "ERROR: Please provide the kernel-version to build for together with --kernel" >&2
exit 1
elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] || [[ ! -r /lib/modules/${1}/build/Makefile ]]; then
echo "Could not find files needed to compile modules for ${1}"
exit 1
elif [[ -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r /boot/vmlinuz-"${1}" ]]; then
# this is a red hat / fedora kernel-devel package, but the kernel for it is not installed
# kmodtool would adds a dep on that kernel when building; thus when we'd try to install the
# rpms we'd run into a missing-dep problem. Thus we prevent that case
echo "Kernel ${1} not installed"
exit 1
fi
# overwrites the default:
kernels="${kernels}${1}"
# an try to build, even if we tried already
alwaystry=true
shift
;;
--akmod|--kmod)
shift
if [[ ! "${1}" ]] ; then
echo "ERROR: Please provide a name of a akmod package together with --akmods" >&2
exit 1
elif [[ -r /usr/src/akmods/"${1}"-kmod.latest ]] ; then
akmods="${akmods}${1} "
elif [[ -r /usr/src/akmods/"${1}".latest ]] ; then
akmods="${akmods}${1%%-kmod} "
else
echo "Could not find akmod ${1}"
exit 1
fi
shift
;;
--force)
alwaystry=true
shift
;;
--from-posttrans|--from-init|--from-akmod)
# does nothing (yet!)
shift
;;
--verbose)
let verboselevel++
shift
;;
--quiet)
let verboselevel--
shift
;;
--help)
myprog_help
exit 0
;;
--version)
echo "${myprog} ${myver}"
exit 0
;;
*)
echo "Error: Unknown option '${1}'." >&2
myprog_help >&2
exit 2
;;
esac
done
# sanity checks
init
# go
for kernel in ${kernels} ; do
check_kmods ${kernel}
done
# finished :)
finally
--- NEW FILE akmods.spec ---
Name: akmods
Version: 0.3.3
Release: 2%{?dist}
Summary: Automatic kmods build and install tool
Group: System Environment/Kernel
License: MIT
URL: http://rpmfusion.org/Packaging/KernelModules/Akmods
Source0: akmods
#to be written: Source1: akmods.1
Source2: akmodsbuild
Source3: akmodsbuild.1
Source4: akmodsinit
Source6: akmodsposttrans
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# needed for actually building kmods:
#Requires: %{_bindir}/inotifywait
Requires: %{_bindir}/rpmdev-vercmp
Requires: kmodtool >= 1-9
# this should track in all stuff that is normally needed to compile modules:
Requires: bzip2 coreutils diffutils file findutils gawk gcc grep
Requires: gzip perl make sed tar unzip util-linux which rpm-build
# do we need akmods-{xen,PAE,foo,bar} packages that depend on the proper
# kernel-devel package? Well, maybe later; for now we just go with the
# easy variant; note that the requires is weak in any case, as a older
# kernel-devel package can provice it as well :-/
Requires: kernel-devel
# we create a special user that used by akmods to build kmod packages
Requires(pre): shadow-utils
# for the akmods init script:
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%description
Akmods startup script will rebuild akmod packages during system
boot while its background daemon will build them for kernels right
after they were installed.
%prep
echo nothing to prep
%build
echo nothing to build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p \
$RPM_BUILD_ROOT/%{_usrsrc}/akmods/ \
$RPM_BUILD_ROOT/%{_localstatedir}/cache/akmods/
install -D -p -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/%{_sbindir}/akmods
install -D -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/%{_bindir}/akmodsbuild
install -D -p -m 0644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_mandir}/man1/akmodsbuild.1
install -D -p -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/%{_initrddir}/akmods
# %%{_sysconfdir}/kernel/posttrans.d/ should be owned my mkinitrd #441111
install -D -p -m 0755 %{SOURCE6} $RPM_BUILD_ROOT/%{_sysconfdir}/kernel/postinst.d/akmods
%clean
rm -rf $RPM_BUILD_ROOT
%pre
# create group and user
getent group akmods >/dev/null || groupadd -r akmods
getent passwd akmods >/dev/null || \
useradd -r -g akmods -d /var/cache/akmods/ -s /sbin/nologin \
-c "User is used by akmods to build akmod packages" akmods
%post
# add init script
/sbin/chkconfig --add akmods
# enable init script; users that installed akmods directly or indirectly
# want it to work
if [ $1 = 1 ]; then
/sbin/chkconfig akmods on
fi
%preun
if [ $1 = 0 ]; then
/sbin/chkconfig --del akmods
fi
%files
%defattr(-,root,root,-)
%{_usrsrc}/akmods
%{_localstatedir}/cache/akmods/
%{_bindir}/akmodsbuild
%{_sbindir}/akmods
%{_initrddir}/akmods
%{_sysconfdir}/kernel/postinst.d/akmods
%{_mandir}/man1/*
%changelog
* Thu Oct 02 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.3.3-2
- rebuild for rpm fusion
* Sun Sep 21 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.3-1
- proper check for kernel-devel files in akmods as well
* Tue Sep 02 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.2-1
- Start akmods way earlier (level 05) during boot (#1995)
- proper check for kernel-devel files (#1942)
* Tue Sep 02 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.1-2
- Remove check section
* Sun May 18 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.1-1
- Remove check for inotify
* Sat Apr 12 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.0-1
- Fix thinko in akmodsposttrans
* Sat Apr 12 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.3.0-0.4
- split init script and poststrans stuff from akmodsds
- rename akmodsd to akmods
- rename akmodbuild to akmodsbuild
- remove the inotifywatch stuff
* Sun Mar 30 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.2.3-1
- update akmodbuid manpage
* Sat Mar 29 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.2.2-1
- adjust to recent "arch and flavor in uname" changes from j-rod
- add man page for akmodbuild
- cleanups to akmodbuild
* Thu Jan 31 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.2.1-2
- add a hard dep on kmodtool which is needed during akmod building
* Sat Jan 26 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.2.1-1
- rename akmods to akmodbuild
* Sun Jan 20 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.2.0-1
- require kernel-devel
- use rpmdev-vercmp to compare f a akmods is newer then the installed kmod
- build and install akmods on install
* Wed Jan 09 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.1.1-3
- remove akmodstool and integrate it into kmodtool
* Wed Jan 09 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.1.1-2
- own /usr/src/akmods
* Sun Jan 06 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.1.1-1
- add rpm-build as Require
- add a status function to akmodsd
* Sun Jan 06 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0.1.0-1
- Initial RPM release.
--- NEW FILE akmodsbuild ---
#!/bin/bash
#
# akmodbuild - Helper script for building kernel module SRPMs
# Copyright (c) 2007 Thorsten Leemhuis <fedora(a)leemhuis.info>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
myprog="akmodsbuild"
myver="0.3.2"
# defaults that might get overwritten by user:
kernels="$(uname -r)"
target="$(uname -m)"
numberofjobs=$(grep -c processor /proc/cpuinfo 2> /dev/null)
verboselevel=2
outputdir="${PWD}"
srpms=
init ()
{
## startup checks
# prevent root-usage
if [[ -w / ]]; then
echo "ERROR: Not to be used as root; start as user or '${myprog}' instead." >&2
exit 1
fi
# do we have everything we need to build for the kernels in question?
for kernel in ${kernels}; do
if [[ ! -e /usr/src/kernels/${kernel}/Makefile ]] && [[ ! -e /lib/modules/${kernel}/build/Makefile ]]; then
echo "ERROR: Files needed for building modules against kernel" >&2
echo " ${kernel} could not be found as the following" >&2
echo " directories are missing:"
echo " /usr/src/kernels/${kernel}/" >&2
echo " /lib/modules/${kernel}/build/" >&2
exit 2
fi
done
if [[ ! "${srpms}" ]]; then
echo "ERROR: Please provide a list of SRPM-files to build."
exit 2
fi
# SRPMS available?
for srpm in ${srpms}; do
if [[ ! -r ${srpm} ]]; then
echo "ERROR: Can't find SRPM ${srpm}"
exit 1
fi
done
# room to save things
if [[ ! -d "${outputdir}" ]]; then
echo "ERROR: ${outputdir} is not a directory" >&2
exit 1
elif [[ ! -w "${outputdir}" ]]; then
echo "ERROR: ${outputdir} is not a writable" >&2
exit 1
fi
# make sure this is a number
if ! (( ${numberofjobs} > 0 )); then
echo "Warning: using hardcoded defaut value for number of jobs"
numberofjobs=2
fi
## preparations
# tmpdir
if ! tmpdir="$(mktemp -d -t ${myprog}.XXXXXXXX)" ; then
echo "ERROR: Could create tempdir."
exit 1
fi
# buildtreee
mkdir "${tmpdir}"/{BUILD,SOURCES,SPECS,SRPMS,RPMS,RPMS/"${target}"}
# logfile
if [[ ! "${logfile}" ]] ; then
logfile="${tmpdir}/logfile"
fi
if ( [[ -e "${logfile}" ]] && [[ ! -w "${logfile}" ]] ) || ! touch "${logfile}" ; then
echo "ERROR: Could not write logfile."
finally
exit 1
fi
}
finally()
{
# kill background jobs if needed
if [[ "${watch_jobid}" ]]; then
kill "${watch_jobid}"
fi
if [[ "${rpmbuild_jobid}" ]]; then
kill "${rpmbuild_jobid}"
fi
# remove tmpfiles
if [[ -d "${tmpdir}" ]]; then
rm -rf "${tmpdir}"
fi
}
trap "finally" 2
akmods_echo()
{
# where to output
local this_fd=${1}
shift
# verboselevel
local this_verbose=${1}
shift
if [[ "${1}" == "--not-logfile" ]]; then
local notlogfile=true
shift
fi
# output to console
if (( ${verboselevel} >= ${this_verbose} )) ; then
echo "$@" >&${this_fd}
fi
# global logfile
if [[ ! ${notlogfile} ]]; then
echo "$@" >> "${logfile}"
fi
}
watch_rpmbuild()
{
# background function to show rpmbuild progress
# does't use akmods_echo here; this stage handles the output on its own
# (seperate process and there is no need to log this)
if (( ${verboselevel} == 2 )); then
tail --pid ${1} -n +1 -s 0.1 -f ${2} 2>/dev/null | grep --line-buffered -e '%prep' -e '%build' -e '%install' -e '%clean' | while read line; do
if [[ "${line}" != "${line##*prep}" ]]; then
echo -n "prep "
elif [[ "${line}" != "${line##*build}" ]]; then
echo -n "build "
elif [[ "${line}" != "${line##*install}" ]]; then
echo -n "install "
elif [[ "${line}" != "${line##*clean}" ]]; then
echo -n "clean; "
# last linefeed is done by the caller
fi
done
elif (( ${verboselevel} > 2 )); then
tail --pid ${1} -n +1 -s 0.1 -f ${2}
fi
}
process_srpm()
{
local source_rpm="${1}"
# status info
akmods_echo 1 2 -n "* Rebuilding ${source_rpm} for kernel(s) ${kernels}: "
# kick off rebuild into background
/usr/bin/time --format='%x' --output="${tmpdir}/.jobexit" rpmbuild \
--define "_topdir ${tmpdir}/" \
--define "_buildtree ${tmpdir}/BUILD" \
--define "_specdir ${tmpdir}/SPECS" \
--define "_sourcedir ${tmpdir}/SOURCES" \
--define "_srcrpmdir ${tmpdir}/SRPMS" \
--define "_rpmdir ${tmpdir}/RPMS" \
--define "_smp_mflags -j${numberofjobs}" \
--define "kernels ${kernels}" \
--target ${target} \
--rebuild "${source_rpm}" 2>&1 | tee -a "${logfile}" > "${tmpdir}/.joblog" &
local rpmbuild_jobid=$!
# show progress
if (( ${verboselevel} >= 2 )); then
watch_rpmbuild ${rpmbuild_jobid} "${tmpdir}/.joblog" 2> /dev/null &
local watch_jobid=$!
fi
# wait for rpmbuild
wait ${rpmbuild_jobid}
local rpmbuild_returncode=$(tail -n 1 "${tmpdir}/.jobexit")
unset rpmbuild_jobid
# give watch_rpmbuild a moment to catch up; kill it if it does not
if (( ${verboselevel} >= 2 )); then
sleep 0.5
kill ${watch_jobid} &> /dev/null
unset watch_jobid
fi
# did rpmbuild succeed?
if (( ${rpmbuild_returncode} != 0 )); then
# linefeed:
akmods_echo 1 2 ""
akmods_echo 2 2 --not-logfile "rpmbuild failed with errorcode ${rpmbuild_returncode}; last 35 Lines of log:"
akmods_echo 2 2 --not-logfile "--- "
tail -n 35 "${tmpdir}/.joblog" >&2
akmods_echo 2 2 --not-logfile "---"
return ${rpmbuild_returncode}
fi
# finish status for watch_rpmbuild
if (( ${verboselevel} >= 2 )); then
akmods_echo 1 2 -n "Successfull; "
fi
local rpms_built="$(cd "${tmpdir}"/RPMS/"${target}" ; echo *)"
if ! mv "${tmpdir}/RPMS/${target}/"* "${outputdir}" ; then
# linefeed:
akmods_echo 1 2 ""
akmods_echo 2 2 "Failed to move ${tmpdir}/RPMS/${target}/"* "to ${outputdir}"
return 128
fi
if (( ${verboselevel} == 1 )); then
for rpm in ${rpms_built}; do
echo "${outputdir%%/}/${rpm}"
done
elif (( ${verboselevel} >= 2 )); then
akmods_echo 1 2 "Saved ${rpms_built} in ${outputdir%%/}/"
fi
# finished
return 0
}
myprog_help ()
{
echo "Usage: ${myprog} [OPTIONS] <SRPMS>"
echo $'\n'"Rebuilds kmod SRPM(s)"
echo $'\n'"Available options (and their defaults): "
echo " -k, --kernels -- build for kernel-versions (output from 'uname -r')"
echo " -l, --logfile <file> -- save rpmduild output to <file>"
echo " -o, --outputdir <dir> -- save rpms and logs here (current directory)"
echo " -t, --target -- target-arch (output from 'uname -m')"
echo " -v, --verbose -- increase verboseness"
echo " -q, --quiet -- be more quiet"
echo
echo " -h, --help -- show usage"
echo " -V, --version -- show version"
}
while [ "${1}" ] ; do
case "${1}" in
-k|--kernels)
shift
if [[ ! "${1}" ]] ; then
echo "ERROR: Please provide kernel-version(s) to build for together with --kernel" >&2
exit 1
fi
kernels="${1}"
shift
;;
-l|--logfile)
shift
if [[ ! "${1}" ]]; then
echo "ERROR: Please provide a filename together with --logfile" >&2
exit 1
fi
logfile="${1}"
shift
;;
-o|--outputdir)
shift
if [[ ! "${1}" ]]; then
echo "ERROR: Please provide the output directory together with --outputdir" >&2
exit 1
fi
outputdir="${1}"
shift
;;
-t|--target)
shift
if [[ ! "${1}" ]] ; then
echo "ERROR: Please provide the target-arch together with --target" >&2
exit 1
fi
target="${1}"
shift
;;
-v|--verbose)
let verboselevel++
shift
;;
-q|--quiet)
let verboselevel--
shift
;;
-h|--help)
myprog_help
exit 0
;;
-V|--version)
echo "${myprog} ${myver}"
exit 0
;;
--*)
echo "Error: Unknown option '${1}'." >&2
myprog_help >&2
exit 2
;;
*)
srpms="${srpms} ${1}"
shift
;;
esac
done
# sanity checks
init
# go
for srpm in ${srpms}; do
process_srpm ${srpm}
returncode=$?
if (( ${returncode} != 0 )); then
finally
exit ${returncode}
fi
done
# finished
finally
exit 0
--- NEW FILE akmodsbuild.1 ---
." Text automatically generated by txt2man
.TH akmodsbuild "1" "" ""
.SH NAME
\fBakmodsbuild \fP- Rebuilds kmod SRPM(s)
.SH SYNOPSIS
.nf
.fam C
\fBakmodsbuild\fP [\fIoptions\fP] <\fISRPM(s)\fP>
.fam T
.fi
.SH DESCRIPTION
Rebuilds kmod-SRPMs for kernels
.SH OPTIONS
.TP
.B
\fB-k\fP, \fB--kernels\fP <list>
.PP
.nf
.fam C
Build the kmod for kernels in list; try to build for the current kernel
(e.g. output from 'uname -r') if option is not used.
.fam T
.fi
\fB-l\fP, \fB--logfile\fP <file>
.PP
.nf
.fam C
Write output from rpmbuild to <file>
.fam T
.fi
\fB-o\fP, \fB--outputdir\fP <directory>
.PP
.nf
.fam C
Save resulting RPMS in <direcotry>. Use current working directory if
directory is not specified.
.fam T
.fi
\fB-t\fP, \fB--target\fP
.PP
.nf
.fam C
Target architecture. Default: output from 'uname -m'.
.fam T
.fi
\fB-v\fP, \fB--verbose\fP
.PP
.nf
.fam C
Increase verboselevel; option can be given multiple times
.fam T
.fi
\fB-q\fP, \fB--quiet\fP
.PP
.nf
.fam C
Decrease verboselevel; option can be given multiple times
.fam T
.fi
\fB-h\fP, \fB--help\fP
.PP
.nf
.fam C
Show usage
.fam T
.fi
\fB-V\fP, \fB--version\fP
.PP
.nf
.fam C
Output program version
.SH EXAMPLE
To compile the kmod SRPMs ndiswrapper-kmod-1.52-1.lvn9.1.src.rpm and madwifi-kmod-0.9.4-2.lvn9.src.rpm found in /usr/src/akmods/ use:
.PP
.nf
.fam C
$ akmodsbuild /usr/src/akmods/ndiswrapper-kmod-1.52-1.lvn9.1.src.rpm /usr/src/akmods/madwifi-kmod-0.9.4-2.lvn9.src.rpm
.SH BUGS
None know, but there are likely some
.SH AUTHOR
Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info>
--- NEW FILE akmodsinit ---
#!/bin/bash -
#
# akmodinit Builds and install new kmods from akmod packages
#
# Author: Thorsten Leemhuis <fedora(a)leemhuis.info>
#
# chkconfig: 2345 5 95
#
# description: akmodsinit calls akmod during system boot to build and install
# kmods for the currently running kernel if neccessary.
#
# processname: akmodsd
# pidfile: /var/run/akmodsd.pid
#
### BEGIN INIT INFO
# Provides: akmodsd
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Builds and install new kmods from akmod packages
# Description: akmodsinit calls akmod during system boot to build and install
# kmods for the currently running kernel if neccessary.
### END INIT INFO
start_akmods ()
{
# build and install all kmods if neccessary
# for the currently running kernel (default in akmods)
/usr/sbin/akmods --from-init
}
# See how we were called.
case "$1" in
start|restart|reload|condrestart)
start_akmods
;;
stop|status)
exit 0
;;
*)
echo $"Usage: $0 start"
exit 1
;;
esac
--- NEW FILE akmodsposttrans ---
#!/bin/bash -
#
# akmodposttras - Calls akmods for newly installed kernels
#
# Copyright (c) 2009 Thorsten Leemhuis <fedora(a)leemhuis.info>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# todo-list:
# - scary idea: install kernel-devel packages on demand?
# - redirect output to a seperate logfile?
# just check in case a user calls this directly
if [[ ! -w / ]]; then
echo "Needs to run as root to be able to install rpms." >&2
exit 1
fi
# needs to run in background as rpmdb might be locked otherwise
nohup /usr/sbin/akmods --from-posttrans --kernels ${1} &> /dev/null &
16 years, 1 month
rpms/akmods/devel Makefile,1.1,1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/akmods/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv18494
Modified Files:
Makefile
Log Message:
inital import to rpmfusion
Index: Makefile
===================================================================
RCS file: /cvs/free/rpms/akmods/devel/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 30 Sep 2008 16:44:19 -0000 1.1
+++ Makefile 2 Oct 2008 17:27:59 -0000 1.2
@@ -1,18 +1,18 @@
-# Makefile for source rpm: akmods
+# Makefile for source rpm: ntfs-kmod
# $Id$
NAME := akmods
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ../../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/.svn/entries -a -w $$/Makefile.common ] ; then cd $$d ; svn -q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+test -f .svn/entries && { svn -q checkout $$(svn info |grep '^URL :'|cut -d' ' -f 3|cut -d/ -f -4)/common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' directory module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
16 years, 1 month
rpms/buildsys-build-rpmfusion/devel buildsys-build-rpmfusion.spec, 1.1, 1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/buildsys-build-rpmfusion/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv16644
Modified Files:
buildsys-build-rpmfusion.spec
Log Message:
enable ppc64
Index: buildsys-build-rpmfusion.spec
===================================================================
RCS file: /cvs/free/rpms/buildsys-build-rpmfusion/devel/buildsys-build-rpmfusion.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- buildsys-build-rpmfusion.spec 2 Oct 2008 17:05:32 -0000 1.1
+++ buildsys-build-rpmfusion.spec 2 Oct 2008 17:09:00 -0000 1.2
@@ -24,7 +24,7 @@
# rpmlint will complain this should be a noarch package; but for
# proper builddeps deps it needs to be a non-noarch package
-ExclusiveArch: i586 i686 x86_64 ppc
+ExclusiveArch: i586 i686 x86_64 ppc ppc64
# unneeded
%define debug_package %{nil}
16 years, 1 month
rpms/buildsys-build-rpmfusion/devel buildsys-build-rpmfusion-README, NONE, 1.1 buildsys-build-rpmfusion-filterfile_i586, NONE, 1.1 buildsys-build-rpmfusion-filterfile_i686, NONE, 1.1 buildsys-build-rpmfusion-filterfile_ppc, NONE, 1.1 buildsys-build-rpmfusion-filterfile_ppc64, NONE, 1.1 buildsys-build-rpmfusion-filterfile_x86_64, NONE, 1.1 buildsys-build-rpmfusion-kerneldevpkgs-current, NONE, 1.1 buildsys-build-rpmfusion-list-kernels.sh, NONE, 1.1 buildsys-build-rpmfusion.spec, NONE, 1.1 Makefile, 1.1, 1.2
by Thorsten Leemhuis
Author: thl
Update of /cvs/free/rpms/buildsys-build-rpmfusion/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv16114
Modified Files:
Makefile
Added Files:
buildsys-build-rpmfusion-README
buildsys-build-rpmfusion-filterfile_i586
buildsys-build-rpmfusion-filterfile_i686
buildsys-build-rpmfusion-filterfile_ppc
buildsys-build-rpmfusion-filterfile_ppc64
buildsys-build-rpmfusion-filterfile_x86_64
buildsys-build-rpmfusion-kerneldevpkgs-current
buildsys-build-rpmfusion-list-kernels.sh
buildsys-build-rpmfusion.spec
Log Message:
initial import
--- NEW FILE buildsys-build-rpmfusion-README ---
This is a metapackage without payload used by the buildsystem
--- NEW FILE buildsys-build-rpmfusion-filterfile_i586 ---
smp$
PAE$
--- NEW FILE buildsys-build-rpmfusion-filterfile_i686 ---
smp$
--- NEW FILE buildsys-build-rpmfusion-filterfile_ppc ---
PAE$
--- NEW FILE buildsys-build-rpmfusion-filterfile_ppc64 ---
PAE$
smp$
--- NEW FILE buildsys-build-rpmfusion-filterfile_x86_64 ---
smp$
PAE$
--- NEW FILE buildsys-build-rpmfusion-kerneldevpkgs-current ---
2.6.27-0.352.rc7.git1.fc10
2.6.27-0.352.rc7.git1.fc10-smp
2.6.27-0.352.rc7.git1.fc10-PAE
--- NEW FILE buildsys-build-rpmfusion-list-kernels.sh ---
#!/bin/bash
#
# buildsys-build-list-kernels.sh - Helper script for building kernel module RPMs for Fedora
#
# Copyright (c) 2007 Thorsten Leemhuis <fedora(a)leemhuis.info>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
shopt -s extglob
myver="0.0.7"
repo=rpmfusion
myprog="buildsys-build-${repo}-kerneldevpkgs"
supported_targetarchs="i586 i686 x86_64 ppc ppc64"
if [[ -e ./buildsys-build-${repo}-kerneldevpkgs-current ]]; then
prefix=./buildsys-build-${repo}-
else
prefix=/usr/share/buildsys-build-${repo}/
fi
requires=
filterfile=
target=$(uname -m)
show_kernels="current"
print_kernels ()
{
local this_target=${1}
local this_grepoptions=
local this_command=
local this_kernellistfiles=
# which files to use
if [[ "${show_kernels}" == "newest" ]]; then
this_kernellistfiles="${prefix}kerneldevpkgs-newest"
elif [[ "${show_kernels}" == "current" ]]; then
this_kernellistfiles="${prefix}kerneldevpkgs-current"
fi
# error out if not defined
if (( $(stat -c%s "${this_kernellistfiles}") <= 1 )); then
echo "(no kernels defined)"
return 1
fi
# if there are no newest kernels use current ones for newest
# can happen in rawhide
if [[ "${show_kernels}" == "newest" ]] && [[ -e "${prefix}kerneldevpkgs-newest" ]] && (( $(stat -c%s "${prefix}kerneldevpkgs-newest") <= 1 )) ; then
this_kernellistfiles="${prefix}kerneldevpkgs-current"
fi
# target
if [[ "${this_target}" ]] ; then
this_grepoptions="${this_grepoptions} --file ${prefix}filterfile_${this_target}"
fi
# custom filterfile
if [[ "${filterfile}" ]]; then
this_grepoptions="${this_grepoptions} --file ${filterfile}"
fi
# do we need grep at all?
if [[ "${this_grepoptions}" ]]; then
this_command="grep --invert-match --no-filename"
else
this_command="cat"
fi
# go
${this_command} ${this_grepoptions} ${this_kernellistfiles} | while read this_kernel; do
this_kernel_verrel=${this_kernel%%$kernels_known_variants}
this_kernel_variant=${this_kernel##$this_kernel_verrel}
if [[ "${requires}" ]] || [[ "${buildrequires}" ]]; then
if echo ${this_kernel} | grep -- 'default' &> /dev/null; then
if [[ "${requires}" ]]; then
echo "Requires: kernel${this_kernel_variant:+-${this_kernel_variant}}-devel-${this_target}"
fi
if [[ "${buildrequires}" ]]; then
echo "BuildRequires: kernel${this_kernel_variant:+-${this_kernel_variant}}-devel-${this_target}"
fi
else
if [[ "${requires}" ]]; then
echo "Requires: kernel-devel-uname-r = ${this_kernel}"
fi
if [[ "${buildrequires}" ]]; then
echo "BuildRequires: kernel-devel-uname-r = ${this_kernel}"
fi
fi
else
echo ${this_kernel_verrel}.${this_target}${this_kernel_variant:+.${this_kernel_variant}}
fi
done
}
print_requires ()
{
local this_kernel_verrel
local this_kernel_variant
for this_arch in ${supported_targetarchs}; do
echo $'\n'"%ifarch ${this_arch}"
print_kernels ${this_arch}
echo "%endif"
done
}
myprog_help ()
{
echo "Usage: $(basename ${0}) [OPTIONS]"
echo $'\n'"Prints a list of all avilable kernel-devel packages in the buildsys, as"$'\n'"defined by the buildsys-buildkmods-all package."
echo $'\n'"Available options:"
echo " --filterfile <file> -- filter the results with grep --file <file>"
echo " --current -- only list current up2date kernels"
# echo " --newest -- only list newly released kernels"
echo " --requires -- print list as requires with ifarch section for"$'\n'" further use in a RPM spec file package header"
echo " --prefix <dir> -- look for the data files in <prefix>"
echo " --target <arch> -- target-arch (ignored if --requires is used)"
echo $'\n'"Supported target archs: ${supported_targetarchs}"
}
while [ "${1}" ] ; do
case "${1}" in
--prefix)
shift
if [[ ! "${1}" ]] ; then
echo "Error: Please provide a prefix where to find data-files together with --prefix" >&2
exit 2
fi
prefix="${1}"
shift
;;
--filterfile)
shift
if [[ ! "${1}" ]] ; then
echo "Error: Please provide path to a filter-file together with --filterfile" >&2
exit 2
elif [[ ! -e "${1}" ]]; then
echo "Error: Filterfile ${1} not found" >&2
exit 2
fi
filterfile="${1}"
shift
;;
--target)
shift
if [[ ! "${1}" ]] ; then
echo "Error: Please provide one of the supported targets together with --target" >&2
exit 2
fi
for this_arch in ${supported_targetarchs}; do
if [[ "${this_arch}" = "${1}" ]]; then
target="${1}"
shift
break
fi
done
if [[ ! "${target}" ]]; then
echo "Error: ${1} is not a supported target" >&2
exit 2
fi
;;
--requires)
shift
requires="true"
;;
--buildrequires)
shift
buildrequires="true"
;;
--current)
shift
show_kernels="current"
;;
--newest)
shift
show_kernels="newest"
;;
--help)
myprog_help
exit 0
;;
--version)
echo "${myprog} ${myver}"
exit 0
;;
*)
echo "Error: Unknown option '${1}'."$'\n' >&2
myprog_help >&2
exit 2
;;
esac
done
# more init after parsing command line parameters
if [[ -e ./kmodtool-kernel-variants ]] ; then
kernels_known_variants="$(cat ./kmodtool-kernel-variants)"
elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then
kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)"
else
echo "Could not find /usr/share/kmodtool/kernel-variants (required)" >&2
exit 2
fi
# sanity checks
if [[ ! "${kernels_known_variants}" ]] ; then
echo "could not determine known kenrel variants"
exit 2
fi
# go
if [[ "${requires}" ]] || [[ "${buildrequires}" ]] ; then
print_requires
else
print_kernels ${target}
fi
--- NEW FILE buildsys-build-rpmfusion.spec ---
%define repo rpmfusion
Name: buildsys-build-%{repo}
Epoch: 10
Version: 10
Release: 0.1
Summary: Tools and files used by the %{repo} buildsys
Group: Development/Tools
License: MIT
URL: http://rpmfusion.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source2: %{name}-list-kernels.sh
Source5: %{name}-README
Source11: %{name}-kerneldevpkgs-current
Source20: %{name}-filterfile_i586
Source21: %{name}-filterfile_i686
Source22: %{name}-filterfile_x86_64
Source23: %{name}-filterfile_ppc
# provide this to avoid a error when generating akmods packages
Provides: buildsys-build-rpmfusion-kerneldevpkgs-akmod-%{_target_cpu}
# rpmlint will complain this should be a noarch package; but for
# proper builddeps deps it needs to be a non-noarch package
ExclusiveArch: i586 i686 x86_64 ppc
# unneeded
%define debug_package %{nil}
%description
This package contains tools and lists of recent kernels that get used when
building kmod-packages.
%package kerneldevpkgs-current
Summary: Meta-package to get all current kernel-devel packages into the buildroot
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Provides: %{name}-kerneldevpkgs-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-kerneldevpkgs-current-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-kerneldevpkgs-newest-%{_target_cpu} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{_bindir}/kmodtool
BuildRequires: %{_bindir}/kmodtool
# we use our own magic here to safe ourself to cut'n'paste the BR
%{expand:%(bash %{SOURCE2} --current --requires --buildrequires --prefix %{_sourcedir}/%{name}- 2>/dev/null)}
%description kerneldevpkgs-current
This is a meta-package used by the buildsystem to track the kernel-devel
packages for all current up-to-date kernels into the buildroot to build
kmods against them.
%files kerneldevpkgs-current
%defattr(-,root,root,-)
%doc .tmp/current/README
%prep
# for debugging purposes output the stuff we use during the rpm generation
bash %{SOURCE2} --current --requires --buildrequires --prefix %{_sourcedir}/%{name}- | grep -v '^Requires'
sleep 2
%build
echo nothing to build
%install
rm -rf $RPM_BUILD_ROOT .tmp/
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name} $RPM_BUILD_ROOT/%{_bindir} .tmp/newest .tmp/current
# install the stuff we need
install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/%{_bindir}/%{name}-kerneldevpkgs
install -p -m 0644 %{SOURCE5} .tmp/current/README
install -p -m 0644 %{SOURCE11} $RPM_BUILD_ROOT/%{_datadir}/%{name}/kerneldevpkgs-current
install -p -m 0644 %{SOURCE20} $RPM_BUILD_ROOT/%{_datadir}/%{name}/filterfile_i586
install -p -m 0644 %{SOURCE21} $RPM_BUILD_ROOT/%{_datadir}/%{name}/filterfile_i686
install -p -m 0644 %{SOURCE22} $RPM_BUILD_ROOT/%{_datadir}/%{name}/filterfile_x86_64
install -p -m 0644 %{SOURCE23} $RPM_BUILD_ROOT/%{_datadir}/%{name}/filterfile_ppc
# adjust default-path
sed -i 's|^default_prefix=.*|default_prefix=%{_datadir}/%{name}/|' \
$RPM_BUILD_ROOT/%{_bindir}/%{name}-kerneldevpkgs
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_datadir}/%{name}/
%changelog
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 10:10-0.1
- adjust things for rawhide
-- no xen kernels anymore, so no need for the whole newest and current handling
-- just require kernels unversioned if buildsys-build-rpmfusion-kerneldevpkgs
contains lines with "default"
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9:9.0-3
- adjust output for new kernel scheme
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9:9.0-2
- add epoch to provides/requires
* Sun May 04 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9:9.0-1
- Build for F9 kernel
* Mon Mar 31 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2-2
- Update to latest kernels 2.6.24.4-64.fc8 2.6.21.7-3.fc8xen
* Sat Jan 26 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9:1-2
- s/akmods/akmod/
* Wed Jan 09 2008 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9:1-3
- Build for rawhide
- disable kerneldevpkgs-newest and kerneldevpkgs-current packages, as we
don't maintain them for rawhide
- add epoch for new versioning scheme
* Thu Dec 20 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 22-1
- Update to latest kernels 2.6.21-2952.fc8xen 2.6.23.9-85.fc8
* Thu Dec 20 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 22-1
- Update to latest kernels 2.6.21-2952.fc8xen 2.6.23.9-85.fc8
* Mon Dec 03 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 21-1
- Update to latest kernels 2.6.23.8-63.fc8 2.6.21-2952.fc8xen
* Sat Nov 10 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 20-1
- Update to latest kernels 2.6.23.1-49.fc8 2.6.21-2950.fc8xen
* Tue Oct 29 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 19-1
- Update to latest kernels 2.6.23.1-41.fc8 2.6.21-2950.fc8xen
* Tue Oct 28 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 18-1
- Update to latest kernels 2.6.23.1-41.fc8 2.6.21-2950.fc8xen
* Sun Oct 28 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 17-3
- don't include file with know variants and instead properly fix the script
* Sun Oct 28 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 17-2
- include file with know variants as it is needed in buildsys
* Sun Oct 28 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 17-1
- split buildsys stuff out into a seperate package
- rename to buildsys-build-rpmfusion
- add proper obsoletes
- give subpackages and files more sane names and places
* Sat Oct 27 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 16-2
- Update to latest kernels 2.6.23.1-35.fc8 2.6.21-2950.fc8xen
* Sat Oct 27 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 16-1
- Update to latest kernels 2.6.23.1-35.fc8 2.6.21-2949.fc8xen
* Thu Oct 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 15-1
- rebuilt for latest kernels
* Thu Oct 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 14-1
- rebuilt for latest kernels
* Thu Oct 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 13-1
- rebuilt for latest kernels
* Thu Oct 18 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 12-1
- rebuilt for latest kernels
* Fri Oct 12 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 11-1
- rebuilt for latest kernels
* Thu Oct 11 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 10-1
- rebuilt for latest kernels
* Wed Oct 10 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9-2
- fix typo
* Wed Oct 10 2007 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 9-1
- rebuilt for latest kernels
* Sun Oct 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 8-1
- update for 2.6.23-0.224.rc9.git6.fc8
* Sun Oct 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 7-1
- update for 2.6.23-0.222.rc9.git1.fc8
* Wed Oct 03 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 6-1
- update for 2.6.23-0.217.rc9.git1.fc8 and 2.6.21-2947.fc8xen
* Wed Oct 03 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 5-1
- disable --all-but-latest stuff -- does not work as expected
- rename up2date list of kernels from "latest" to "current" as latest
and newest are to similar in wording; asjust script as well
- kmodtool: don't provide kernel-modules, not needed anymore with
the new stayle and hurts
* Sun Sep 09 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 4-2
- fix typos in spec file and list-kernels script
- interdependencies between the two buildsys-build packages needs to be
arch specific as well
* Sun Sep 09 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 4-1
- s/latests/latest/
- update kernel lists for rawhide and test2 kernels
- make kmod-helpers-livna-list-kernels print BuildRequires for all kernels
as well; this is not needed and will slow build a bit as it will track
all the kernel-devel packages in, but that way we make sure they are really
available in the buildsys
* Fri Sep 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3-4
- implement proper arch deps
* Fri Sep 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3-3
- proper list of todays rawhide-kernels
* Fri Sep 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3-2
- fix typo in kmod-helpers-livna-latests-kernels
* Fri Sep 07 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 3-1
- adjust for devel
* Sat Sep 01 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2-1
- initial package
Index: Makefile
===================================================================
RCS file: /cvs/free/rpms/buildsys-build-rpmfusion/devel/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 30 Sep 2008 16:44:34 -0000 1.1
+++ Makefile 2 Oct 2008 17:05:32 -0000 1.2
@@ -1,18 +1,18 @@
-# Makefile for source rpm: buildsys-build-rpmfusion
+# Makefile for source rpm: ntfs-kmod
# $Id$
NAME := buildsys-build-rpmfusion
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ../../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/.svn/entries -a -w $$/Makefile.common ] ; then cd $$d ; svn -q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+test -f .svn/entries && { svn -q checkout $$(svn info |grep '^URL :'|cut -d' ' -f 3|cut -d/ -f -4)/common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' directory module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
16 years, 1 month