summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 331a75c6b0573df7b139888cf0d10b2ab0da4165 (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
# Maintainer: Kevin MacMartin <prurigro@gmail.com>

_pkgname=brightness
pkgname=${_pkgname}-git
pkgver=20230924.r18.30d3269
pkgrel=2
pkgdesc="A small Rust program that uses ddcutil to control your monitor's brightness"
url='https://gitlab.com/Devorlon/brightness'
license=('AGPL3')
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
depends=('ddcutil')
makedepends=('cargo' 'ruby-ronn-ng')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+$url")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname
  printf "%s.r%s.%s" "$(git show -s --format=%ci main | sed 's/\ .*//g;s/-//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_pkgname
  sed 's|^####|###|' README.md > brightness.md
  ronn brightness.md
}

build() {
  cd $_pkgname
  cargo build --release --locked
}

package() {
  cd $_pkgname
  install -Dm755 target/release/$_pkgname "$pkgdir/usr/bin/$_pkgname"
  install -Dm644 "${_pkgname}" "$pkgdir/usr/share/man/man1/${_pkgname}.1"
}