Mailinglist Archive: opensuse-kernel (87 mails)

< Previous Next >
[opensuse-kernel] combine shell script and .spec file into one .spec file to do the whole job.
  • From: <doiggl@xxxxxxxxxxxxxxxxxx>
  • Date: Tue, 10 Aug 2010 00:43:26 +1000
  • Message-id: <8d5027fd0a8e6de3fc8fed59b950e8aa@xxxxxxxxxxxxxxxxxxxxxxx>
I need help to combine this shell script [1] and .spec file [2]into one
.spec file to do the whole job and run from obs.

Can someone help at joining the two together and list what the new .spec
file would look like.
The reason I ask is I can run the script locally and its builds the rpms
and I want obs to do the building instead.
Here is start when script was run[3]
Here is a copy of the make rpm-pkg .spec file[2]
Here is a sample log of a successful build with a script [4]
I posted on packaging and kernel as this is a but of a mix of both.
Thanks for your help
Cheers Glenn

[1] {shell script this works ok locally}
cd /usr/src
rm -rf linux-2.6.$version linux
cp -v /media/disk/kernel/2.6.$version/final/linux-2.6.$version.tar.bz2 .
rm linux-2.6.35.tar
bunzip2 -v linux-2.6.$version.tar.bz2
tar -xvf linux-2.6.$version.tar
ln -s linux-2.6.$version linux
cp -v /boot/config-$(uname -r) /usr/src/linux-2.6.$version/.config
cd /usr/src/linux
patch -p1 < /patch/reiser4-for-2.6.$version.patch
cp -v /source/new.config /usr/src/linux-2.6.35/.config
make rpm-pkg | tee reiser4enabledkernel.log

[2] {.spec file content part of make rpm-pkg} # cat kernel.spec
Name: kernel
Summary: The Linux Kernel
Version: 2.6.3512desktop
Release: 1
License: GPL
Group: System Environment/Kernel
Vendor: The Linux Community
Source: kernel-2.6.3512desktop.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
Provides: kernel-2.6.35-12-desktop
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%define debug_package %{nil}

The Linux Kernel, the operating system core itself

%setup -q

make clean && make %{?_smp_mflags}

%ifarch ia64
mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules
mkdir -p $RPM_BUILD_ROOT/lib/firmware
mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules
mkdir -p $RPM_BUILD_ROOT/lib/firmware
%ifarch ia64
cp $KBUILD_IMAGE $RPM_BUILD_ROOT/boot/efi/vmlinuz-2.6.35-12-desktop
ln -s efi/vmlinuz-2.6.35-12-desktop $RPM_BUILD_ROOT/boot/
%ifarch ppc64
cp vmlinux arch/powerpc/boot
cp arch/powerpc/boot/$KBUILD_IMAGE
cp $KBUILD_IMAGE $RPM_BUILD_ROOT/boot/vmlinuz-2.6.35-12-desktop
cp $RPM_BUILD_ROOT/boot/
cp .config $RPM_BUILD_ROOT/boot/config-2.6.35-12-desktop
%ifnarch ppc64
cp vmlinux vmlinux.orig
bzip2 -9 vmlinux
mv vmlinux.bz2 $RPM_BUILD_ROOT/boot/vmlinux-2.6.35-12-desktop.bz2
mv vmlinux.orig vmlinux


%defattr (-, root, root)
%dir /lib/modules

[3] {start when script was run}
/bin/sh /media/disk/src/linux-2.6.35/scripts/package/mkspec >
make clean
set -e; cd ..; ln -sf /media/disk/src/linux-2.6.35 kernel-2.6.3512desktop
/bin/sh /media/disk/src/linux-2.6.35/scripts/setlocalversion
set -e; cd ..; tar -cz --exclude SCCS --exclude BitKeeper --exclude .svn
--exclude CVS --exclude .pc --exclude .hg --exclude .git -f
kernel-2.6.3512desktop.tar.gz kernel-2.6.3512desktop/.
set -e; cd ..; rm kernel-2.6.3512desktop
rm -f /media/disk/src/linux-2.6.35/.scmversion
set -e; \
/bin/sh /media/disk/src/linux-2.6.35/scripts/mkversion >
set -e; \
mv -f /media/disk/src/linux-2.6.35/.tmp_version
rpmbuild --target x86_64 -ta ../kernel-2.6.3512desktop.tar.gz
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.pNRVVF
+ umask 022

[4] {content of local compilation}

To unsubscribe, e-mail: opensuse-kernel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kernel+help@xxxxxxxxxxxx

< Previous Next >