summaryrefslogtreecommitdiff
path: root/testing/kmod/PKGBUILD
blob: 4752bd55e05897131560a1cee4dfecf5e695a344 (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
# $Id: PKGBUILD 153751 2012-03-19 12:36:26Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>

pkgname=kmod
pkgver=7
pkgrel=1
pkgdesc="Linux kernel module handling"
arch=('i686' 'x86_64')
url='http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary'
license=('GPL2')
depends=('glibc' 'zlib')
options=('!libtool')
provides=('module-init-tools=3.16')
conflicts=('module-init-tools')
replaces=('module-init-tools')
source=("ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz"
        "depmod-search.conf")
md5sums=('7bd916ae1c8a38e7697fdd8118bc98eb'
         '09d8af2ba37c5902d904275cb27f1b09')

build() {
  cd "$pkgname-$pkgver"

  ./configure \
    --sysconfdir=/etc \
    --with-zlib

  make
}

check() {
  make -C "$pkgname-$pkgver" check
}

package() {
  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install

  # extra directories
  install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d "$pkgdir/sbin"

  # add symlinks to kmod
  ln -s ../usr/bin/kmod "$pkgdir/sbin/modprobe"
  ln -s ../usr/bin/kmod "$pkgdir/sbin/depmod"

  for tool in {ins,ls,rm}mod modinfo; do
    ln -s kmod "$pkgdir/usr/bin/$tool"
  done

  # install depmod.d file for search/ dir
  install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
}

# vim: ft=sh syn=sh et