summaryrefslogtreecommitdiffstats
path: root/abs/extra/libssh/PKGBUILD
blob: b03945ebb4d20bc741064ba191e7b503c9b2ea8a (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
# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: ice-man <icemanf@gmail.com>
# Contributor: sergeantspoon <sergeantspoon@archlinux.us>

pkgbase=libssh
pkgname=(libssh libssh-docs)
pkgver=0.7.5
pkgrel=2
pkgdesc="Library for accessing ssh client services through C libraries"
url="http://www.libssh.org/"
license=(LGPL)
arch=(x86_64)
depends=(libgcrypt zlib) # use openssl again for 0.8
makedepends=(cmake cmocka doxygen)
source=(https://red.libssh.org/attachments/download/218/$pkgname-$pkgver.tar.xz
        https://red.libssh.org/attachments/download/217/$pkgname-$pkgver.tar.asc
        libssh-fix-read-config.patch::https://git.libssh.org/projects/libssh.git/patch/?id=5333be59)
sha256sums=('54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095'
            'SKIP'
            'c39bed86f34a377015fb6d6552700a3838c5cae1a4a83b3e859539785aeabdba')
validpgpkeys=('8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D') # Andreas Schneider <asn@cryptomilk.org>

prepare() {
  # disable the test. It is confused by our clean container setup.
  # 'extra-x86-build' uses user 'nobody' that has a record in /etc/passwd file
  # but $HOME envvar is set to '/build'. The test expects that $HOME corresponds to passwd file.
  sed 's/unit_test(torture_path_expand_tilde_unix),//' -i libssh-${pkgver}/tests/unittests/torture_misc.c

  mkdir -p build

  cd $pkgname-$pkgver
  # Fix reading SSH configuration files
  patch -p1 -i ../libssh-fix-read-config.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_GSSAPI=OFF \
    -DWITH_GCRYPT=ON \
    -DWITH_TESTING=ON
  make
  make doc
}

check() {
  cd build
  make test
}

package_libssh() {
  cd build
  make DESTDIR="$pkgdir" install
}

package_libssh-docs() {
  pkgdesc="Documentation for libssh"
  depends=()

  mkdir -p "$pkgdir"/usr/share/doc/libssh
  cp -r build/doc/html "$pkgdir"/usr/share/doc/libssh
  cp -r build/doc/man "$pkgdir"/usr/share
  rm "$pkgdir"/usr/share/man/man3/{bug,deprecated}.*
}