# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Kevin MacMartin <prurigro@gmail.com>
# Contributor: openfbt
# Contributor: Werecat
# Contributor: Xyne

pkgname=cjdns
pkgver=17.1
pkgrel=1
pkgdesc='A routing engine designed for security, scalability, speed and ease of use'
url='https://github.com/cjdelisle/cjdns'
arch=('i686' 'x86_64')
license=('GPL3')
depends=('glibc' 'sh')
makedepends=('nodejs' 'python2')
install=cjdns.install
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/cjdelisle/${pkgname}/archive/cjdns-v${pkgver}.tar.gz)
sha512sums=('aac6fc6d18bfd35d81a1cb4d1a72e7d8ed3aca8546780abec4994daf913d520956f917b9dd7ee3b93fc37504830a6cebf56a80976f74a4f576b35ab4de0ad3b7')

build() {
  cd ${pkgname}-${pkgname}-v${pkgver}
  bash 'do'
}

package() {
  cd ${pkgname}-${pkgname}-v${pkgver}
  install -Dm 755 cjdroute "${pkgdir}/usr/bin/cjdroute"
  install -Dm 644 contrib/systemd/${pkgname}.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
  install -Dm 644 doc/man/cjdroute.conf.5 "${pkgdir}/usr/share/man/man5/cjdroute.conf.5"
  install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -Dm 644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
    doc/admin-api.md \
    doc/configure.md \
    doc/djc_layer_model.md \
    doc/nat-gateway.md \
    doc/network-services.md \
    doc/non-root-user.md \
    doc/security_specification.md \
    doc/shorewall_and_vpn_gateway_howto.md \
    doc/tunnel.md
}

# vim: ts=2 sw=2 et:
