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
|
|
|
#
|
2023-02-20 18:15:49 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
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.
|
|
|
|
|
2019-01-07 09:34:24 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2009-12-30 00:35:57 +01:00
|
|
|
#
|
|
|
|
|
2012-03-16 12:40:16 +01:00
|
|
|
|
2009-12-30 00:35:57 +01:00
|
|
|
Name: linux-glibc-devel
|
2023-06-26 10:18:32 +02:00
|
|
|
Version: 6.4
|
2018-08-13 10:13:04 +02:00
|
|
|
Release: 0
|
2009-12-30 00:35:57 +01:00
|
|
|
Summary: Linux headers for userspace development
|
2018-04-02 00:31:47 +02:00
|
|
|
License: GPL-2.0-only
|
2009-12-30 00:35:57 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2018-08-13 10:13:04 +02:00
|
|
|
URL: http://www.kernel.org/
|
|
|
|
Source: %{name}-%{version}.tar.xz
|
|
|
|
Source1: install_all.sh
|
2012-12-21 10:34:49 +01:00
|
|
|
BuildRequires: xz
|
2017-07-17 14:39:31 +02:00
|
|
|
# rpm-build requires gettext-tools; ignore this, in order to shorten cycles (we have no translations)
|
|
|
|
#!BuildIgnore: gettext-tools
|
|
|
|
# glibc-devel requires linux-kernel-headers, which we are in progress of building
|
|
|
|
#!BuildIgnore: linux-kernel-headers
|
2009-12-30 00:35:57 +01:00
|
|
|
PreReq: coreutils
|
2018-08-13 10:13:04 +02:00
|
|
|
Provides: kernel-headers
|
|
|
|
Provides: linux-kernel-headers = %{version}
|
|
|
|
Obsoletes: linux-kernel-headers < %{version}
|
2021-05-20 12:24:44 +02:00
|
|
|
|
|
|
|
%{lua:
|
|
|
|
function cross_archs()
|
|
|
|
return "aarch64", "arm", "hppa", "i386", "m68k", "mips", "ppc64", "ppc64le", "riscv64", "s390x", "sparc", "sparc64", "x86_64"
|
|
|
|
end
|
|
|
|
|
|
|
|
function kernel_arch(arch)
|
|
|
|
local map = {
|
|
|
|
["aarch64"] = "arm64",
|
|
|
|
["armv6hl"] = "arm",
|
|
|
|
["armv7hl"] = "arm",
|
|
|
|
["hppa"] = "parisc",
|
|
|
|
["i386"] = "x86",
|
|
|
|
["i586"] = "x86",
|
|
|
|
["i686"] = "x86",
|
|
|
|
["ppc"] = "powerpc",
|
|
|
|
["ppc64"] = "powerpc",
|
|
|
|
["ppc64le"] = "powerpc",
|
|
|
|
["riscv64"] = "riscv",
|
|
|
|
["s390x"] = "s390",
|
|
|
|
["sparc64"] = "sparc",
|
|
|
|
["x86_64"] = "x86",
|
|
|
|
}
|
|
|
|
return map[arch] or arch
|
|
|
|
end
|
|
|
|
|
|
|
|
function gcc_target(arch)
|
|
|
|
local map = {
|
|
|
|
["arm"] = "arm-suse-linux-gnueabi",
|
|
|
|
["i386"] = "i586-suse-linux",
|
|
|
|
["ppc64"] = "powerpc64-suse-linux",
|
|
|
|
["ppc64le"] = "powerpc64le-suse-linux",
|
|
|
|
}
|
|
|
|
return map[arch] or arch.."-suse-linux"
|
|
|
|
end
|
|
|
|
}
|
2009-12-30 00:35:57 +01:00
|
|
|
|
|
|
|
%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
|
|
|
|
2021-05-20 12:24:44 +02:00
|
|
|
%{lua:
|
|
|
|
for i,arch in ipairs({cross_archs()}) do
|
|
|
|
print(rpm.expand([[
|
|
|
|
|
|
|
|
%package -n cross-]]..arch..[[-linux-glibc-devel
|
|
|
|
Summary: Linux headers for ]]..arch..[[ userspace cross development
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description -n cross-]]..arch..[[-linux-glibc-devel
|
|
|
|
This package provides Linux kernel headers for ]]..arch..[[, the kernel API description
|
|
|
|
required for compilation of almost all programs.
|
|
|
|
]]))
|
|
|
|
end}
|
|
|
|
|
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
|
2021-05-20 12:24:44 +02:00
|
|
|
for karch in *; do
|
|
|
|
cd $karch
|
|
|
|
cat > version.h <<\BOGUS
|
2009-12-30 00:35:57 +01:00
|
|
|
#ifdef __KERNEL__
|
|
|
|
#error "======================================================="
|
2018-10-22 11:28:04 +02:00
|
|
|
#error "You should not include %{_includedir}/{linux,asm}/ header"
|
2009-12-30 00:35:57 +01:00
|
|
|
#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 "
|
2018-07-16 10:04:29 +02:00
|
|
|
#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
|
2021-05-20 12:24:44 +02:00
|
|
|
# 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
|
2021-05-20 12:24:44 +02:00
|
|
|
cd ..
|
|
|
|
done
|
2009-12-30 00:35:57 +01:00
|
|
|
|
|
|
|
%install
|
2021-05-20 12:24:44 +02:00
|
|
|
cd %{lua:print(kernel_arch(rpm.expand("%_target_cpu")))}
|
2018-08-13 10:13:04 +02:00
|
|
|
cp -a usr %{buildroot}/
|
|
|
|
cp -a version.h %{buildroot}%{_includedir}/linux/
|
2021-05-20 12:24:44 +02:00
|
|
|
cd ..
|
|
|
|
%{lua:
|
|
|
|
for i,arch in ipairs({cross_archs()}) do
|
|
|
|
print(rpm.expand([[
|
|
|
|
sysroot=%{_prefix}/]]..gcc_target(arch)..[[/sys-root
|
|
|
|
mkdir -p %{buildroot}${sysroot}/%{_includedir}/linux/
|
|
|
|
cd ]]..kernel_arch(arch)..[[
|
|
|
|
|
|
|
|
cp -a usr %{buildroot}${sysroot}
|
|
|
|
cp -a version.h %{buildroot}${sysroot}/%{_includedir}/linux/
|
|
|
|
cd ..
|
|
|
|
]]))
|
|
|
|
end}
|
2009-12-30 00:35:57 +01:00
|
|
|
|
2019-09-18 12:58:04 +02:00
|
|
|
%pre
|
|
|
|
if test -L %{_includedir}/asm; then
|
|
|
|
rm -f %{_includedir}/asm
|
2009-12-30 00:35:57 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
2018-08-13 10:13:04 +02:00
|
|
|
%{_includedir}/*
|
2009-12-30 00:35:57 +01:00
|
|
|
|
2021-05-20 12:24:44 +02:00
|
|
|
%{lua:
|
|
|
|
for i,arch in ipairs({cross_archs()}) do
|
|
|
|
print(rpm.expand([[
|
|
|
|
|
|
|
|
%files -n cross-]]..arch..[[-linux-glibc-devel
|
|
|
|
%{_prefix}/]]..gcc_target(arch).."\n"))
|
|
|
|
end}
|
|
|
|
|
2009-12-30 00:35:57 +01:00
|
|
|
%changelog
|