aboutsummaryrefslogblamecommitdiffstats
path: root/community/rest-server/APKBUILD
blob: d04f94441a3a9b5be26da673f8fc8c8d4ce5b77a (plain) (tree)
1
2
3
4
5
6
7
8


                                                              
             
        

                                                                                  
          


                      
             

                                          
                                                                                           
                      


                             














                                                    




                                      





                                                          




                                                 

 




                              
                                                                                                                                                                       
                                                                                                                                                   

                                                                                                                                                       
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=rest-server
pkgver=0.10.0
pkgrel=2
pkgdesc="A high performance HTTP server that implements restic's REST backend API"
url="https://github.com/restic/rest-server"
arch="all"
license="BSD-2-Clause"
depends=""
makedepends="go"
options="net"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/restic/$pkgname/archive/v$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd

	0001-Fix-tests.patch"
builddir="$srcdir/src/github.com/restic/$pkgname"

export GOPATH="$srcdir"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"
	default_prepare
}

build() {
	cd "$builddir"
	go build ./cmd/...
}

check() {
	cd "$builddir"
	go test -v . ./cmd/rest-server
}

package() {
	cd "$builddir"

	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 README.md \
		"$pkgdir"/usr/share/doc/$pkgname/README.md

	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

cleanup_srcdir() {
	go clean -modcache
	default_cleanup_srcdir
}

sha512sums="b209edf2cb6e8ae11ff4800ffd84195c6052180ee81e5b79cb71895b9b559e0c6455835255f0b34d5d70482c4917f8491747bf0487ec3766432ae57e07d93884  rest-server-0.10.0.tar.gz
cd9e4d3df04c26aa602a57196bdfb14d7ad6e957f1d9596a09e596b9d01543eee08474817ba47192659fe6f5ab15b8fa64400fb6a8d24111f5c792b1412f5e5b  rest-server.confd
185c0022d07c66fcee2d84af1bb0a11ac0753bd79deb8f5ae7dc2bd84909886aa3e58f42cd6ace4f191da6128d0385036948d4a8accd14cf9cdb9603001b9aca  rest-server.initd
975ab6f16b7515f93070e46c3d6f15be42d3504b6b77a9892dc60f9b01c483d6477a5455f0b6c6ebf088c7272074033d53f0f061e065944f28f53abb0db9815f  0001-Fix-tests.patch"