summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiří Kuchyňka (Anty)2021-03-03 20:44:41 +0100
committerJiří Kuchyňka (Anty)2021-03-03 20:44:41 +0100
commit4ee3b93147d34c1e17e06825618c2e7610992fdd (patch)
tree1d46febe9d00801201443333056f05686a25c0d1
parentb713543c49359b84081ff5f4929532efa019c033 (diff)
downloadaur-4ee3b93147d34c1e17e06825618c2e7610992fdd.tar.gz
add updaurpkg update checking helper;
-rw-r--r--PKGBUILD17
-rwxr-xr-xupdate.sh36
2 files changed, 12 insertions, 41 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9983c33f5e56..fda2b1d0d463 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,28 @@
# Maintainer: Anty0 <anty150 at gmail dot com>
+
+# Helper variables for updaurpkg (https://aur.archlinux.org/packages/updaurpkg-git)
+_nextcloud_appname='integration_google'
+_upstreamver='v0.1.10'
+_upstreamver_regex='^v[0-9]+\.[0-9]+\.[0-9]+$'
+_source_type='github-releases'
+_repo='nextcloud/integration_google'
+
+
pkgdesc='Google integration in Nextcloud'
pkgname=('nextcloud-app-integration-google')
-_appname='integration_google'
-pkgver='0.1.10'
+pkgver="${_upstreamver:1}"
pkgrel=1
arch=('any')
license=('AGPL3')
-_repo="nextcloud/integration_google"
url="https://github.com/${_repo}"
makedepends=()
depends=('nextcloud')
options=('!strip')
-source=("${_appname}-v${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_appname}-${pkgver}.tar.gz")
+source=("${_nextcloud_appname}-v${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_nextcloud_appname}-${pkgver}.tar.gz")
sha512sums=('f697fec89c3a1b4d30001307c23b22127b3301542c32d9c874e6256af5b518085685d69cd996da99c3d42d11d44197f18b1c1df240bf6d57c11e668da406255f')
package() {
install -d "${pkgdir}/usr/share/webapps/nextcloud/apps"
- cp -a "${srcdir}/${_appname}" "${pkgdir}/usr/share/webapps/nextcloud/apps/${_appname}"
+ cp -a "${srcdir}/${_nextcloud_appname}" "${pkgdir}/usr/share/webapps/nextcloud/apps/${_nextcloud_appname}"
}
diff --git a/update.sh b/update.sh
deleted file mode 100755
index 71479f11658a..000000000000
--- a/update.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-set -e
-
-SCRIPT_DIR="$(dirname "$0")"
-cd "$SCRIPT_DIR"
-
-source ./PKGBUILD
-
-#VERSION="$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${_repo}/tags" 2>/dev/null | jq -r '.[0].name')"
-#VERSION="$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${_repo}/releases/latest" 2>/dev/null | jq -r '.tag_name')"
-#VERSION="$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${_repo}/tags" 2>/dev/null | jq -r '.[0].name' | cut -c 2-)"
-VERSION="$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${_repo}/releases/latest" 2>/dev/null | jq -r '.tag_name' | cut -c 2-)"
-
-if [ "${pkgver}" = "${VERSION}" ]; then
- echo "${pkgname}: No updates"
- exit
-fi
-
-echo "${pkgname}: ${pkgver} -> ${VERSION}"
-
-if [ "$1" = "--check" ]; then
- exit
-fi
-
-# Update
-sed -i -e "s/^pkgver=.*\$/pkgver='${VERSION}'/" -e "s/^pkgrel=.*\$/pkgrel=1/" PKGBUILD
-updpkgsums
-makepkg --printsrcinfo > .SRCINFO
-
-# Build and install
-makepkg -sicr
-
-# Commit
-git add .
-git commit -m "update to ${VERSION};"