rpms/sysprof-kmod/devel kmodtool, NONE, 1.1 sysprof-avoid_depmod.patch, NONE, 1.1 sysprof-kmod.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Gianluca Sforna (giallu)
fedora-extras-commits at redhat.com
Wed Oct 4 16:27:26 UTC 2006
Author: giallu
Update of /cvs/extras/rpms/sysprof-kmod/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18439/devel
Modified Files:
.cvsignore sources
Added Files:
kmodtool sysprof-avoid_depmod.patch sysprof-kmod.spec
Log Message:
auto-import sysprof-kmod-1.0.3-1.2.6.18_1.2689.fc6 on branch devel from sysprof-kmod-1.0.3-1.2.6.18_1.2689.fc6.src.rpm
--- NEW FILE kmodtool ---
#!/bin/bash
# kmodtool - Helper script for building kernel module RPMs
# Copyright (c) 2003-2006 Ville Skyttä <ville.skytta at iki.fi>,
# Thorsten Leemhuis <fedora at 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
myprog="kmodtool"
myver="0.10.11"
knownvariants=@(BOOT|PAE|@(big|huge)mem|debug|enterprise|kdump|?(large)smp|uml|xen?([0U])?(-PAE))
kmod_name=
kver=
verrel=
variant=
get_verrel ()
{
verrel=${1:-$(uname -r)}
verrel=${verrel%%$knownvariants}
}
print_verrel ()
{
get_verrel $@
echo "${verrel}"
}
get_variant ()
{
get_verrel $@
variant=${1:-$(uname -r)}
variant=${variant##$verrel}
variant=${variant:-'""'}
}
print_variant ()
{
get_variant $@
echo "${variant}"
}
get_rpmtemplate ()
{
local variant="${1}"
local dashvariant="${variant:+-${variant}}"
case "$verrel" in
*.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
*) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;;
esac
cat <<EOF
%package -n kmod-${kmod_name}${dashvariant}
Summary: ${kmod_name} kernel module(s)
Group: System Environment/Kernel
Provides: kernel-modules = ${verrel}${variant}
Provides: ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: ${kdep}
Requires: ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
%description -n kmod-${kmod_name}${dashvariant}
This package provides the ${kmod_name} kernel modules built for the Linux
kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
%post -n kmod-${kmod_name}${dashvariant}
/sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
%postun -n kmod-${kmod_name}${dashvariant}
/sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
%files -n kmod-${kmod_name}${dashvariant}
%defattr(644,root,root,755)
/lib/modules/${verrel}${variant}/extra/${kmod_name}/
EOF
}
print_rpmtemplate ()
{
kmod_name="${1}"
shift
kver="${1}"
get_verrel "${1}"
shift
if [ -z "${kmod_name}" ] ; then
echo "Please provide the kmodule-name as first parameter." >&2
exit 2
elif [ -z "${kver}" ] ; then
echo "Please provide the kver as second parameter." >&2
exit 2
elif [ -z "${verrel}" ] ; then
echo "Couldn't find out the verrel." >&2
exit 2
fi
for variant in "$@" ; do
get_rpmtemplate "${variant}"
done
}
usage ()
{
cat <<EOF
You called: ${invocation}
Usage: ${myprog} <command> <option>+
Commands:
verrel <uname>
- Get "base" version-release.
variant <uname>
- Get variant from uname.
rpmtemplate <mainpgkname> <uname> <variants>
- Return a template for
version
- Output version number and exit.
EOF
}
invocation="$(basename ${0}) $@"
while [ "${1}" ] ; do
case "${1}" in
verrel)
shift
print_verrel $@
exit $?
;;
variant)
shift
print_variant $@
exit $?
;;
rpmtemplate)
shift
print_rpmtemplate "$@"
exit $?
;;
version)
echo "${myprog} ${myver}"
exit 0
;;
*)
echo "Error: Unknown option '${1}'." >&2
usage >&2
exit 2
;;
esac
done
# Local variables:
# mode: sh
# sh-indentation: 2
# indent-tabs-mode: nil
# End:
# ex: ts=2 sw=2 et
sysprof-avoid_depmod.patch:
--- NEW FILE sysprof-avoid_depmod.patch ---
Index: sysprof-1.0.2/module/Makefile
===================================================================
--- sysprof-1.0.2.orig/module/Makefile
+++ sysprof-1.0.2/module/Makefile
@@ -43,7 +43,6 @@ distdir:
install:
$(KMAKE) modules_install
- [ -e /sbin/depmod ] && /sbin/depmod
install-data:
install-exec:
--- NEW FILE sysprof-kmod.spec ---
# stuff to be implemented externally:
Source10: kmodtool
%define kmodtool bash %{SOURCE10}
# end stuff to be ...
# hardcode for now:
%{!?kversion: %define kversion 2.6.18-1.2689.fc6}
# hint: this can he overridden with "--define kversion foo" on the rpmbuild command line, e.g.
# --define "kversion 2.6.16-1.2096_FC5"
%define kmod_name sysprof
%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null)
%ifarch i686
%define pae PAE
%endif
%ifarch ppc
%define smp smp
%endif
%ifarch i686 x86_64 ia64
%define xen xen
%endif
%ifarch i686 x86_64 ppc64 ppc64iseries
%define kdump kdump
%endif
%{!?kvariants: %define kvariants "" %{?pae} %{?smp} %{?xen} %{?kdump}}
# hint: this can he overridden with "--define kvariant foo bar" on the rpmbuild command line, e.g.
# --define 'kvariant "" smp'
Name: %{kmod_name}-kmod
Version: 1.0.3
Release: 1.%(echo %{kverrel} | tr - _)
Summary: Sysprof kernel module
Group: System Environment/Kernel
License: GPL
URL: http://www.daimi.au.dk/~sandmann/sysprof/
Source0: http://www.daimi.au.dk/~sandmann/sysprof/sysprof-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: %{kmod_name}-avoid_depmod.patch
ExclusiveArch: i586 i686 x86_64 ppc
%description
Sysprof is a sampling CPU profiler for Linux that uses a
kernel module to profile the entire system, not just a
single application. Sysprof handles shared libraries and
applications do not need to be recompiled. In fact they
don't even have to be restarted.
# magic hidden here:
%{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)}
%prep
# to understand the magic better or to debug it, uncomment this:
#{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null
#sleep 5
%setup -q -c -T -a 0
pushd %{kmod_name}-%{version}*
%patch0 -p1 -b .patch0
# configure script breaks in mock builds (missing BRs), so we create here
# a config.h with the needed symbol
echo '#define PACKAGE_VERSION "%{version}"' > config.h
popd
for kvariant in %{kvariants} ; do
cp -a %{kmod_name}-%{version} _kmod_build_$kvariant
done
%build
for kvariant in %{kvariants}
do
ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
cd _kmod_build_$kvariant/module
make KDIR="${ksrc}"
cd ../..
done
%install
rm -rf $RPM_BUILD_ROOT
for kvariant in %{kvariants}
do
cd _kmod_build_$kvariant/module
ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
export INSTALL_MOD_DIR=extra/%{kmod_name}
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
make KDIR=${ksrc} install
cd ../..
done
# Temporarily executable for stripping, fixed later in %%files.
chmod u+x $RPM_BUILD_ROOT/lib/modules/*/extra/%{kmod_name}/*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Jun 22 2006 Gianluca Sforna <giallu gmail com> 1.0.3-1
- version update
- fixed rpmlint warning about summary
* Sat May 13 2006 Gianluca Sforna <giallu gmail com> 1.0.2-2
- removed some unnecessary diffs from the template spec
* Sat May 13 2006 Gianluca Sforna <giallu gmail com> 1.0.2-1
- Initial Version
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/sysprof-kmod/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 4 Oct 2006 16:26:38 -0000 1.1
+++ .cvsignore 4 Oct 2006 16:27:26 -0000 1.2
@@ -0,0 +1 @@
+sysprof-1.0.3.tar.gz
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/sysprof-kmod/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 4 Oct 2006 16:26:38 -0000 1.1
+++ sources 4 Oct 2006 16:27:26 -0000 1.2
@@ -0,0 +1 @@
+8949fe32a073b84cb2abb7f9d608f755 sysprof-1.0.3.tar.gz
More information about the fedora-extras-commits
mailing list