summaryrefslogtreecommitdiff
path: root/core/kmod/PKGBUILD
blob: b9e69d59f027ce835bdc263961a1126c939a2c3e (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
# $Id: PKGBUILD 150335 2012-02-16 23:20:12Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>

pkgname=kmod
pkgver=5
pkgrel=4
pkgdesc="Linux kernel module handling"
arch=('i686' 'x86_64' 'mips64el')
url="http://git.profusion.mobi/cgit.cgi/kmod.git"
license=('GPL2')
depends=('glibc' 'zlib')
options=('!libtool')
provides=('module-init-tools=3.16')
conflicts=('module-init-tools')
replaces=('module-init-tools')
source=("http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz"
        '0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch'
        '0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch'
        "depmod-search.conf")
md5sums=('b271c2ec54aba1c67bda63c8579d8c15'
         '81545a1509b43008f85c03fb980f0e86'
         '662a85dbe420f04c1ef24f9cd4e4c990'
         '4b8cbcbc54b9029c99fd730e257d4436')

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

  # fix modprobe --show-depends failures on loaded modules
  patch -Np1 <"$srcdir/0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch"

  # fix infinite loop with softdeps
  patch -Np1 <"$srcdir/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch"

  ./configure \
    --sysconfdir=/etc \
    --with-rootprefix= \
    --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