summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b0a5c9a2a9da3383629f0ee9add731630522b58 (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
72
73
74
75
76
77
78
79
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
# Former maintainer: Eden Rose <eenov1988@gmail.com>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgname=openssl-git
pkgver=3.1.0.beta1.r2821.g56a51b5a1e
pkgrel=1
pkgdesc="Toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols"
arch=('i686' 'x86_64')
url="https://www.openssl.org/"
license=('Apache')
depends=('glibc')
makedepends=('git' 'perl')
optdepends=('ca-certificates' 'perl')
provides=("openssl=$pkgver" 'libcrypto.so' 'libssl.so')
conflicts=('openssl')
backup=('etc/ssl/openssl.cnf')
options=('staticlibs')
source=("git+https://github.com/openssl/openssl.git"
        "ca-dir.patch::https://gitlab.archlinux.org/archlinux/packaging/packages/openssl/-/raw/main/ca-dir.patch")
sha256sums=('SKIP'
            'SKIP')


prepare() {
  cd "openssl"

  patch -Np1 -F100 -i "$srcdir/ca-dir.patch"
}

pkgver() {
  cd "openssl"

  _tag=$(git tag -l --sort -v:refname | grep -E '^openssl-[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/^openssl-//;s/-/./g'
}

build() {
  cd "openssl"

  if [ "$CARCH" = "x86_64" ]; then
    _target="linux-x86_64"
  elif [ "$CARCH" = "i686" ]; then
    _target="linux-x86"
  fi

  ./Configure \
    --prefix="/usr" \
    --libdir="lib" \
    --openssldir="/etc/ssl" \
    "$_target" \
    "-Wa,--noexecstack $CPPFLAGS $CFLAGS $LDFLAGS" \
    shared
  make depend
  make
}

check() {
  cd "openssl"

  # the test fails due to missing write permissions in /etc/ssl
  # revert this patch for make test
  #patch -Np0 -F100 -R -i "$srcdir/ca-dir.patch"
  #make test
  #patch -Np0 -F100 -i "$srcdir/ca-dir.patch"
  #make apps/CA.pl
}

package() {
  cd "openssl"

  make \
    DESTDIR="$pkgdir" \
    install_sw \
    install_ssldirs \
    install_man_docs
}