summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a526cb4e8525a2e5f924d6f1eb050e9a75a6e56 (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
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Samsagax <samsagax at gmail dot com>
_pkgbase=chimeraos-device-quirks
pkgname=${_pkgbase}-git
pkgver=r247.696f348
pkgrel=1
pkgdesc="A collection of device specific configuration files"
arch=('any')
url="https://github.com/ChimeraOS/device-quirks"
license=('MIT')
depends=('acpica'
  'cpio'
  'systemd'
  'swh-plugins')
makedepends=('git')
source=("${_pkgbase}::git+https://github.com/ChimeraOS/device-quirks.git")
md5sums=('SKIP')
backup=("etc/device-quirks/device-quirks.conf")

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

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

  # Install binaries
  install -v -m755 -D -t "${pkgdir}/usr/bin/" usr/bin/*

  # Install module tweaks
  install -v -m644 -D -t "${pkgdir}/usr/lib/modprobe.d/" usr/lib/modprobe.d/*
  install -v -m644 -D -t "${pkgdir}/usr/lib/modules-load.d/" usr/lib/modules-load.d/*

  # Install udev tweaks
  install -v -m644 -D -t "${pkgdir}/usr/lib/udev/rules.d/" usr/lib/udev/rules.d/*
  install -v -m644 -D -t "${pkgdir}/usr/lib/udev/hwdb.d/" usr/lib/udev/hwdb.d/*

  # Install systemd units
  install -v -m644 -D -t "${pkgdir}/usr/lib/systemd/user/" usr/lib/systemd/user/*
  install -v -m644 -D -t "${pkgdir}/usr/lib/systemd/system/" usr/lib/systemd/system/*
  install -v -m755 -D -t "${pkgdir}/usr/lib/systemd/system-sleep/" usr/lib/systemd/system-sleep/*

  # Install firmware
  mkdir -p "${pkgdir}/usr/lib/firmware/"
  cp -rv usr/lib/firmware/* "${pkgdir}/usr/lib/firmware/"

  # Install sysctl configurations
  install -v -m644 -D -t "${pkgdir}/usr/lib/sysctl.d/" usr/lib/sysctl.d/*

  # Install scripts
  mkdir -p "${pkgdir}/usr/share/device-quirks"
  cp -rv usr/share/device-quirks/* "${pkgdir}/usr/share/device-quirks/."

  # Install device-quirks config
  mkdir -p "${pkgdir}/etc/device-quirks"
  cp -rv etc/device-quirks/* "${pkgdir}/etc/device-quirks/."

  # Install license
  install -v -m644 -D -t "${pkgdir}/usr/share/licenses/${_pkgbase}/" LICENSE
}