summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b94234e2fa576e107eaa4d5ca62599c61e05c906 (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
# Maintainer : Cole Deck <cole at deck dot sh>

pkgname=asus-rog-nb-wmi-dkms-git
_pkgname=asus-rog-nb-wmi
pkgver=0.2.0.r0.gfa91078
pkgrel=1
pkgdesc="Kernel module to patch asus-nb-wmi to support more ROG laptops"
arch=('x86_64')
url="https://gitlab.com/asus-linux/asus-rog-nb-wmi"
license=()
provides=()
conflicts=()
depends=('dkms' 'linux-headers')
makedepends=()
source=("git+https://gitlab.com/asus-linux/asus-rog-nb-wmi.git"
	"dkms.conf")
sha256sums=("SKIP"
	    "b952938712ccb756b7e263cb401d9a81d6e97e5ba14a329c4b541982e8f342ad")

pkgver() {
    cd "$srcdir/${_pkgname}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  _pkgver=$(git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
  sed -e "s/REPLACE_ME/$_pkgver/" -i "../dkms.conf"
}

package() {
  cd "${srcdir}/${_pkgname}"
  install -d -m 755 ${pkgdir}/usr/src/${_pkgname}-${pkgver}/src
  install -m 644 Makefile ${pkgdir}/usr/src/${_pkgname}-${pkgver}/Makefile
  install -m 644 src/asus-rog-nb-wmi.c ${pkgdir}/usr/src/${_pkgname}-${pkgver}/src/asus-rog-nb-wmi.c
  install -m 644 src/asus-wmi.h ${pkgdir}/usr/src/${_pkgname}-${pkgver}/src/asus-wmi.h

  cd "${srcdir}"
  install -m 644 dkms.conf ${pkgdir}/usr/src/${_pkgname}-${pkgver}/dkms.conf

  install -d -m 755 ${pkgdir}/etc/modprobe.d
  echo "blacklist asus-nb-wmi" > ${pkgdir}/etc/modprobe.d/asus-rog-nb-wmi.conf
}