PKGBUILDs/community/rclone/PKGBUILD

56 lines
1.9 KiB
Bash
Raw Normal View History

# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# ALARM: Lorenz Steinert <lsteinert@uraziel.de>
# - remove makedepends pandoc
# - remove rclone.1 MANUAL.html and MANUAL.txt targets from make in build()
pkgname=rclone
2021-11-04 20:26:21 +00:00
pkgver=1.57.0
2021-12-30 04:17:53 +00:00
pkgrel=2
pkgdesc="Sync files to and from Google Drive, S3, Swift, Cloudfiles, Dropbox and Google Cloud Storage"
arch=('x86_64')
url="https://rclone.org/"
license=('MIT')
depends=('glibc')
optdepends=('fuse2: for rclone mount')
2021-05-15 18:34:45 +00:00
makedepends=('python' 'go' 'git' 'fuse2')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rclone/rclone/archive/v$pkgver.tar.gz")
2021-11-04 20:26:21 +00:00
sha512sums=('d0428263b8ee1779f96176574dc17adb73668d56b9dcf6894a0aae4db2990148d785226defa520143df788d4401e1f297faa5c5c645d3c8503c796c06a1d3229')
prepare() {
cd "rclone-$pkgver"
sed -i "1s/python$/&2/" bin/make_manual.py bin/make_backend_docs.py
}
build() {
cd "rclone-$pkgver"
export GOFLAGS="-buildmode=pie -trimpath"
export CGO_LDFLAGS="${LDFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
2021-05-15 18:34:45 +00:00
PATH="/build/go/bin:$PATH" make TAG=v$pkgver rclone || true
PATH="/build/go/bin:$PATH" rclone genautocomplete bash rclone.bash_completion
PATH="/build/go/bin:$PATH" rclone genautocomplete zsh rclone.zsh_completion
}
check() {
cd "rclone-$pkgver"
2021-05-15 18:34:45 +00:00
PATH="/build/go/bin:$PATH" make TAG=v$pkgver test
}
package() {
cd "rclone-$pkgver"
install -Dm755 rclone "$pkgdir"/usr/bin/rclone
install -Dm644 rclone.bash_completion "$pkgdir"/usr/share/bash-completion/completions/rclone
install -Dm644 rclone.zsh_completion "$pkgdir"/usr/share/zsh/site-functions/_rclone
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
install -Dm644 rclone.1 "$pkgdir"/usr/share/man/man1/rclone.1
install -d "$pkgdir"/usr/share/doc/$pkgname
install -t "$pkgdir"/usr/share/doc/$pkgname -m644 MANUAL.html MANUAL.txt
}