summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6a45fa7ac6d4533148578f957ce5c220c6ff9f1 (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
# 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.0.0.alpha6.r483.g6600baa9bb
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' 'perl')
makedepends=('git')
optdepends=('ca-certificates')
provides=('openssl')
conflicts=('openssl')
backup=('etc/ssl/openssl.cnf')
options=('staticlibs')
source=("git+https://github.com/openssl/openssl.git"
        "ca-dir.patch::https://git.archlinux.org/svntogit/packages.git/plain/trunk/ca-dir.patch?h=packages/openssl")
sha256sums=('SKIP'
            'SKIP')


prepare() {
  cd "openssl"

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

pkgver() {
  cd "openssl"

  git describe --long --tags | sed 's/^OpenSSL[_-]//I;s/\([^-]*-g\)/r\1/;s/-/./g;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
}