2009-12-30 00:35:57 +01:00
|
|
|
#
|
2011-06-30 16:29:06 +02:00
|
|
|
# spec file for package linux-glibc-devel
|
2009-12-30 00:35:57 +01:00
|
|
|
#
|
2016-01-18 09:31:43 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2009-12-30 00:35:57 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-03-16 12:40:16 +01:00
|
|
|
|
2009-12-30 00:35:57 +01:00
|
|
|
Name: linux-glibc-devel
|
|
|
|
Summary: Linux headers for userspace development
|
2011-12-21 13:21:52 +01:00
|
|
|
License: GPL-2.0
|
2009-12-30 00:35:57 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
BuildArch: noarch
|
2016-10-06 17:06:45 +02:00
|
|
|
Version: 4.8
|
2012-01-05 15:16:25 +01:00
|
|
|
Release: 0
|
2009-12-30 00:35:57 +01:00
|
|
|
Url: http://www.kernel.org/
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-12-21 10:34:49 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: xz
|
2012-03-19 13:30:50 +01:00
|
|
|
Provides: kernel-headers
|
2010-01-12 15:49:37 +01:00
|
|
|
Provides: linux-kernel-headers = %{version}
|
2011-06-29 10:03:59 +02:00
|
|
|
Obsoletes: linux-kernel-headers < %{version}
|
2009-12-30 00:35:57 +01:00
|
|
|
PreReq: coreutils
|
2016-03-17 17:08:13 +01:00
|
|
|
Source: %{name}-%{version}.tar.xz
|
2009-12-30 00:35:57 +01:00
|
|
|
Source1: install_all.sh
|
|
|
|
|
|
|
|
%description
|
|
|
|
This package provides Linux kernel headers, the kernel API description
|
|
|
|
required for compilation of almost all programs. This is the userspace
|
2010-11-15 01:59:17 +01:00
|
|
|
interface; compiling external kernel modules requires
|
|
|
|
kernel-(flavor)-devel, or kernel-syms to pull in all kernel-*-devel,
|
|
|
|
packages, instead.
|
2009-12-30 00:35:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2016-03-17 17:08:13 +01:00
|
|
|
%setup -q -n linux-glibc-devel-%{version}
|
2009-12-30 00:35:57 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
cat > version.h <<-BOGUS
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
#error "======================================================="
|
|
|
|
#error "You should not include /usr/include/{linux,asm}/ header"
|
|
|
|
#error "files directly for the compilation of kernel modules."
|
|
|
|
#error ""
|
|
|
|
#error "glibc now uses kernel header files from a well-defined"
|
|
|
|
#error "working kernel version (as recommended by Linus Torvalds)"
|
|
|
|
#error "These files are glibc internal and may not match the"
|
|
|
|
#error "currently running kernel. They should only be"
|
|
|
|
#error "included via other system header files - user space"
|
|
|
|
#error "programs should not directly include <linux/*.h> or"
|
|
|
|
#error "<asm/*.h> as well."
|
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "Since Linux 2.6, the kernel module build process has been"
|
|
|
|
#error "updated such that users building modules should not typically"
|
|
|
|
#error "need to specify additional include directories at all."
|
2009-12-30 00:35:57 +01:00
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "To build kernel modules, ensure you have the build environment "
|
|
|
|
#error "available either via the kernel-devel and kernel-<flavor>-devel "
|
|
|
|
#error "packages or a properly configured kernel source tree."
|
2009-12-30 00:35:57 +01:00
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "Then, modules can be built using:"
|
|
|
|
#error "make -C <path> M=$PWD"
|
2009-12-30 00:35:57 +01:00
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "For the currently running kernel there will be a symbolic "
|
|
|
|
#error "link pointing to the build environment located at "
|
|
|
|
#error "/lib/modules/$(uname -r)/build for use as <path>."
|
2009-12-30 00:35:57 +01:00
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "If you are seeing this message, your environment is "
|
|
|
|
#error "not configured properly. "
|
2009-12-30 00:35:57 +01:00
|
|
|
#error ""
|
2012-03-16 12:40:16 +01:00
|
|
|
#error "Please adjust the Makefile accordingly."
|
2012-05-16 13:07:44 +02:00
|
|
|
#error "======================================================="
|
2009-12-30 00:35:57 +01:00
|
|
|
#else
|
2011-09-07 10:10:41 +02:00
|
|
|
BOGUS
|
|
|
|
# Get LINUX_VERSION_CODE and KERNEL_VERSION directly from kernel
|
|
|
|
cat usr/include/linux/version.h >> version.h
|
|
|
|
cat >> version.h <<-BOGUS
|
2009-12-30 00:35:57 +01:00
|
|
|
#endif
|
|
|
|
BOGUS
|
|
|
|
cat version.h
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
mkdir $RPM_BUILD_ROOT
|
|
|
|
cp -a usr $RPM_BUILD_ROOT
|
|
|
|
cp -a version.h $RPM_BUILD_ROOT/usr/include/linux/
|
|
|
|
# resolve file conflict with glibc for now
|
2015-01-28 16:19:36 +01:00
|
|
|
rm -fv $RPM_BUILD_ROOT//usr/include/scsi/scsi.h
|
2009-12-30 00:35:57 +01:00
|
|
|
# Replace the directory /usr/include/asm with a symlink.
|
|
|
|
# libc contained a symlink /usr/include/asm into kernel-source up to 7.0 (2.1.3)
|
|
|
|
# glibc-devel contained a symlink /usr/include/asm into kernel-source in 7.1 (2.2)
|
|
|
|
# glibc-devel contained a directory /usr/include/asm from 7.2 (2.2.2) up to 10.1/SLES10 (2.4)
|
|
|
|
# The directory moved from glibc-devel to linux-kernel-headers in 10.2 (2.6.18.2)
|
|
|
|
# The directory turned into a symlink in 10.3 (2.6.22)
|
|
|
|
# rpm will remove obsolete files after the post install scripts
|
|
|
|
# A trigger will run after the /usr/include/asm was removed
|
2011-06-29 10:03:59 +02:00
|
|
|
# Create a dummy symlink now for rpmlint happiness, we %%ghost this and create
|
|
|
|
# a proper symlink during %%post:
|
2009-12-30 00:35:57 +01:00
|
|
|
ln -sfn asm-dummy $RPM_BUILD_ROOT/usr/include/asm
|
2011-06-29 10:03:59 +02:00
|
|
|
%fdupes $RPM_BUILD_ROOT/usr/include
|
2009-12-30 00:35:57 +01:00
|
|
|
|
|
|
|
%postun
|
|
|
|
if test "$1" = 0
|
|
|
|
then
|
|
|
|
rm -f usr/include/asm
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%post
|
|
|
|
asm_link=
|
|
|
|
case "$(uname -m)" in
|
|
|
|
alpha*) asm_link=alpha ;;
|
|
|
|
ppc*) asm_link=powerpc ;;
|
|
|
|
s390*) asm_link=s390 ;;
|
|
|
|
ia64) asm_link=ia64 ;;
|
|
|
|
*arm*) asm_link=arm ;;
|
|
|
|
parisc) asm_link=parisc ;;
|
|
|
|
*mips*) asm_link=mips ;;
|
|
|
|
sparc*) asm_link=sparc ;;
|
2013-02-10 18:35:52 +01:00
|
|
|
aarch64) asm_link=arm64 ;;
|
2013-10-09 17:02:51 +02:00
|
|
|
m68k) asm_link=m68k ;;
|
2009-12-30 00:35:57 +01:00
|
|
|
*) asm_link=x86 ;;
|
|
|
|
esac
|
|
|
|
if test -L usr/include/asm
|
|
|
|
then
|
|
|
|
case "$(readlink usr/include/asm)" in
|
|
|
|
*../src/linux/include*)
|
|
|
|
echo "/usr/include/asm points to kernel-source, waiting for triggerpostun to symlink to asm-$asm_link"
|
|
|
|
rm -fv usr/include/asm
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
: symlink is ok, update it below in case of an arch change
|
|
|
|
elif test -d usr/include/asm
|
|
|
|
then
|
|
|
|
echo "/usr/include/asm is a directory, waiting for triggerpostun to symlink to asm-$asm_link"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
ln -sfn asm-$asm_link usr/include/asm
|
|
|
|
exit 0
|
|
|
|
|
2010-05-14 01:05:43 +02:00
|
|
|
%triggerpostun -- linux-kernel-headers, glibc-devel < 2.5, libc < 2.2
|
2009-12-30 00:35:57 +01:00
|
|
|
asm_link=
|
|
|
|
case "$(uname -m)" in
|
|
|
|
alpha*) asm_link=alpha ;;
|
|
|
|
ppc*) asm_link=powerpc ;;
|
|
|
|
s390*) asm_link=s390 ;;
|
|
|
|
ia64) asm_link=ia64 ;;
|
|
|
|
*arm*) asm_link=arm ;;
|
|
|
|
parisc) asm_link=parisc ;;
|
|
|
|
*mips*) asm_link=mips ;;
|
|
|
|
sparc*) asm_link=sparc ;;
|
2013-02-10 18:35:52 +01:00
|
|
|
aarch64) asm_link=arm64 ;;
|
2013-10-09 17:02:51 +02:00
|
|
|
m68k) asm_link=m68k ;;
|
2009-12-30 00:35:57 +01:00
|
|
|
*) asm_link=x86 ;;
|
|
|
|
esac
|
|
|
|
ln -sfn asm-$asm_link usr/include/asm
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/include/*
|
|
|
|
%ghost %{_prefix}/include/asm
|
|
|
|
|
|
|
|
%changelog
|