core/dkms/PKGBUILD

60 lines
1.7 KiB
Bash
Raw Normal View History

pkgname=dkms
2018-04-13 02:12:02 +08:00
pkgver=2.5
2016-07-22 12:33:29 +08:00
pkgrel=1
2012-04-10 02:19:48 +08:00
pkgdesc='Dynamic Kernel Modules System'
2014-10-14 02:12:43 +08:00
arch=('any')
2018-04-13 02:12:02 +08:00
url='https://github.com/dell/dkms'
2012-04-10 02:19:48 +08:00
license=('GPL2')
2014-10-14 02:12:43 +08:00
depends=('bash' 'kmod' 'gcc' 'make' 'patch')
2016-07-22 12:33:29 +08:00
makedepends=('git')
2014-10-14 02:12:43 +08:00
optdepends=('linux-headers: build modules against Chakra kernel'
'linux-lts-headers: build modules against LTS Chakra kernel')
2018-04-13 02:12:02 +08:00
backup=('etc/dkms/framework.conf')
2014-10-14 02:12:43 +08:00
install=$pkgname.install
2018-04-13 02:12:02 +08:00
source=("git+https://github.com/dell/dkms.git#tag=v$pkgver"
'hook.install'
'hook.remove'
'hook.sh'
'0001-Revert-Make-newly-installed-modules-available-immedi.patch')
2016-07-22 12:33:29 +08:00
md5sums=('SKIP'
2018-04-13 02:12:02 +08:00
'90f1486e0af9aab85e8c60d456802c63'
'2e8ffd0c2ddec02872d0234befd129fd'
'f1ea074ef22d1afe855a1eb63233566b'
'd3b91ef709f567a375f4bbdbd3291d2b')
2014-10-14 02:12:43 +08:00
prepare() {
2016-07-22 12:33:29 +08:00
cd dkms
# apply patch from the source array (should be a pacman feature)
local filename
for filename in "${source[@]}"; do
if [[ "$filename" =~ \.patch$ ]]; then
2018-04-13 02:12:02 +08:00
msg2 "Applying patch ${filename##*/}"
patch -p1 -N -i "$srcdir/${filename##*/}"
2016-07-22 12:33:29 +08:00
fi
done
2016-07-22 12:33:29 +08:00
2014-10-14 02:12:43 +08:00
# /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
}
package() {
2018-04-13 02:12:02 +08:00
# alpm hook
install -D -m 644 hook.install "$pkgdir/usr/share/libalpm/hooks/70-dkms-install.hook"
install -D -m 644 hook.remove "$pkgdir/usr/share/libalpm/hooks/70-dkms-remove.hook"
install -D -m 755 hook.sh "$pkgdir/usr/lib/dkms/alpm-hook"
2014-10-14 02:12:43 +08:00
# upstream installer
2016-07-22 12:33:29 +08:00
cd dkms
2018-04-13 02:12:02 +08:00
# we don't need kconf files, so we install them outside $pkgdir
2014-10-14 02:12:43 +08:00
make \
DESTDIR="$pkgdir" \
BASHDIR="$pkgdir/usr/share/bash-completion/completions" \
2018-04-13 02:12:02 +08:00
KCONF="$srcdir"/kconf \
2014-10-14 02:12:43 +08:00
install
2012-04-10 02:19:48 +08:00
}
2018-04-13 02:12:02 +08:00
# vim:set ts=2 sw=2 et: