This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD

By: a guest on Feb 17th, 2013  |  syntax: Bash  |  size: 2.28 KB  |  views: 110  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # $Id$
  2. # Maintainer: Pierre Schmitz <pierre@archlinux.de>
  3.  
  4. pkgname=openssl
  5. _ver=1.0.1e
  6. # use a pacman compatible version scheme
  7. pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
  8. #pkgver=$_ver
  9. pkgrel=3
  10. pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
  11. arch=('i686' 'x86_64')
  12. url='https://www.openssl.org'
  13. license=('custom:BSD')
  14. depends=('perl')
  15. optdepends=('ca-certificates')
  16. options=('!makeflags')
  17. backup=('etc/ssl/openssl.cnf')
  18. source=("https://www.openssl.org/source/${pkgname}-${_ver}.tar.gz"
  19.         "https://www.openssl.org/source/${pkgname}-${_ver}.tar.gz.asc"
  20.         'no-rpath.patch'
  21.         'ca-dir.patch')
  22. md5sums=('66bf6f10f060d561929de96f9dfe5b8c'
  23.          'e18847df48d39416f4ca5064887a2e28'
  24.          'dc78d3d06baffc16217519242ce92478'
  25.          '3bf51be3a1bbd262be46dc619f92aa90')
  26.  
  27. build() {
  28.         cd $srcdir/$pkgname-$_ver
  29.  
  30.         if [ "${CARCH}" == 'x86_64' ]; then
  31.                 openssltarget='linux-x86_64'
  32.                 optflags='enable-ec_nistp_64_gcc_128'
  33.         elif [ "${CARCH}" == 'i686' ]; then
  34.                 openssltarget='linux-elf'
  35.                 optflags=''
  36.         fi
  37.  
  38.         # remove rpath: http://bugs.archlinux.org/task/14367
  39.         patch -p0 -i $srcdir/no-rpath.patch
  40.         # set ca dir to /etc/ssl by default
  41.         patch -p0 -i $srcdir/ca-dir.patch
  42.  
  43.         # mark stack as non-executable: http://bugs.archlinux.org/task/12434
  44.         ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib \
  45.                 shared zlib ${optflags} \
  46.                 "${openssltarget}" \
  47.                 -Wa,--noexecstack "${CFLAGS}" "${LDFLAGS}" \
  48.                 -DOPENSSL_NO_TLS1_2_CLIENT \
  49.                 -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50
  50.  
  51.         make depend
  52.         make
  53. }
  54.  
  55. check() {
  56.         cd $srcdir/$pkgname-$_ver
  57.         # the test fails due to missing write permissions in /etc/ssl
  58.         # revert this patch for make test
  59.         patch -p0 -R -i $srcdir/ca-dir.patch
  60.         sed 's/TLSv1.2 //g' -i test/testssl
  61.         make test
  62.         patch -p0 -i $srcdir/ca-dir.patch
  63. }
  64.  
  65. package() {
  66.         cd $srcdir/$pkgname-$_ver
  67.         make INSTALL_PREFIX=$pkgdir MANDIR=/usr/share/man MANSUFFIX=ssl install
  68.         install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
  69. }
clone this paste RAW Paste Data