summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02235b8df294cae38971df40e6649944121aef76 (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
# Maintainer: Arondight <shell_way@foxmail.com>

pkgname='sudodev-git'
pkgver='v0.28.r0.gac970ce'
pkgrel=1
pkgdesc='Create your special device for a none-password sudo'
arch=('any')
url='https://github.com/Arondight/sudodev.git'
license=('GPL')
groups=()
depends=('sudo')
makedepends=('git' 'cmake' 'make')
provides=()
conflicts=()
replaces=()
backup=()
options=()
install="${pkgname%-git}.install"
source=("${pkgname%-git}::git+${url}#tag=v0.28")
noextract=()
sha256sums=('SKIP')

builddir='build'

pkgver() {
  cd "${srcdir}/${pkgname%-git}"
  set -o pipefail
  git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g'  \
    || printf "r%s.%s" $(git rev-list --count HEAD) $(git rev-parse --short HEAD)
}

prepare() {
  cd "${srcdir}/${pkgname%-git}"
}

build() {
  cd "${srcdir}/${pkgname%-git}"
  mkdir -p $builddir
  cd $builddir
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${pkgdir}/"
  cmake --build . --config Release -- -j4
}

check() {
  cd "${srcdir}/${pkgname%-git}"
}

package() {
  cd "${srcdir}/${pkgname%-git}"
  cd $builddir
  make install
}