From e68e0feedd71046c5bbe3af975f16142a33f358d Mon Sep 17 00:00:00 2001 From: axionl Date: Tue, 2 Apr 2019 22:40:10 +0900 Subject: [PATCH 1/3] Add auto completions for bash and fish shell. --- .gitlab-ci.yml | 8 +++++++- pkg/aur/ffsend-bin/PKGBUILD | 20 +++++++++++++++----- pkg/aur/ffsend-git/PKGBUILD | 13 +++++++++++-- pkg/aur/ffsend/PKGBUILD | 13 +++++++++++-- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09b3de8..bfac1a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -271,11 +271,17 @@ package-aur: - echo "Determining SHA checksums for remote files..." - URL_BIN=https://github.com/timvisee/ffsend/releases/download/v$VERSION/ffsend-v$VERSION-linux-x64-static - URL_SOURCE=https://gitlab.com/timvisee/ffsend/-/archive/v$VERSION/ffsend-v$VERSION.tar.gz + - BASH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.bash" + - FISH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.fish" - 'echo "Selected binary URL: $URL_BIN"' - 'echo "Selected source URL: $URL_SOURCE"' - echo "Determining sha256sum for remote binary..." - 'SHA_BIN=$(curl -sSL "$URL_BIN" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sum: $SHA_BIN"' + - 'SHA_BASH_COMPLETION=$(curl -sSL "BASH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'echo "Got sha256sums of bash completion: $SHA_BASH_COMPLETION"' + - 'SHA_FISH_COMPLETION=$(curl -sSL "FISH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'echo "Got sha256sums of fish completion: $SHA_FISH_COMPLETION"' - echo "Determining sha256sum for remote source..." - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sum: $SHA_SOURCE"' @@ -288,7 +294,7 @@ package-aur: - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_BIN | sed 's/\//\\\//g')\")/" -i ffsend-bin/PKGBUILD - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i ffsend/PKGBUILD - - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_BIN')/" -i ffsend-bin/PKGBUILD + - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_BIN' '$SHA_BASH_COMPLETION' '$SHA_FISH_COMPLETION')/" -i ffsend-bin/PKGBUILD # Get SHA hash for local and remote file w/o version, update if it has changed - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' diff --git a/pkg/aur/ffsend-bin/PKGBUILD b/pkg/aur/ffsend-bin/PKGBUILD index 0583d5b..45fbc4f 100644 --- a/pkg/aur/ffsend-bin/PKGBUILD +++ b/pkg/aur/ffsend-bin/PKGBUILD @@ -6,19 +6,29 @@ # - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-bin/PKGBUILD pkgname=ffsend-bin -pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml +pkgver=0.2.42 # automatically set in CI, see: /.gitlab-ci.yml pkgrel=1 pkgdesc="Easily and securely share files from the command line. A Firefox Send client." url="https://gitlab.com/timvisee/ffsend" license=('GPL3') -source=("ffsend-v${pkgver}::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static") # automatically set in CI, see: /.gitlab-ci.yml -sha256sums=('SKIP') # automatically set in CI, see: /.gitlab-ci.yml +source=("ffsend-v${pkgver}::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static" + "ffsent.bash::https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.bash" + "ffsend.fish::https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.fish") # automatically set in CI, see: /.gitlab-ci.yml +sha256sums=('SKIP') arch=('x86_64') provides=('ffsend') conflicts=('ffsend') depends=('ca-certificates') -optdepends=('xclip: clipboard support') +optdepends=('xclip: clipboard support' + 'bash-completion: support auto completion for bash') package() { - install -Dm755 "$srcdir/ffsend-v${pkgver}" "$pkgdir/usr/bin/ffsend" + cd "${srcdir}" + + # Install Binary + install -Dm755 "ffsend" "$pkgdir/usr/bin/ffsend" + + # Install completions + install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" } diff --git a/pkg/aur/ffsend-git/PKGBUILD b/pkg/aur/ffsend-git/PKGBUILD index 8fcdcc1..0ab656a 100644 --- a/pkg/aur/ffsend-git/PKGBUILD +++ b/pkg/aur/ffsend-git/PKGBUILD @@ -17,7 +17,8 @@ provides=('ffsend') conflicts=('ffsend') depends=('ca-certificates') makedepends=('openssl>=1.0' 'rust>=1.32' 'cargo' 'cmake') -optdepends=('xclip: clipboard support') +optdepends=('xclip: clipboard support' + 'bash-completion: support auto completion for bash') build() { cd ffsend @@ -25,5 +26,13 @@ build() { } package() { - install -Dm755 "$srcdir/ffsend/target/release/ffsend" "$pkgdir/usr/bin/ffsend" + cd "${srcdir}/ffsend" + + # Install Binary + install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend" + + # Install completions + cd "./contrib/completions" + install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" } diff --git a/pkg/aur/ffsend/PKGBUILD b/pkg/aur/ffsend/PKGBUILD index 7dad64f..9b89f61 100644 --- a/pkg/aur/ffsend/PKGBUILD +++ b/pkg/aur/ffsend/PKGBUILD @@ -16,7 +16,8 @@ arch=('x86_64' 'i686') provides=('ffsend') depends=('ca-certificates') makedepends=('openssl>=1.0' 'rust>=1.32' 'cargo' 'cmake') -optdepends=('xclip: clipboard support') +optdepends=('xclip: clipboard support' + 'bash-completion: support auto completion for bash') build() { cd "ffsend-v$pkgver" @@ -24,5 +25,13 @@ build() { } package() { - install -Dm755 "$srcdir/ffsend-v$pkgver/target/release/ffsend" "$pkgdir/usr/bin/ffsend" + cd "${srcdir}/ffsend-v${pkgver}" + + # Install Binary + install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend" + + # Install completions + cd "./contrib/completions" + install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" } From 156d5db7659b9ebda7b4b8afd3f6f698f61941c4 Mon Sep 17 00:00:00 2001 From: timvisee Date: Tue, 2 Apr 2019 16:08:50 +0200 Subject: [PATCH 2/3] Use and cache versioned files for AUR, fix inconsistencies [ci skip] --- .gitlab-ci.yml | 8 ++++---- pkg/aur/ffsend-bin/PKGBUILD | 16 ++++++++-------- pkg/aur/ffsend-git/PKGBUILD | 6 +++--- pkg/aur/ffsend/PKGBUILD | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bfac1a6..d9ac882 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -271,16 +271,16 @@ package-aur: - echo "Determining SHA checksums for remote files..." - URL_BIN=https://github.com/timvisee/ffsend/releases/download/v$VERSION/ffsend-v$VERSION-linux-x64-static - URL_SOURCE=https://gitlab.com/timvisee/ffsend/-/archive/v$VERSION/ffsend-v$VERSION.tar.gz - - BASH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.bash" - - FISH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.fish" + - BASH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/v$VERSION/contrib/completions/ffsend.bash" + - FISH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/v$VERSION/contrib/completions/ffsend.fish" - 'echo "Selected binary URL: $URL_BIN"' - 'echo "Selected source URL: $URL_SOURCE"' - echo "Determining sha256sum for remote binary..." - 'SHA_BIN=$(curl -sSL "$URL_BIN" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sum: $SHA_BIN"' - - 'SHA_BASH_COMPLETION=$(curl -sSL "BASH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'SHA_BASH_COMPLETION=$(curl -sSL "$BASH_COMPLETION" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sums of bash completion: $SHA_BASH_COMPLETION"' - - 'SHA_FISH_COMPLETION=$(curl -sSL "FISH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'SHA_FISH_COMPLETION=$(curl -sSL "$FISH_COMPLETION" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sums of fish completion: $SHA_FISH_COMPLETION"' - echo "Determining sha256sum for remote source..." - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' diff --git a/pkg/aur/ffsend-bin/PKGBUILD b/pkg/aur/ffsend-bin/PKGBUILD index 45fbc4f..a7750ea 100644 --- a/pkg/aur/ffsend-bin/PKGBUILD +++ b/pkg/aur/ffsend-bin/PKGBUILD @@ -6,14 +6,14 @@ # - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-bin/PKGBUILD pkgname=ffsend-bin -pkgver=0.2.42 # automatically set in CI, see: /.gitlab-ci.yml +pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml pkgrel=1 pkgdesc="Easily and securely share files from the command line. A Firefox Send client." url="https://gitlab.com/timvisee/ffsend" license=('GPL3') -source=("ffsend-v${pkgver}::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static" - "ffsent.bash::https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.bash" - "ffsend.fish::https://raw.githubusercontent.com/timvisee/ffsend/master/contrib/completions/ffsend.fish") # automatically set in CI, see: /.gitlab-ci.yml +source=("ffsend-v$pkgver::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static" + "ffsend-v$pkgver.bash::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/contrib/completions/ffsend.bash" + "ffsend-v$pkgver.fish::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/contrib/completions/ffsend.fish") # automatically set in CI, see: /.gitlab-ci.yml sha256sums=('SKIP') arch=('x86_64') provides=('ffsend') @@ -23,12 +23,12 @@ optdepends=('xclip: clipboard support' 'bash-completion: support auto completion for bash') package() { - cd "${srcdir}" + cd "$srcdir" # Install Binary - install -Dm755 "ffsend" "$pkgdir/usr/bin/ffsend" + install -Dm755 "ffsend-v$pkgver" "$pkgdir/usr/bin/ffsend" # Install completions - install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" - install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" + install -Dm644 "ffsend-v$pkgver.bash" "$pkgver/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend-v$pkgver.fish" "$pkgver/usr/share/fish/vendor_completions.d/ffsend.fish" } diff --git a/pkg/aur/ffsend-git/PKGBUILD b/pkg/aur/ffsend-git/PKGBUILD index 0ab656a..5a6d3e2 100644 --- a/pkg/aur/ffsend-git/PKGBUILD +++ b/pkg/aur/ffsend-git/PKGBUILD @@ -26,13 +26,13 @@ build() { } package() { - cd "${srcdir}/ffsend" + cd "$srcdir/ffsend" # Install Binary install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend" # Install completions cd "./contrib/completions" - install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" - install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" + install -Dm644 "ffsend.bash" "$pkgver/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend.fish" "$pkgver/usr/share/fish/vendor_completions.d/ffsend.fish" } diff --git a/pkg/aur/ffsend/PKGBUILD b/pkg/aur/ffsend/PKGBUILD index 9b89f61..409d7a7 100644 --- a/pkg/aur/ffsend/PKGBUILD +++ b/pkg/aur/ffsend/PKGBUILD @@ -25,13 +25,13 @@ build() { } package() { - cd "${srcdir}/ffsend-v${pkgver}" + cd "$srcdir/ffsend-v$pkgver" # Install Binary install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend" # Install completions cd "./contrib/completions" - install -Dm644 "ffsend.bash" "${pkgver}/usr/share/bash-completion/completions/ffsend" - install -Dm644 "ffsend.fish" "${pkgver}/usr/share/fish/vendor_completions.d/ffsend.fish" + install -Dm644 "ffsend.bash" "$pkgver/usr/share/bash-completion/completions/ffsend" + install -Dm644 "ffsend.fish" "$pkgver/usr/share/fish/vendor_completions.d/ffsend.fish" } From ed75ed8227eab968bb88909255f3f965f184523a Mon Sep 17 00:00:00 2001 From: timvisee Date: Tue, 2 Apr 2019 16:21:26 +0200 Subject: [PATCH 3/3] Set proper completion file URLs for AUR --- .gitlab-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9ac882..da6f3c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -271,16 +271,16 @@ package-aur: - echo "Determining SHA checksums for remote files..." - URL_BIN=https://github.com/timvisee/ffsend/releases/download/v$VERSION/ffsend-v$VERSION-linux-x64-static - URL_SOURCE=https://gitlab.com/timvisee/ffsend/-/archive/v$VERSION/ffsend-v$VERSION.tar.gz - - BASH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/v$VERSION/contrib/completions/ffsend.bash" - - FISH_COMPLETION="https://raw.githubusercontent.com/timvisee/ffsend/v$VERSION/contrib/completions/ffsend.fish" + - URL_BASH_COMPLETION=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/contrib/completions/ffsend.bash + - URL_FISH_COMPLETION=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/contrib/completions/ffsend.fish - 'echo "Selected binary URL: $URL_BIN"' - 'echo "Selected source URL: $URL_SOURCE"' - echo "Determining sha256sum for remote binary..." - 'SHA_BIN=$(curl -sSL "$URL_BIN" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sum: $SHA_BIN"' - - 'SHA_BASH_COMPLETION=$(curl -sSL "$BASH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'SHA_BASH_COMPLETION=$(curl -sSL "$URL_BASH_COMPLETION" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sums of bash completion: $SHA_BASH_COMPLETION"' - - 'SHA_FISH_COMPLETION=$(curl -sSL "$FISH_COMPLETION" | sha256sum | cut -d" " -f1)' + - 'SHA_FISH_COMPLETION=$(curl -sSL "$URL_FISH_COMPLETION" | sha256sum | cut -d" " -f1)' - 'echo "Got sha256sums of fish completion: $SHA_FISH_COMPLETION"' - echo "Determining sha256sum for remote source..." - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' @@ -292,7 +292,9 @@ package-aur: - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend-bin/PKGBUILD - sed "s/^pkgver=.*\$/pkgver=$VERSION.$CI_COMMIT_SHORT_SHA/" -i ffsend-git/PKGBUILD - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD - - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_BIN | sed 's/\//\\\//g')\")/" -i ffsend-bin/PKGBUILD + - sed "s/\(\"ffsend-v\$pkgver::\).*\"/\1$URL_BIN\"/" -i ffsend-bin/PKGBUILD + - sed "s/\(\"ffsend-v\$pkgver.bash::\).*\"/\1$URL_BASH_COMPLETION\"/" -i ffsend-bin/PKGBUILD + - sed "s/\(\"ffsend-v\$pkgver.fish::\).*\"/\1$URL_FISH_COMPLETION\"/" -i ffsend-bin/PKGBUILD - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i ffsend/PKGBUILD - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_BIN' '$SHA_BASH_COMPLETION' '$SHA_FISH_COMPLETION')/" -i ffsend-bin/PKGBUILD