linux-glibc-devel/install_all.sh
OBS User autobuild 2f4f18b9bb Accepting request 27392 from Base:System
Copy from Base:System/linux-glibc-devel based on submit request 27392 from user coolo

OBS-URL: https://build.opensuse.org/request/show/27392
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/linux-glibc-devel?expand=0&rev=1
2009-12-29 23:35:57 +00:00

77 lines
1.6 KiB
Bash

#!/bin/bash
# bash -x $0 linux-1.2.3.tar.bz2
set -e
kernel=$1
if ! test -f "$1"
then
echo "Usage: ${0##*/} linux-1.2.3.tar.gz"
exit 1
fi
kernel_dir="`tar -tf $1 | sed '1 {s@^.*[[:blank:]]@@;s@linux-@@;s@/.*$@@;s@^\([0-9]\+\.[0-9]\+\.[0-9]\+\)\(.*\)@\1@;p;Q}'`"
header_dir="$PWD/linux-glibc-devel-$kernel_dir"
if test -d "$kernel_dir"
then
echo "$kernel_dir exists, remove it first."
exit 1
fi
if ! mkdir "$header_dir"
then
echo "$header_dir exists, remove it first."
exit 1
fi
tar -xf $1
pushd linux-${kernel_dir}
cp Makefile $header_dir
/usr/bin/make O="$header_dir" headers_install_all
# kvm.h and aout.h are only installed if SRCARCH is an architecture
# that has support for them. As the package is noarch we need to make
# sure we get the full support on x86
/usr/bin/make SRCARCH=x86 O="$header_dir" headers_install_all
popd
pushd "$header_dir"
for asm in \
alpha \
avr32 \
blackfin \
cris \
frv \
h8300 \
m32r \
m68k \
m68knommu \
mips \
mn10300 \
sh \
sh64 \
v850 \
xtensa \
; do
rm -rf usr/include/asm-$asm
done
rm Makefile
find -type f -name "..install.cmd" -print0 | xargs -0 --no-run-if-empty rm
find -type f -name ".install" -print0 | xargs -0 --no-run-if-empty rm
#-------------------------------------------------------------------
#Fri Sep 5 10:43:49 CEST 2008 - matz@suse.de
#- Remove the kernel version of drm headers, they conflict
# with the libdrm ones, and those are slightly newer.
#
rm -rf usr/include/drm/
for dir in *
do
case "$dir" in
usr) ;;
*)
if test -d "$dir"
then
rm -rf "$dir"
fi
;;
esac
done
popd
du -sh "$header_dir/usr"
tar -cjf "$header_dir.tar.bz2" "${header_dir##*/}"
rm -rf $header_dir