summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3ebeae03fb52118118183d671d8767b61d855848 (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
# Maintainer: envolution
# Contributor: Felix Uhl <aur@mail.felix-uhl.de>
# Contributor: Christian Hesse <mail@eworm.de>
# Contributor: cantabile <cantabile dot desu at gmail dot com>
# shellcheck shell=bash disable=SC2034,SC2154

pkgname=uswsusp-git
_pkgname=uswsusp
pkgver=1.0.libgcrypt.1.6.3+r522+g84d75e60b
pkgrel=2
pkgdesc='Userspace software suspend - git checkout'
arch=('i686' 'x86_64')
url='http://suspend.sourceforge.net/'
license=('GPL-3.0-or-later')
depends=('libx86' 'lzo' 'pciutils' 'perl-switch' 'libgcrypt')
makedepends=('git')
provides=('uswsusp')
conflicts=('uswsusp')
backup=('etc/suspend.conf')
install=uswsusp.install
source=(
  'git+https://github.com/bircoph/suspend.git'
  'uresume-hook'
  'uresume-install'
)
sha256sums=('SKIP'
            '2662d879ca7a2339233c8bdce123f0d686397093759ca54f162a3577603587b0'
            '9fe3e38301014b4c8597aec2041ad3c6d85e6935004cbd3ac93659d391db3157')

pkgver() {
  cd suspend

  _version=$(git tag --sort=-v:refname --list | grep '^[0-9.]' | tr - . | head -n1)
  _commits=$(git rev-list --count HEAD)
  _short_commit_hash=$(git rev-parse --short=9 HEAD)
  echo "${_version}+r${_commits}+g${_short_commit_hash}"
}

build() {
  cd suspend

  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --enable-compress \
    --enable-threads \
    --disable-resume-static \
    --disable-static \
    --sysconfdir=/etc \
    --enable-encrypt
  make
}

package() {
  install -Dm644 uresume-hook "${pkgdir}/usr/lib/initcpio/hooks/uresume"
  install -Dm644 uresume-install "${pkgdir}/usr/lib/initcpio/install/uresume"
  install -dm755 "${pkgdir}/etc"

  cd suspend
  make DESTDIR="${pkgdir}/" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
  install -Dm644 COPYING.GPL "${pkgdir}/usr/share/licenses/${pkgname}/COPYING.GPL"
}
# vim:set ts=2 sw=2 et: