1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
6 pkgdesc="Linux kernel module management tools and library"
8 url='https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git'
10 depends=('glibc' 'zlib' 'openssl' 'xz' 'zstd')
11 checkdepends=('linux-headers' 'libelf')
12 options=('strip' 'debug')
13 provides=('module-init-tools=3.16' 'libkmod.so')
14 conflicts=('module-init-tools')
15 replaces=('module-init-tools')
16 validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi
17 source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign}
19 'depmod.hook' 'depmod.script')
20 md5sums=('e81e63acd80697d001c8d85c1acb38a0'
22 'dd62cbf62bd8f212f51ef8c43bec9a77'
23 'e179ace75721e92b04b2e145b69dab29'
24 '18fb3d1f6024a5a84514c8276cb3ebff')
40 # As of kmod v20, the test suite needs to build some kernel modules, and thus
41 # needs headers available in order to run. We depend on linux-headers, but
42 # this is really only to try and make sure that *some* useable tree of kernel
43 # headers exist. The first useable tree we find is good enough, as these
44 # modules will never be loaded by tests.
46 local kdirs=(/usr/lib/modules/*/build/Makefile)
47 if [[ ! -f ${kdirs[0]} ]]; then
48 printf '==> Unable to find kernel headers to build modules for tests\n' >&2
52 local kver kdir=${kdirs[0]%/Makefile}
53 IFS=/ read _ _ _ kver _ <<<"$kdir"
55 make -C "$pkgname-$pkgver" check KDIR="$kdir" KVER="$kver"
59 make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
62 install -dm755 "$pkgdir"/{etc,usr/lib}/{depmod,modprobe}.d
64 for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
65 ln -s kmod "$pkgdir/usr/bin/$tool"
68 # install depmod.d file for search/ dir
69 install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf"
72 install -Dm644 "$srcdir/depmod.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod.hook"
73 install -Dm755 "$srcdir/depmod.script" "$pkgdir/usr/share/libalpm/scripts/depmod"
76 # vim: ft=sh syn=sh et