# Maintainer: AdmiringWorm # Contributor: nirnakinho pkgname=dnscontrol pkgver=4.9.0 pkgrel=2 pkgdesc="Synchronize your DNS to multiple providers from a simple DSL" arch=('x86_64' 'armv7h' 'aarch64') url="https://stackexchange.github.io/${pkgname}/" license=('MIT') depends=('glibc') makedepends=('go') provides=("${pkgname}=${pkgver}") source=("${pkgname}-${pkgver}.tar.gz::https://github.com/StackExchange/${pkgname}/archive/v${pkgver}.tar.gz") sha512sums=('42dec7495e00595fb8d6ec174b45e87505a874a7f1ed286040a5ce0718cb9dee8b9a903f8c3f9f7c30a2e4e162a938b490667b397fe3ea6df79baa9df4036b58') prepare(){ cd "$pkgname-$pkgver" mkdir -p build/ # mkdir -p gopath/src/github.com/StackExchange # ln -rTsf $pkgname-$pkgver gopath/src/github.com/StackExchange/dnscontrol } build() { cd "$pkgname-$pkgver" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go build -o build } package() { cd "$pkgname-$pkgver" install -Dm755 build/${pkgname} "${pkgdir}/usr/bin/${pkgname}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }