# Maintainer: Jonathon Fernyhough # Contributor: krevedko pkgname=seaweedfs pkgver=2.07 pkgrel=1 pkgdesc="SeaweedFS is a simple and highly scalable distributed file system" arch=('i686' 'x86_64' 'aarch64' 'armv7h' 'armv6h' 'arm') url="https://github.com/chrislusf/seaweedfs" license=('APACHE') makedepends=('git' 'go') source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" ldflags.patch) sha256sums=('176ed7f454df1addbde06a9df151986cbcb44671215327ae0a07b7e237424579' '64db3c34767099aab8ec385c0b6796a2745ed66fa35159df0e8108da31e710db') prepare() { cd $pkgname-$pkgver patch -Np1 -i ../ldflags.patch export GOPATH="${SRCDEST:-$srcdir}" go mod vendor } build() { export CGO_CPPFLAGS="$CPPFLAGS" export CGO_CFLAGS="$CFLAGS" export CGO_CXXFLAGS="$CXXFLAGS" export CGO_LDFLAGS="$LDFLAGS" export GOFLAGS="-buildmode=pie -trimpath -mod=vendor -modcacherw" cd $pkgname-$pkgver make GOPATH="${SRCDEST:-$srcdir}" } package() { cd $pkgname-$pkgver install -D weed/weed "$pkgdir"/usr/bin/weed install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE }