summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a1c10306740c206c90b19521a61c27d57b7a43ba (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=winchecksec-git
pkgver=3.1.0.r5.gf8f6727
pkgrel=3
pkgdesc="Checksec, but for Windows: static detection of security mitigations in executables"
arch=('i686' 'x86_64')
url="https://trailofbits.github.io/winchecksec/"
license=('Apache')
depends=('gcc-libs' 'openssl' 'pe-parse')
makedepends=('git' 'cmake' 'uthenticode')
provides=("winchecksec=$pkgver")
conflicts=('winchecksec')
source=("git+https://github.com/trailofbits/winchecksec.git")
sha256sums=('SKIP')


pkgver() {
  cd "winchecksec"

  _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 "winchecksec"

  cmake \
    -B "_build" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    ./
  make -C "_build"
}

package() {
  cd "winchecksec"

  install -Dm755 "_build/winchecksec" -t "$pkgdir/usr/bin"
}