summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ade66abd979afff79bc3dec3e3cb34d52e4f417 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
# Previous maintainer:  Vincent Grande <shoober420@gmail.com>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>

pkgname=keyutils-git
pkgver=1.6.3.r6.gc076dff
pkgrel=1
pkgdesc="Key management utilities"
arch=('i686' 'x86_64')
url="https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/"
license=('GPL' 'LGPL')
depends=('glibc' 'sh')
makedepends=('git')
provides=("keyutils=$pkgver" 'libkeyutils.so')
conflicts=('keyutils')
backup=('etc/request-key.conf')
options=('staticlibs')
source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git"
        "reproducible.patch::https://gitlab.archlinux.org/archlinux/packaging/packages/keyutils/-/raw/main/reproducible.patch"
        "request-key.conf.patch::https://gitlab.archlinux.org/archlinux/packaging/packages/keyutils/-/raw/main/request-key.conf.patch")
sha256sums=('SKIP'
            'SKIP'
            'SKIP')


prepare() {
  cd "keyutils"

  patch -Np1 -i "$srcdir/reproducible.patch"
  patch -Np0 -i "$srcdir/request-key.conf.patch"
}

pkgver() {
  cd "keyutils"

  _tag=$(git tag -l --sort -v:refname | grep -E '^v?[0-9\.]+$' | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'
}

build() {
  cd "keyutils"

  make \
    CFLAGS="$CFLAGS" \
    LDFLAGS="$LDFLAGS" \
    BINDIR="/usr/bin" \
    SBINDIR="/usr/bin"
}

check() {
  cd "keyutils"

  #make test
}

package() {
  cd "keyutils"

  make \
    DESTDIR="$pkgdir" \
    BINDIR="/usr/bin" \
    SBINDIR="/usr/bin" \
    LIBDIR="/usr/lib" \
    USRLIBDIR="/usr/lib" \
    install
}