summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4dbeb824c59b00f7e73f81b1d9f9ee9a7c752a26 (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
# Maintainer: Benjamin Maisonnas <ben at wainei dot net>
# Author: Ondrej ńĆerman

_pkgbase=zenpower
pkgname=zenpower-dkms-git
pkgver=42.2fc2493
pkgrel=1
pkgdesc="Linux kernel driver for reading sensors for AMD Zen family CPUs"
arch=('x86_64' 'i686')
url="https://github.com/ocerman/zenpower"
license=('GPL')
depends=('dkms')
makedepends=('git' 'linux-headers')
provides=('zenpower')

source=("$_pkgbase::git+$url.git"
        "Makefile"
        "dkms.conf"
        "$_pkgbase.conf")

sha256sums=('SKIP'
            'f7f2c87bfed0d4a921d196948b77f9c9d75357b6c3396b72ad9eac9db1720580'
            '9eb35ca8dcff02744dd3256238f22bfe6ebaf1636867aabed4c40a31073c4e1e'
            '92c26ef5cd6f8a632f2d8cb12e9da8c4452cb0432ffe543733f13e67d6531d04')

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

prepare() {
  cd "$srcdir/$_pkgbase"
}

package() {
  cd "$srcdir/$_pkgbase"

  install -d "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
  cp -r ${srcdir}/${_pkgbase}/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/

  install -Dm644 ${srcdir}/Makefile "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/Makefile
  install -Dm644 ${srcdir}/dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  sed -e "s/@_PKGBASE@/${_pkgbase}/" \
    -e "s/@PKGVER@/${pkgver}/" \
    -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  install -Dm644 ${srcdir}/${_pkgbase}.conf "${pkgdir}"/usr/lib/depmod.d/${_pkgbase}.conf
}