summaryrefslogtreecommitdiff
path: root/libre/dkms-libre/PKGBUILD
blob: 99caab5fa6528c0de656d4b27362f1ec21981df7 (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
# $Id: PKGBUILD 90494 2013-05-12 22:57:28Z seblu $
# Maintainer: Sébastien Luttringer
# Contributor: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>

_pkgname=dkms
pkgname=dkms-libre
pkgver=2.2.0.3
pkgrel=14
pkgdesc='Dynamic Kernel Modules System, with linux-libre-headers and linux-libre-lts-headers recommendation'
arch=('any')
url='http://linux.dell.com/dkms/'
license=('GPL2')
depends=('bash' 'kmod' 'gcc' 'make' 'patch')
optdepends=('linux-libre-headers: build modules against linux-libre kernel'
            'linux-libre-lts-headers: build modules against linux-libre-lts kernel')
replaces=$_pkgname
conflicts=$_pkgname
provides=$_pkgname=$pkgver
backup=('etc/dkms/framework.conf' 'etc/default/dkms')
install=$_pkgname.install
source=("http://linux.dell.com/$_pkgname/permalink/$_pkgname-$pkgver.tar.gz"
        "$_pkgname.default"
        "$_pkgname.service"
        "$_pkgname.systemd"
        '01-broken-uninstall.patch'
        '02-no-kernel-hook.patch')
md5sums=('11a8aaade2ebec2803653837c7593030'
         '33be2fbf1bcc1b3fb2f38d9e7eaa809d'
         '02e9744e3fdc3d2f68e46966fb32e260'
         '267632312aa52a190ec0db0758920dd3'
         '2dfd8656dc79afd229c1481a90fb645b'
         '82d520c39c99c34977e48b313a189c6c')

prepare() {
  # patch
  patches=("$srcdir"/*.patch)
  cd $_pkgname-$pkgver
  for p in "${patches[@]}"; do
    msg2 "Apply patch: ${p##*/}"
    patch -p1 -i "$p"
  done
  # /usr move
  msg2 '/usr move patching'
  for i in dkms{,_framework.conf,.bash-completion,.8,_common.postinst}; do
    sed -ri 's,/lib/modules,/usr/lib/modules,g' "$i"
  done
  # fix hardcoded paths
  sed -i "s|/sbin/depmod|depmod|" dkms
}

package() {
  # systemd
  install -D -m 644 $_pkgname.service "$pkgdir/usr/lib/systemd/system/$_pkgname.service"
  install -D -m 755 $_pkgname.systemd "$pkgdir/usr/lib/systemd/scripts/$_pkgname"
  install -D -m 644 $_pkgname.default "$pkgdir/etc/default/$_pkgname"
  # upstream installer
  cd $_pkgname-$pkgver
  make \
    DESTDIR="$pkgdir" \
    SBIN="$pkgdir/usr/bin" \
    BASHDIR="$pkgdir/usr/share/bash-completion/completions" \
    install
}

# vim:set ts=2 sw=2 et: