1 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
5 # use a pacman compatible version scheme
6 pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
9 pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
11 url='https://www.openssl.org'
12 license=('custom:BSD')
14 optdepends=('ca-certificates')
15 options=('!makeflags')
16 source=("https://www.openssl.org/source/openssl-${_ver}.tar.gz"
17 "https://www.openssl.org/source/openssl-${_ver}.tar.gz.asc"
19 'ssl3-test-failure.patch'
20 'openssl-1.0-versioned-symbols.patch')
21 sha256sums=('ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16'
23 '754d6107a306311e15a1db6a1cc031b81691c8b9865e8809ac60ca6f184c957c'
24 'c54ae87c602eaa1530a336ab7c6e22e12898e1941012349c153e52553df64a13'
25 '353a84e4c92e36c379ebd9216b8f8fb9c271396583561eb84ac8c825979acaa6')
26 validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491'
27 '7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C')
30 cd "$srcdir/openssl-$_ver"
32 # remove rpath: http://bugs.archlinux.org/task/14367
33 patch -p0 -i "$srcdir/no-rpath.patch"
35 # disable a test that fails when ssl3 is disabled
36 patch -p1 -i "$srcdir/ssl3-test-failure.patch"
38 # add symbol versioning to prevent conflicts with openssl 1.1 symbols (Debian)
39 patch -p1 -i "$srcdir"/openssl-1.0-versioned-symbols.patch
43 cd "$srcdir/openssl-$_ver"
45 if [ "${CARCH}" == 'x86_64' ]; then
46 openssltarget='linux-x86_64'
47 optflags='enable-ec_nistp_64_gcc_128'
48 elif [ "${CARCH}" == 'i686' ]; then
49 openssltarget='linux-elf'
53 # mark stack as non-executable: http://bugs.archlinux.org/task/12434
54 ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib/openssl-1.0 \
55 shared no-ssl3-method ${optflags} \
57 "-Wa,--noexecstack ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}"
64 cd "$srcdir/openssl-$_ver"
66 # https://www.mail-archive.com/openssl-users@openssl.org/msg83702.html
68 make OPENSSL_CONF= rehash
74 cd "$srcdir/openssl-$_ver"
76 make INSTALL_PREFIX="$pkgdir" install_sw
78 # Move some files around
79 install -m755 -d "$pkgdir/usr/include/openssl-1.0"
80 mv "$pkgdir/usr/include/openssl" "$pkgdir/usr/include/openssl-1.0/"
81 mv "$pkgdir/usr/lib/openssl-1.0/libcrypto.so.1.0.0" "$pkgdir/usr/lib/"
82 mv "$pkgdir/usr/lib/openssl-1.0/libssl.so.1.0.0" "$pkgdir/usr/lib/"
83 ln -sf ../libssl.so.1.0.0 "$pkgdir/usr/lib/openssl-1.0/libssl.so"
84 ln -sf ../libcrypto.so.1.0.0 "$pkgdir/usr/lib/openssl-1.0/libcrypto.so"
85 mv "$pkgdir/usr/bin/openssl" "$pkgdir/usr/bin/openssl-1.0"
87 # Update includedir in .pc files
88 sed -e 's|/include$|/include/openssl-1.0|' -i "$pkgdir"/usr/lib/openssl-1.0/pkgconfig/*.pc
90 rm -rf "$pkgdir"/{etc,usr/bin/c_rehash}
92 install -D -m644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"