summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7e8a715cf8c456b89832680f71ba9f2c166f18e8 (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
# Maintainer:  Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>

_pkgname="nchess"
pkgname="${_pkgname}-git"
pkgver=r32.7489711
pkgrel=4
pkgdesc="Chess in the terminal, written in C99"
arch=('x86_64')
url="https://github.com/billyvinning/${_pkgname}"
license=('GPL-3.0-or-later')
depends=('glibc' 'ncurses')
makedepends=('git')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
_pkgsrc="${_pkgname}"
source=("${_pkgsrc}::git+${url}.git")
sha256sums=('SKIP')

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

build() {
  cd "${srcdir}/${_pkgsrc}/src"
  gcc ${CFLAGS} ${LDFLAGS} main.c -o "../${_pkgname}" -std=c99 -I engine -I tui -lncurses -lm
}

package() {
  cd "${srcdir}/${_pkgsrc}"
  install -vDm755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  install -vDm644 "README.rst"  "${pkgdir}/usr/share/doc/${_pkgname}/README.rst"
  install -vDm644 "COPYING.rst" "${pkgdir}/usr/share/licenses/${_pkgname}/COPYING.rst"
}