summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 436e2a9687a1387d62dc35caa58e9810262fad8a (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
_pkgname=azmq
pkgname=$_pkgname-git
pkgver=0
pkgrel=1
pkgdesc="C++ language binding library integrating ZeroMQ with Boost Asio"
arch=("any")
url="https://github.com/zeromq/azmq"
license=('custom:boost')
depends=('boost>=1.54' 'zeromq>=4.0')
makedepends=('git' 'cmake>=2.8' 'boost>=1.54' 'zeromq>=4.0')

_gitroot='https://github.com/zeromq/azmq.git'
_gitname=master

prepare() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

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

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
}

build() {
  cd "$srcdir/$_gitname-build"
  mkdir build && cd build
  cmake -D CMAKE_INSTALL_PREFIX=/usr \
        -D CMAKE_CXX_FLAGS=-pthread \
        -D CMAKE_C_FLAGS=-pthread \
        ..
  make
}

check() {
  cd "$srcdir/$_gitname-build/build"
  make test
}

package() {
  cd "$srcdir/$_gitname-build"
  make -C build DESTDIR="$pkgdir/" install
  install -m 755 -d "$pkgdir/usr/share/licenses/$pkgname"
  install -m 644 LICENSE-BOOST_1_0 "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et: