mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-09 16:47:15 +08:00
60 lines
1.7 KiB
Bash
60 lines
1.7 KiB
Bash
pkgname=dkms
|
|
pkgver=2.5
|
|
pkgrel=2
|
|
pkgdesc='Dynamic Kernel Modules System'
|
|
arch=('any')
|
|
url='https://github.com/dell/dkms'
|
|
license=('GPL2')
|
|
depends=('bash' 'kmod' 'gcc' 'make' 'patch')
|
|
makedepends=('git')
|
|
optdepends=('linux-headers: build modules against Chakra kernel'
|
|
'linux-lts-headers: build modules against LTS Chakra kernel')
|
|
backup=('etc/dkms/framework.conf')
|
|
install=$pkgname.install
|
|
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')
|
|
md5sums=('SKIP'
|
|
'90f1486e0af9aab85e8c60d456802c63'
|
|
'2e8ffd0c2ddec02872d0234befd129fd'
|
|
'f1ea074ef22d1afe855a1eb63233566b'
|
|
'd3b91ef709f567a375f4bbdbd3291d2b')
|
|
|
|
prepare() {
|
|
cd dkms
|
|
|
|
# apply patch from the source array (should be a pacman feature)
|
|
local filename
|
|
for filename in "${source[@]}"; do
|
|
if [[ "$filename" =~ \.patch$ ]]; then
|
|
msg2 "Applying patch ${filename##*/}"
|
|
patch -p1 -N -i "$srcdir/${filename##*/}"
|
|
fi
|
|
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
|
|
}
|
|
|
|
package() {
|
|
# 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"
|
|
# upstream installer
|
|
cd dkms
|
|
# we don't need kconf files, so we install them outside $pkgdir
|
|
make \
|
|
DESTDIR="$pkgdir" \
|
|
BASHDIR="$pkgdir/usr/share/bash-completion/completions" \
|
|
KCONF="$srcdir"/kconf \
|
|
install
|
|
}
|
|
|
|
# vim:set ts=2 sw=2 et:
|