summaryrefslogtreecommitdiffstats
path: root/main/kmod/APKBUILD
blob: 5078fdae661709b715c5ad1135d03f5fa375c1c4 (plain)
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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kmod
pkgver=20
pkgrel=0
pkgdesc="Linux kernel module management utilities"
url="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary"
arch="all"
license="GPL2+"
depends=""
depends_dev=""
makedepends="$depends_dev zlib-dev xz-dev libxslt tar"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="http://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-$pkgver.tar.xz
	strndupa.patch"

_builddir="$srcdir"/kmod-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--bindir=/bin \
		--with-rootlibdir=/lib \
		--with-zlib \
		--with-xz \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	local i
	mkdir -p "$pkgdir"/sbin
	for i in lsmod rmmod insmod modinfo modprobe depmod; do
		ln -sf ../bin/kmod "$pkgdir"/sbin/$i || return 1
	done
	rm -f "$pkgdir"/usr/lib/*.la
}

libs() {
	pkgdesc="Libraries to handle kernel module loading and unloading"
	mkdir -p "$subpkgdir"/
	mv "$pkgdir"/lib "$subpkgdir"/
}

md5sums="d6f4fef718a50bd88080de6a43bc64d8  kmod-20.tar.xz
a347d68599a0ab4c2abd53c89271cf67  strndupa.patch"
sha256sums="89c1a1a2193c31f9ebe582640bfa2bd401341dc24119f5a7f702588116fadaa0  kmod-20.tar.xz
aea9bdad0e6d0c6c5d9c3f1fe1f84f85babcd52b3077336552ae73ccbc4b0a36  strndupa.patch"
sha512sums="1026d80486e6c823fc74a439d15a8b1e4a501140f67568165904b43a73130133d6c84075ec8a7981a5d4a187d5fbd21afd197de4e81cc05a66506711865edf96  kmod-20.tar.xz
f2ea3527bfba182c5e15557c224a5bba8c7e2ea3d21cf604e6eb2277226dcf983c3aeb9ac44a322c7f2b4942b35135da999d63a5b946b829d3f3b09c050a0f17  strndupa.patch"