jobcore/kmod/PKGBUILD-arch

79 lines
2.4 KiB
Text
Raw Normal View History

2022-03-20 13:19:37 +01:00
# Maintainer: Dave Reisner <dreisner@archlinux.org>
pkgname=kmod
2024-08-14 16:30:55 +02:00
pkgver=33
2024-08-26 22:37:54 +02:00
pkgrel=3
2022-03-20 13:19:37 +01:00
pkgdesc="Linux kernel module management tools and library"
arch=('x86_64')
url='https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git'
2024-08-14 16:30:55 +02:00
license=('LGPL-2.1-or-later' 'GPL-2.0-or-later')
2022-03-20 13:19:37 +01:00
depends=('glibc' 'zlib' 'openssl' 'xz' 'zstd')
2024-08-22 19:02:11 +02:00
makedepends=('git' 'scdoc')
2022-03-20 13:19:37 +01:00
checkdepends=('linux-headers' 'libelf')
2023-09-30 09:31:53 +02:00
options=('strip')
2024-08-22 19:02:11 +02:00
provides=('libkmod.so')
2022-03-20 13:19:37 +01:00
validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi
2024-08-22 19:02:11 +02:00
source=("git+https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git#tag=v${pkgver}?signed"
2022-03-20 13:19:37 +01:00
'depmod-search.conf'
2022-06-30 23:23:59 +02:00
'depmod.hook'
'depmod.script')
2024-08-22 19:02:11 +02:00
sha256sums=('f5795fe50a747609d70f764244e645cd946074e70a7e51de0f82bd2e4d0612c8'
2022-04-05 21:49:25 +02:00
'1a92bfeae870f61ce814577e69d2a147a9c0caf6aed1131243e4179241fcc4a8'
'c11c2a0f66ea405493e8617689ca10818dc81dd1dddc19bdb220c8b2917119c1'
2024-08-26 22:37:54 +02:00
'18661aa40c25580f04d2ac3f32e54c2997c0994d1c829905537b413a9d291ac6')
2022-03-20 13:19:37 +01:00
2024-08-14 16:30:55 +02:00
prepare() {
2024-08-22 19:02:11 +02:00
cd "${pkgname}"
2024-08-14 16:30:55 +02:00
2024-08-22 19:02:11 +02:00
touch libkmod/docs/gtk-doc.make
autoreconf --force --install --symlink
2024-08-14 16:30:55 +02:00
}
2022-03-20 13:19:37 +01:00
build() {
2024-08-22 19:02:11 +02:00
cd "${pkgname}"
2022-03-20 13:19:37 +01:00
./configure \
2024-08-14 16:30:55 +02:00
--sysconfdir='/etc' \
2022-03-20 13:19:37 +01:00
--with-xz \
--with-zlib \
--with-zstd \
--with-openssl
make
}
check() {
# As of kmod v20, the test suite needs to build some kernel modules, and thus
# needs headers available in order to run. We depend on linux-headers, but
# this is really only to try and make sure that *some* useable tree of kernel
# headers exist. The first useable tree we find is good enough, as these
# modules will never be loaded by tests.
local kdirs=(/usr/lib/modules/*/build/Makefile)
2024-08-14 16:30:55 +02:00
if [[ ! -f "${kdirs[0]}" ]]; then
2022-03-20 13:19:37 +01:00
printf '==> Unable to find kernel headers to build modules for tests\n' >&2
return 1
fi
2024-08-14 16:30:55 +02:00
local kver kdir="${kdirs[0]%/Makefile}"
IFS=/ read _ _ _ kver _ <<<"${kdir}"
2022-03-20 13:19:37 +01:00
2024-08-22 19:02:11 +02:00
make -C "${pkgname}" check KDIR="${kdir}" KVER="${kver}"
2022-03-20 13:19:37 +01:00
}
package() {
2024-08-22 19:02:11 +02:00
make -C "${pkgname}" DESTDIR="${pkgdir}" install
2022-03-20 13:19:37 +01:00
# extra directories
2024-08-14 16:30:55 +02:00
install -dm0755 "${pkgdir}"/{etc,usr/lib}/{depmod,modprobe}.d
2022-03-20 13:19:37 +01:00
# install depmod.d file for search/ dir
2024-08-14 16:30:55 +02:00
install -Dm0644 "${srcdir}/depmod-search.conf" "${pkgdir}/usr/lib/depmod.d/search.conf"
2022-03-20 13:19:37 +01:00
# hook
2024-08-14 16:30:55 +02:00
install -Dm0644 "${srcdir}/depmod.hook" "${pkgdir}/usr/share/libalpm/hooks/60-depmod.hook"
install -Dm0755 "${srcdir}/depmod.script" "${pkgdir}/usr/share/libalpm/scripts/depmod"
2022-03-20 13:19:37 +01:00
}
# vim: ft=sh syn=sh et