summaryrefslogtreecommitdiff
path: root/system/kmod/APKBUILD
blob: e384286df4c0b10d692a0273f9d9a8d6d4264a3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=kmod
pkgver=29
pkgrel=1
pkgdesc="Linux kernel module management utilities"
url="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary"
arch="all"
options="!check"  # https://bugs.gentoo.org/408915#c3
license="GPL-2.0+"
depends=""
makedepends="openssl-dev zlib-dev xz-dev zstd-dev"
triggers="$pkgname.trigger=/lib/modules/*"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc
	$pkgname-bash-completion:bashcomp:noarch"
source="https://kernel.org/pub/linux/utils/kernel/kmod/kmod-$pkgver.tar.xz
	strndupa.patch
	kmod-static-nodes.initd
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--bindir=/bin \
		--sysconfdir=/etc \
		--with-rootlibdir=/lib \
		--with-zlib \
		--with-xz \
		--with-zstd \
		--with-openssl
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/sbin
	for i in lsmod rmmod insmod modinfo modprobe depmod; do
		ln -sf ../bin/kmod "$pkgdir"/sbin/$i
	done
	for i in lsmod modinfo; do
		ln -s kmod "$pkgdir"/bin/$i
	done
	install -Dm755 "$srcdir"/kmod-static-nodes.initd \
		"$pkgdir"/etc/init.d/kmod-static-nodes
}

bashcomp() {
	pkgdesc="Bash completion for $pkgname"
	depends=""
	install_if="bash-completion $pkgname=$pkgver-r$pkgrel"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share/
}


sha512sums="557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998  kmod-29.tar.xz
f2ea3527bfba182c5e15557c224a5bba8c7e2ea3d21cf604e6eb2277226dcf983c3aeb9ac44a322c7f2b4942b35135da999d63a5b946b829d3f3b09c050a0f17  strndupa.patch
7f0f89fe98167f71b7924f341ba701d001158225463c2f5e39f706a0224b1e952ee901b441f28cb15787563e83bb6e54eb752bf8669ae7c0ffbb11984542f354  kmod-static-nodes.initd"