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
# Maintainer: 458italia <[email protected]>
# Contributor: vti <viacheslav.t AT gmail.com>
# Contributor: Massimiliano Torromeo <[email protected]>

pkgname=libssh-git
pkgver=20130213
pkgrel=1
pkgdesc="Library for accessing ssh client services through C libraries"
license=('LGPL')
arch=('i686' 'x86_64')
depends=('openssl' 'zlib')
makedepends=('cmake' 'git')
url="http://www.libssh.org/"
conflicts=('libssh')
provides=('libssh')

_gitroot='git://git.libssh.org/projects/libssh.git'
_gitname='libssh'

build() {
	cd "$srcdir"

	msg "Connecting to git.libssh.org GIT server...."

	if [ -d "$srcdir/$_gitname" ] ; then
		cd $_gitname && git pull origin
		msg "The local files are updated."
	else
		git clone $_gitroot
		cd $_gitname
	fi

	# Build dir...
	rm -rf "$srcdir/build"
	mkdir -p "$srcdir/build"
	cd "$srcdir/build"

	# Generate Makefile, compile, and install
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DWITH_STATIC_LIB=ON ../$_gitname
	make
}

package() {
	cd "$srcdir/build"
	make DESTDIR="${pkgdir}" install
}