summaryrefslogtreecommitdiff
path: root/testing/kmod/PKGBUILD
blob: 01f07eaaf6916cc22fd8d75d1275980e50ab8271 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# $Id: PKGBUILD 148640 2012-02-04 21:40:08Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>

pkgname=kmod
pkgver=4
pkgrel=3
pkgdesc="Linux kernel module handling"
arch=('i686' 'x86_64')
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-partially-fix-parsing-of-alias-with-dots.patch"
        "0002-libkmod-module-used-shared-code-in-module-creation.patch"
        "0003-modprobe-handle-all-error-returns-from-init_module.patch"
        "0004-modprobe-remove-0-refcnt-deps.patch"
        "0005-continue-after-module-insert-fail.patch"
        "0006-modprobe-remove-support-for-path-based-loading.patch"
        "0007-modinfo-handle-arguments-more-carefully.patch"
        "0008-Use-realpath-to-canonicalize-provided-paths.patch"
        "depmod-search.conf")
md5sums=('e14450a066a48accd0af1995b3c0232d'
         'f5fad0e48a76abe1b1f4c7289c546f32'
         '1b68167a077354419e5aa763f03f3c66'
         '8836228a7ebb60b147cfba7ead75b484'
         '92376505d9493d263fd288a403385192'
         '90eef7d134a4ec4b5fa055c9a4d03dc8'
         '204c1ddb3a9f95f6ce9b72cb5ac9358d'
         'd6edcea814f18e5233b2fdfe14ae33a3'
         '825f550884d8dc13b760898ea5d14aed'
         '4b8cbcbc54b9029c99fd730e257d4436')

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

  patch -Np1 <"$srcdir/0001-partially-fix-parsing-of-alias-with-dots.patch"
  patch -Np1 <"$srcdir/0002-libkmod-module-used-shared-code-in-module-creation.patch"
  patch -Np1 <"$srcdir/0003-modprobe-handle-all-error-returns-from-init_module.patch"
  patch -Np1 <"$srcdir/0004-modprobe-remove-0-refcnt-deps.patch"
  patch -Np1 <"$srcdir/0005-continue-after-module-insert-fail.patch"
  patch -Np1 <"$srcdir/0006-modprobe-remove-support-for-path-based-loading.patch"
  patch -Np1 <"$srcdir/0007-modinfo-handle-arguments-more-carefully.patch"
  patch -Np1 <"$srcdir/0008-Use-realpath-to-canonicalize-provided-paths.patch"

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

  make
}

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

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

  # binary directories
  install -dm755 "$pkgdir"/{,s}bin

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

  # add symlinks to kmod
  ln -s /usr/bin/kmod "$pkgdir/bin/lsmod"
  for tool in {ins,rm,dep}mod mod{info,probe}; do
    ln -s ../usr/bin/kmod "$pkgdir/sbin/$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