summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45689c6edfab9e074513c7e9de4052a3d53ce950 (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
# Maintainer: Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com>
pkgname=tufao-git
pkgver=0.0.0
pkgrel=1
pkgdesc="An asynchronous web framework for C++ built on top of Qt"
arch=('i686' 'x86_64')
url="https://github.com/vinipsmaker/tufao"
license=('LGPL2')
depends=('qt5-base')
makedepends=('cmake')
provides=('tufao')
conflicts=('tufao')
options=(debug)
source=("${pkgname}::git+https://github.com/vinipsmaker/tufao.git#branch=master")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  local major="$(grep -Eoe 'TUFAO_VERSION_MAJOR [[:digit:]]+' CMakeLists.txt | grep -Eoe '[[:digit:]]$')"
  local minor="$(grep -Eoe 'TUFAO_VERSION_MINOR [[:digit:]]+' CMakeLists.txt | grep -Eoe '[[:digit:]]$')"
  local patch="$(grep -Eoe 'TUFAO_VERSION_PATCH [[:digit:]]+' CMakeLists.txt | grep -Eoe '[[:digit:]]$')"
  local ver="$(git describe --long | sed -re s/^[^-]*/$major.$minor.$patch/g)"
  printf "%s" "${ver//-/.}"
}

build() {
  mkdir "$srcdir/$pkgname/build"
  cd "$srcdir/$pkgname/build"
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
  make
}

check() {
  cd "$srcdir/$pkgname/build"
  cmake -DENABLE_TESTS=ON .
  make tests
  cmake -DENABLE_TESTS=OFF .
}

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