summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiří Kuchyňka (Anty)2021-03-03 20:50:10 +0100
committerJiří Kuchyňka (Anty)2021-03-03 20:50:10 +0100
commitd4c5c26a81c7bf8e17b30b90a4cec173c2fe1751 (patch)
tree56fafaa43a6572c9258e3d08013e61bc91fad395
parentcd4492e54a193ae034005de89819002c19e067b1 (diff)
downloadaur-d4c5c26a81c7bf8e17b30b90a4cec173c2fe1751.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 cc0fda1c5c7..49b3b2d30e0 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='checksum'
+_upstreamver='v1.1.1'
+_upstreamver_regex='^v[0-9]+\.[0-9]+\.[0-9]+$'
+_source_type='github-releases'
+_repo='westberliner/checksum'
+
+
pkgdesc='Plugin for Nextcloud to create hashes of files'
pkgname=('nextcloud-app-checksum')
-_appname='checksum'
-pkgver='1.1.1'
+pkgver="${_upstreamver:1}"
pkgrel=1
arch=('any')
license=('GPL3')
-_repo="westberliner/checksum"
url="https://github.com/${_repo}"
makedepends=()
depends=('nextcloud')
options=('!strip')
-source=("${_appname}-v${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_appname}.tar.gz")
+source=("${_nextcloud_appname}-v${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_nextcloud_appname}.tar.gz")
sha512sums=('919e8d6a40264372513229fdd3f227c9c1c75c536c427c60af537817a816b3feb13eb5c48c3663f4582f33d9d33587b940b313e74afab6d49ec5dd406889d881')
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 71479f11658..00000000000
--- 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};"