# $Id: PKGBUILD 138634 2015-08-22 11:37:10Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=tuntox
pkgver=0.0.4
pkgrel=1
pkgdesc='Tunnel TCP connections over the Tox protocol'
arch=('i686' 'x86_64')
url='http://tuntox.pl/'
license=('GPL3')
depends=('toxcore')
makedepends=('git' 'cscope')
source=("git+https://github.com/gjedeer/tuntox.git#tag=$pkgver"
        shared-build.patch)
sha512sums=('SKIP'
            'e5bbcdf14103c1d4cdd6bb4e142c14bd1ebc9130b8fa50cd5f50f99dbf54b1796f31adc78c21378d129e5c7ea9986d59e63ddb423bf3473c34f635f59dc19d8c')

prepare() {
  cd $pkgname
  patch -p1 -i ../shared-build.patch
}

build() {
  cd $pkgname
  make
}

package() {
  cd $pkgname
  install -Dm755 tuntox "$pkgdir/usr/bin/tuntox"
  install -Dm644 scripts/tuntox.service "$pkgdir/usr/lib/systemd/system/tuntox.service"
}
