summaryrefslogtreecommitdiff
path: root/pcr/tcpcrypt/PKGBUILD
blob: 28ace46143691f30c0cfb5bc74143788f246c52b (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
# Maintainer: Luke R. <g4jc@openmailbox.org> GPG: rsa4096/3EAE8697
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: mutantmonkey <aur@mutantmonkey.in>
# Contributor: grawity

pkgname=tcpcrypt
pkgver=0.3
pkgrel=1
pkgdesc="Transparent user space implementation for the tcpcrypt TCP extensions"
arch=(i686 x86_64)
url="http://tcpcrypt.org/"
license=('BSD')
depends=('libnetfilter_queue' 'openssl' 'iptables')
makedepends=('git' 'sed' 'openssl')
provides=('tcpcrypt')
conflicts=('tcpcrypt')
source=('https://github.com/scslab/tcpcrypt/archive/v0.3-rc1.tar.gz'
'PKGBUILD.sig'
'PKGBUILD'
'tcpcrypt.service'
'tcpcrypt.install')
install='tcpcrypt.install'
validpgpkeys=('CB6E213A349B8DF9E96B622AC3F4FFCF3EAE8697') # PKGBUILD Maintainer's key
sha512sums=('53fcbe63bd0cd65d50341312972f393620058269cf027d283ca033392d6582cf7c0a4478ec21e37f5dd24b62381aa33915179e235e204c3be9243428a0744fa7'
'SKIP'
'SKIP'
'f44342325e831a94ed24cd5d2838dfc64d84d0eaceab13f1928c754db51ccc29f643c5ef2dab022f3000f1b82214f1a4b97388e5c2475e0401041d2fff747da8'
'0d64943f2bc778cbf1a52debe349413f00b729d605d26f35e1335c8e4c0f9aff8526593835d48e4e4847e0fcada2c6a980f60baddb2c66eb445099a9f89bdaeb')

pkgver() {
tar -ztvf $pkgname-$pkgver.tar.gz | head -n1 | awk '{print $6}' | sed "s/tcpcrypt-//" | sed "s/\///" # get latest version number
}

build() {
  gpg --verify PKGBUILD.sig PKGBUILD
  echo "Note: If the GPG verification fails, import the PKGBUILD maintainer's GPG key. See: https://wiki.parabola.nu/GnuPG#Import_key"
  whirlpoolsum=('e2573f8f1d5568c9c8f863975f3c02159821aa5c6c3a35d45398eaa84e229e7c24135c0466cfb71ee3bd7132097e29f8afcb43cb60bfb0d7f2a01237c33d5320')
  [[ "$(openssl dgst -r -whirlpool $pkgname-$pkgver-rc1.tar.gz | awk '{print $1}')" = ${whirlpoolsum} ]] && echo "Whirlpool checksum passed." || { echo "Whirlpool checksum failed!!" ;  exit 1; } # This is an added security layer. If SHA512 for some unlikely reason fails, whirlpool will check and abort if it too fails to match.
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install

  install -Dm644 $srcdir/$pkgname-$pkgver-rc1/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 "$srcdir"/tcpcrypt.service "$pkgdir"/usr/lib/systemd/system/tcpcrypt.service
}