summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a74cbd5b80d7e24b546a0cb951ec37cd1b429100 (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
pkgname='openflow-git'
_pkgname='openflow'
pkgver=r13.4869d4f
pkgrel=1
pkgdesc="Flow-based switch specification."
arch=('x86_64')
url="https://gitlab.com/nsnam/openflow"
license=('GPL-2.0-only')
conflicts=('openflow')
provides=('openflow')
depends=('libxml2')
makedepends=('cmake' 'git')
source=("git+${url}.git")
sha256sums=('SKIP')
options=(!strip)

pkgver() {
  cd ${_pkgname}
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  local cmake_options=(
    -B build
    -S ${_pkgname}
    -W no-dev
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
  )
  cmake "${cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}