summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eca3ff6c602f54e3d5119dd4e599b014cc7091cc (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
# Maintainer: Lukas W. <lukaswhl at gmail dot com>

pkgbase=yoga-usage-mode
pkgname=(yoga-usage-mode-dkms-git)
pkgver=r8.3ada633
pkgrel=1
pkgdesc="Kernel module for Yoga C940 tablet mode detection"
arch=('x86_64')
url="https://github.com/lukas-w/yoga-usage-mode"
license=('MIT')
makedepends=('git')
source=('git+https://github.com/lukas-w/yoga-usage-mode.git')
md5sums=('SKIP')

pkgver() {
    cd "$srcdir/${pkgbase}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package_yoga-usage-mode-dkms-git() {
    depends=(dkms)
    provides=("yoga-usage-mode=$pkgver-$pkgrel")
    conflicts=(yoga-usage-mode)

    cd "$srcdir/${pkgbase}"
    install -Dt "$pkgdir/usr/src/$pkgbase-$pkgver" -m644 Makefile yoga-usage-mode.c "$srcdir/../dkms.conf"
    echo yoga-usage-mode | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgbase.conf"
}