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}
22 md5sums=('85202f0740a75eb52f2163c776f9b564'
24 '109042785e725717fe6a6d545c51a090'
25 'dd62cbf62bd8f212f51ef8c43bec9a77'
26 'e179ace75721e92b04b2e145b69dab29'
27 'b00253ca0d4ebfb2414e4596597bdebd')
28 sha256sums=('f897dd72698dc6ac1ef03255cd0a5734ad932318e4adbaebc7338ef2f5202f9f'
30 '99a02347c809307675a9a643ec34704ec5289b754d53dd4d319b32849b299c60'
31 '1a92bfeae870f61ce814577e69d2a147a9c0caf6aed1131243e4179241fcc4a8'
32 'c11c2a0f66ea405493e8617689ca10818dc81dd1dddc19bdb220c8b2917119c1'
33 'd2cd04a09feba30e1376144a8110ec7521892acb0940c3c4ba459aeecf0452ed')
38 patch -Np1 < ../0001-master.patch
55 # As of kmod v20, the test suite needs to build some kernel modules, and thus
56 # needs headers available in order to run. We depend on linux-headers, but
57 # this is really only to try and make sure that *some* useable tree of kernel
58 # headers exist. The first useable tree we find is good enough, as these
59 # modules will never be loaded by tests.
61 local kdirs=(/usr/lib/modules/*/build/Makefile)
62 if [[ ! -f ${kdirs[0]} ]]; then
63 printf '==> Unable to find kernel headers to build modules for tests\n' >&2
67 local kver kdir=${kdirs[0]%/Makefile}
68 IFS=/ read _ _ _ kver _ <<<"$kdir"
70 make -C "$pkgname-$pkgver" check KDIR="$kdir" KVER="$kver"
74 make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
77 install -dm755 "$pkgdir"/{etc,usr/lib}/{depmod,modprobe}.d
79 for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
80 ln -s kmod "$pkgdir/usr/bin/$tool"
83 # install depmod.d file for search/ dir
84 install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf"
87 install -Dm644 "$srcdir/depmod.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod.hook"
88 install -Dm755 "$srcdir/depmod.script" "$pkgdir/usr/share/libalpm/scripts/depmod"
91 # vim: ft=sh syn=sh et