From df0241f1b924a5a2efda69969b4cba1a5a1ce1bb Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 2 Nov 2019 10:29:18 +0100 Subject: PKGBUILD: Aligning with vanilla kernel package script. Removing hooks, install and preset file (mkinitcpio is now taking care of this itself on the basis of a pkgbase file). Adding python-sphinx to makedepends for html docs. Switching to a pkgver scheme, in which the patch number gets concatenated to the kernel version without any prefix. --- PKGBUILD | 107 +++++++++++++++++++++++++-------------------------------------- 1 file changed, 42 insertions(+), 65 deletions(-) (limited to 'PKGBUILD') diff --git a/PKGBUILD b/PKGBUILD index bb0e279..1838683 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,29 +6,26 @@ # Contributor: Tobias Powalowski # Contributor: Thomas Baechler -#pkgbase=linux # Build stock -ARCH kernel -pkgbase=linux-rt-lts # Build kernel with a different name _pkgver=4.19.72 -_rtpatchver=rt26 -pkgver=${_pkgver}_${_rtpatchver} +_rtpatchver=26 +pkgbase=linux-rt-lts +pkgver=${_pkgver}.${_rtpatchver} pkgrel=1 arch=('x86_64') url="https://wiki.linuxfoundation.org/realtime/start" license=('GPL2') -makedepends=('bc' 'git' 'inetutils' 'kmod' 'libelf' 'xmlto') +makedepends=('bc' 'git' 'graphviz' 'imagemagick' 'inetutils' 'kmod' 'libelf' +'python-sphinx' 'python-sphinx_rtd_theme' 'xmlto') options=('!strip') _srcname=linux-${_pkgver} source=( "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.sign" - "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-${_rtpatchver}.patch.xz" - "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-${_rtpatchver}.patch.sign" + "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-rt${_rtpatchver}.patch.xz" + "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-rt${_rtpatchver}.patch.sign" + config # the main kernel config file 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch - config # the main kernel config file - 60-${pkgbase}.hook # pacman hook for depmod - 90-${pkgbase}.hook # pacman hook for initramfs regeneration - ${pkgbase}.preset # standard config files for mkinitcpio ramdisk ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds @@ -42,27 +39,25 @@ sha256sums=('f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d' 'SKIP' '7e360014f510daf6ab886f272531f98d9ae5cb5a55973a9b636346ac45f841f6' 'SKIP' - '75aa8dd708ca5a0137fbf7cddc9cafefe6aac6b8e0638c06c156d412d05af4bc' - '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d' 'e5a6ac3346c359353b3a7491bb77637870328a4bf3f3d57bf434a29b72632600' - 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' - '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' - 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') + '75aa8dd708ca5a0137fbf7cddc9cafefe6aac6b8e0638c06c156d412d05af4bc' + '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d') -_kernelname=${pkgbase#linux} -: ${_kernelname:=-ARCH} +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH:-$(date +%s)}" prepare() { cd $_srcname # apply realtime patch - msg "applying patch-${_pkgver}-${_rtpatchver}.patch" - patch -Np1 -i ../patch-${_pkgver}-${_rtpatchver}.patch + msg "applying patch-${_pkgver}-rt${_rtpatchver}.patch" + patch -Np1 -i "../patch-${_pkgver}-rt${_rtpatchver}.patch" msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "$_kernelname" > localversion.20-pkgname + echo "${pkgbase#linux}" > localversion.20-pkgname local src for src in "${source[@]}"; do @@ -78,68 +73,39 @@ prepare() { make olddefconfig # make menuconfig # CLI menu for configuration - make -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$( "$startdir/$install.pkg" - true && install=$install.pkg - - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../${pkgbase}.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-${pkgbase}.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" - sed "$subst" ../90-${pkgbase}.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" - msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" } @@ -147,12 +113,12 @@ _package() { _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" - local builddir="$pkgdir/usr/lib/modules/$(