# Contributor: Christian Kampka <christian@kampka.net>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=torsocks
pkgver=2.4.0
pkgrel=1
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
	gcc14-fix-compatibility-with-c99.patch
	configure.ac-update-version-to-2.4.0.patch
	"
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
fa9d1a2c2e9a0ce60d4cd449cd529e8949a5ad3b4923f74708e43a316b797eec88c1f198558e357e72eec59b76e73570e4b867923f695afe25219c8606303b7e  gcc14-fix-compatibility-with-c99.patch
840ee977ed9459a921b082d408314c6f8e24efe83b140cdb2448e60aaf1b398d5535830c73bf9007c513e5a14dc47ae23f7dad6d726563be52b5cf0cd57b634f  configure.ac-update-version-to-2.4.0.patch
"
