# Maintainer: PktSurf <smlinux@pktsurf.in>
app=kernel-source
version=5.4.41
build=1sml
requires="musl"
homepage="https://www.kernel.org"
desc="source code for the Linux kernel"
aarchversion=5.4.51

prepbuilddir() {
  mkandenterbuilddir
  rm -rf linux-$version

  tar xf $srcdir/linux-$version.tar.?z*
  fixbuilddirpermissions
}

build() {
  if [ "$HOSTTYPE" = "x86_64" ] ; then
    zcat $srcdir/kernelconfig-huge-$version.gz > linux-$version/.config
    install -Dm 644 $srcdir/README $pkg/doc/$app-$version/README
  elif [ "$HOSTTYPE" = "aarch64" ] ; then
    zcat $srcdir/kernelconfig-$aarchversion.gz > linux-$version/.config
  fi

  mkdir -p $pkg/share
  cp -a linux-$version $pkg/share/

  mkfinalpkg
}

sha512sums="
711db80661f2e94fd4819991bd69ff7c3124832ffd6c17025bb82daf2177b82d6700454f7cc58f76c9f839fddf1316f49406af3c2572723b3455b2aac689f7a4  linux-5.4.41.tar.xz
"
