# Contributor: Christian Kampka <christian@kampka.net>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=torsocks
pkgver=2.4.0
pkgrel=0
pkgdesc="Wrapper to safely torify applications"
url="https://gitlab.torproject.org/tpo/core/torsocks"
arch="all"
license="GPL-2.0"
makedepends="$depends_dev autoconf automake libtool"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://gitlab.torproject.org/tpo/core/torsocks/-/archive/v$pkgver/torsocks-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
7d625ce3a4600f87b86ae9ac79dfd206e7709cb0bafe0b7afcf33a6f1825f968cc63ad3e23c584582b244647bdeafbfdbfc54f7c81e521b0a3d278a1483ce86e  torsocks-2.4.0.tar.gz
"
