summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f4b34310394a4d70b8d70019917a08362fb4373 (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
##
# Maintainer: pyamsoft <developer(dot)pyamsoft(at)gmail(dot)com>
##

_gitname=usergrant
# shellcheck disable=SC2034
pkgname=usergrant-git
# shellcheck disable=SC2034
pkgdesc="Temporarily grant ACLs and environment to a secondary user for the duration of a command"
# shellcheck disable=SC2034
pkgver="0.0.1".r3.89a0b27
# shellcheck disable=SC2034
pkgrel=1
# shellcheck disable=SC2034
arch=('any')
# shellcheck disable=SC2034
makedepends=('git')
# shellcheck disable=SC2034
depends=('systemd' 'pulse-native-provider' 'xorg-server-xwayland' 'wayland' 'xorg-xhost' 'coreutils' 'grep' 'awk')
# shellcheck disable=SC2034
optdepends=()
# shellcheck disable=SC2034
provides=('usergrant')
# shellcheck disable=SC2034
conflicts=('usergrant')
# shellcheck disable=SC2034
license=('GPL2')
url="https://github.com/pyamsoft/usergrant.git"

##
# The SHA256 is constantly changing since this is
# pulled from git so skip the verification check
##
# shellcheck disable=SC2034
source=("${_gitname}::git+${url}#branch=main")
# shellcheck disable=SC2034
sha256sums=('SKIP')

pkgver() {
  # shellcheck disable=SC2154
  cd "${srcdir}/${_gitname}" || {
    msg "Failed to cd into ${srcdir}/${_gitname}"
    return 1
  }

  printf "%s.r%s.%s" "$(awk -F '=' '{if (/^readonly VERSION=/) {print $2}}' "${_gitname}")" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  # shellcheck disable=SC2154
  cd "${srcdir}/${_gitname}" || {
    msg "Failed to cd into ${srcdir}/${_gitname}"
    return 1
  }

  # Open up the umask in case you are running something more restrictive
  umask 0022

  # Mark the script executable
  chmod 755 "${_gitname}"

  # shellcheck disable=SC2154
  mkdir -p "${pkgdir}/usr/bin"
  mkdir -p "${pkgdir}/usr/share/doc/${_gitname}"
  mkdir -p "${pkgdir}/usr/share/licenses/${_gitname}"

  cp "${_gitname}" "${pkgdir}/usr/bin/${_gitname}"
  cp "LICENSE" "${pkgdir}/usr/share/licenses/${_gitname}/LICENSE"
  cp "README.md" "${pkgdir}/usr/share/doc/${_gitname}/README.md"
}