summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 58d82e5efedb2cd2ba8e4cf86da2d0a1fbed74b0 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Maintainer: Sven Karsten Greiner <sven@sammyshp.de>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Marc Schulte <bomba@nerdstube.de>

pkgbase=tlp-git
pkgname=(
  tlp-git
  tlp-pd-git
  tlp-rdw-git
)
pkgver=1.9.0.r3.380d1bb
pkgrel=1
arch=(any)
url=https://linrunner.de/en/tlp/tlp.html
license=('GPL-2.0-or-later AND GPL-3.0-only')
makedepends=(git)
source=(git+https://github.com/linrunner/TLP.git)
sha256sums=(SKIP)
install=tlp.install

pkgver() {
  cd TLP

  git describe --tags | sed 's/[–-]alpha./.a/; s/[–-]beta./.b/; s/-/.r/; s/-g/./'
}

package_tlp-git() {
  pkgdesc='Optimize laptop battery life'
  depends=(
    bash
    hdparm
    iw
    pciutils
    perl
    rfkill
    usbutils
    util-linux
  )
  optdepends=(
    'bash-completion: Bash completion'
    'ethtool: Disable Wake On Lan'
    'smartmontools: Display S.M.A.R.T. data in tlp-stat'
    'tlp-pd: Switch power profiles from the desktop'
    'tlp-rdw: Switch wifi and bluetooth on/off automatically'
    'tp_smapi: Older ThinkPad battery functions (before Sandy Bridge)'
  )
  provides=(tlp)
  conflicts=(
    laptop-mode-tools
    pm-utils
    tlp
    tuned
  )
  backup=(etc/tlp.conf)

  export TLP_NO_INIT=1
  export TLP_SBIN=/usr/bin
  export TLP_WITH_ELOGIND=0

  make DESTDIR="${pkgdir}" -C TLP install-tlp install-man-tlp
}

package_tlp-pd-git() {
  pkgdesc='Switch power profiles from the desktop'
  depends=(
    glib2
    polkit
    python
    python-dbus
    python-gobject
    tlp
  )
  provides=(
    power-profiles-daemon
    tlp-pd
  )
  conflicts=(
    power-profiles-daemon
    tlp-pd
    tuned-ppd
  )

  export TLP_SBIN=/usr/bin

  make DESTDIR="${pkgdir}" -C TLP install-pd install-man-pd
}

package_tlp-rdw-git() {
  pkgdesc='Switch wifi and bluetooth on/off automatically'
  depends=(
    bash
    networkmanager
    tlp
  )
  provides=(tlp-rdw)
  conflicts=(tlp-rdw)

  make DESTDIR="${pkgdir}" -C TLP install-rdw install-man-rdw
}

# vim: ts=2 sw=2 et: