OSDN Git Service

upg
[joborun/jobcore.git] / kmod / PKGBUILD-arch
1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
2
3 pkgname=kmod
4 pkgver=29
5 pkgrel=2
6 pkgdesc="Linux kernel module management tools and library"
7 arch=('x86_64')
8 url='https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git'
9 license=('GPL2')
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}
18         'depmod-search.conf'
19         'depmod.hook' 'depmod.script')
20 md5sums=('e81e63acd80697d001c8d85c1acb38a0'
21          'SKIP'
22          'dd62cbf62bd8f212f51ef8c43bec9a77'
23          'e179ace75721e92b04b2e145b69dab29'
24          '18fb3d1f6024a5a84514c8276cb3ebff')
25
26 build() {
27   cd "$pkgname-$pkgver"
28
29   ./configure \
30     --sysconfdir=/etc \
31     --with-xz \
32     --with-zlib \
33     --with-zstd \
34     --with-openssl
35
36   make
37 }
38
39 check() {
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.
45
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
49     return 1
50   fi
51
52   local kver kdir=${kdirs[0]%/Makefile}
53   IFS=/ read _ _ _ kver _ <<<"$kdir"
54
55   make -C "$pkgname-$pkgver" check KDIR="$kdir" KVER="$kver"
56 }
57
58 package() {
59   make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
60
61   # extra directories
62   install -dm755 "$pkgdir"/{etc,usr/lib}/{depmod,modprobe}.d
63
64   for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
65     ln -s kmod "$pkgdir/usr/bin/$tool"
66   done
67
68   # install depmod.d file for search/ dir
69   install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf"
70
71   # hook
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"
74 }
75
76 # vim: ft=sh syn=sh et