aboutsummaryrefslogblamecommitdiffstats
path: root/main/wireguard-tools/APKBUILD
blob: e9f444c8be57686cacb502ab93b03c52fe35ccb0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

                                                           
                       
                   
        
                                                                





                                                                          

                                                   


                                       
                                


                                       
                
                                                                                      

         
                   


           
                                                 
 
                     



                                         
                       
 

                                                                    

 



                                         
                                                                                   





                                                       
                                                                                                                                                                                  
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=wireguard-tools
pkgver=1.0.20210424
pkgrel=0
pkgdesc="Next generation secure network tunnel: userspace tools"
arch="all"
url="https://www.wireguard.com"
# SPDX identifier headers tells us 'GPL-2.0' but considering it
# is a kernel project i think it is safe to assume it is GPL-2.0-only just
# like the kernel.
license="GPL-2.0-only"
_wg_quick_deps="iproute2 ip6tables bash openresolv"
makedepends="libmnl-dev $_wg_quick_deps"
depends="$pkgname-wg $pkgname-wg-quick"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-wg:_split
	$pkgname-wg-quick:_split:noarch
	"
options="!check"
source="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-$pkgver.tar.xz"

build() {
	make -C src
}

package() {
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"

	make -C src \
		DESTDIR="$pkgdir" \
		WITH_BASHCOMPLETION=yes \
		WITH_WGQUICK=yes \
		WITH_SYSTEMDUNITS=no \
		install

	find "$builddir"/contrib -name '.gitignore' -delete
	cp -rf "$builddir"/contrib "$pkgdir/usr/share/doc/$pkgname/"
}

_split() {
	local cmd=${subpkgname/$pkgname-}
	pkgdesc="$pkgdesc ($cmd)"
	case $cmd in
		wg-quick) depends="$pkgname-wg=$pkgver-r$pkgrel $_wg_quick_deps" ;;
		*) depends= ;;
	esac
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$cmd "$subpkgdir"/usr/bin/
}

sha512sums="b919c7ce1e8ee8660ccc1490d3dad7817f3d6f0ab79f26866e8ed10d40545a9ddca67959ff6cc84ac36a91683c1f58d274d91d47f40c0b9a7bfee4009dcbbf59  wireguard-tools-1.0.20210424.tar.xz"