#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer		: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun/jobcore/$pkgname"
#-----------------------------------------| DESCRIPTION |---------------------------------------
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc

pkgname=linux-api-headers
pkgver=5.12.3
pkgrel=01
pkgdesc='Kernel headers sanitized for use in userspace'
arch=(any)
url='https://www.gnu.org/software/libc'
makedepends=(rsync)
source=(https://www.kernel.org/pub/linux/kernel/v${pkgver:0:1}.x/linux-${pkgver}.tar.{xz,sign})

build() {
  cd linux-$pkgver

  make mrproper
  make headers_check
}

package() {
  cd linux-$pkgver
  make INSTALL_HDR_PATH="$pkgdir/usr" headers_install

  # use headers from libdrm
  rm -r "$pkgdir/usr/include/drm"
}

#---- license gpg-key sha256sums ----

license=(GPL2)

validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886'   # Linus Torvalds
              '647F28654894E3BD457199BE38DBBDC86092693E')  # Greg Kroah-Hartman

sha512sums=('295a943bb0d2366715c844a6e2ca424d17f4caceab8c9e095250851857928902a5deb8aa51cff5c3c7e982d168f79f4df3a39bdd47ec22b51237c91732dc8af0' #  linux-5.12.3.tar.xz
	'2739dc235a48203113af4e6c9ab595c13cfad3b80e6dccd2f62c168eb667e4aacbeedaecc14e5195222043acef2344d8cf552ad9ac54756f677958ebeadbe30b') #  linux-5.12.3.tar.sign

sha256sums=(133714a87a8b0ed1959587a8a5aff9faf47dd0fc8feeac08cca408f7e392878d #  linux-5.12.3.tar.xz
	804c5bd021e8ed2814d7d6b2fd639780704a091479c59d347ffc4fe3c1685640) # linux-5.12.3.tar.sign
####### diffs between old and new Arch PKGBUILD
--- PKGBUILD-arch	2021-10-05 08:55:48.000000000 +0000
+++ PKGBUILD-arch.new	2022-02-10 12:12:01.792299607 +0000
@@ -1,10 +1,12 @@
-# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
+# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
+# Maintainer: Frederik Schwan <freswa at archlinux dot org>
+# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
 # Contributor: Allan McRae <allan@archlinux.org>
 
-# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
+# toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc
 
 pkgname=linux-api-headers
-pkgver=5.12.3
+pkgver=5.16.8
 pkgrel=1
 pkgdesc='Kernel headers sanitized for use in userspace'
 arch=(any)
@@ -12,7 +14,7 @@
 license=(GPL2)
 makedepends=(rsync)
 source=(https://www.kernel.org/pub/linux/kernel/v${pkgver:0:1}.x/linux-${pkgver}.tar.{xz,sign})
-sha256sums=('133714a87a8b0ed1959587a8a5aff9faf47dd0fc8feeac08cca408f7e392878d'
+sha256sums=('52aa5f05ee8addcc1ec0020f50e5f88ea1a308c2afac4a2305e1e4cf42580316'
             'SKIP')
 validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886'   # Linus Torvalds
               '647F28654894E3BD457199BE38DBBDC86092693E')  # Greg Kroah-Hartman
scan for systemd ipv6 service & socket
##### systemd crap in new PKGBUILD ###
