diff options
author | Hauke Stieler | 2023-09-22 10:39:51 +0200 |
---|---|---|
committer | Hauke Stieler | 2023-09-22 10:39:51 +0200 |
commit | 6bc5782c358b889f55d804b4f49b1405fb6928ae (patch) | |
tree | 4f7d999d86bfbd1aae70685f62aa11d556182e1b | |
download | aur-maputnik-cli.tar.gz |
Initial setup for version 1.7.0
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rwxr-xr-x | checkupdate.sh | 52 | ||||
-rwxr-xr-x | update-srcinfo.sh | 4 |
4 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..aec9f2e1f405 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,13 @@ +pkgbase = maputnik-cli + pkgdesc = Maputnik-CLI for local development of Mapbox styles. + pkgver = 1.7.0 + pkgrel = 1 + url = https://github.com/maputnik/desktop + arch = any + license = MIT + makedepends = go>=1.19 + provides = maputnik-cli=${pkgver} + source = git+https://github.com/maputnik/desktop + sha256sums = SKIP + +pkgname = maputnik-cli diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e7449a9e2f5a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: Hauke Stieler <mail@hauke-stieler.de> + +pkgname=maputnik-cli +pkgver=1.7.0 +pkgrel=1 +pkgdesc="Maputnik-CLI for local development of Mapbox styles." +arch=('any') +url="https://github.com/maputnik/desktop" +license=('MIT') +depends=() +makedepends=('go>=1.19') +backup=() +conflicts=() +provides=('maputnik-cli=${pkgver}') + +# Desktop-Repo and Editor-Repo have different versions. This builds version $pkgver. +_desktopver=1.0.7 + +# Currently the latest tag has no go-module. TODO use tag-specifier with next desktop release: #tag=v${_desktopver}") +source=("git+https://github.com/maputnik/desktop") +sha256sums=('SKIP') + +build() { + cd ${srcdir} + + # Make go work + export GOPATH="$srcdir"/gopath + export GOBIN="$GOPATH"/bin + + # Go into repo folder + cd "desktop" + + # Build CLI tool. The actual editor (a web application) will be loaded automatically. + make +} + +package() { + cd "${srcdir}/desktop" + install -Dm755 bin/linux/maputnik "${pkgdir}"/usr/bin/maputnik +} diff --git a/checkupdate.sh b/checkupdate.sh new file mode 100755 index 000000000000..cdb6254a5c09 --- /dev/null +++ b/checkupdate.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# To get changes made somewhere else +git pull + +maxVersionDifference=20 + +scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$scriptdir" + +#if [[ -f STOP_AUTOMATIC_UPDATE ]]; then +# >&2 echo "Automatic updates are disabled via STOP_AUTOMATIC_UPDATE." +# exit 1 +#fi + +upstreamVersion="$(curl -s "https://josm.openstreetmap.de/latest")" + +if [[ ! $upstreamVersion =~ ^[0-9]{5}$ ]]; then + >&2 echo "Invalid upstream version $upstreamVersion." + exit 1 +fi + +pkgbuildVersion="$(grep -Po '(?<=pkgver=)\d+' PKGBUILD)" + +if [[ ! $pkgbuildVersion =~ ^[0-9]{5}$ ]]; then + >&2 echo "Invalid PKGBUILD version $pkgbuildVersion." + exit 1 +fi + +#if [[ $((upstreamVersion - pkgbuildVersion)) -gt $maxVersionDifference ]]; then +# >&2 echo "Update would exceed maxVersionDifference of $maxVersionDifference ($pkgbuildVersion->$upstreamVersion). Disabling further automatic updates." +# touch STOP_AUTOMATIC_UPDATE +# exit 1 +#fi + +if [[ $upstreamVersion -gt $pkgbuildVersion ]]; then + echo "Found new upstream version $upstreamVersion (was $pkgbuildVersion)." + + sed -r -i -e 's/(pkgver=)[0-9]+/\1'$upstreamVersion'/' PKGBUILD + sed -r -i -e 's/(pkgrel=)[0-9]+/\11/' PKGBUILD + + sed -r -i -e 's/(pkgver = )[0-9]+/\1'$upstreamVersion'/' .SRCINFO + sed -r -i -e 's/(pkgrel = )[0-9]+/\11/' .SRCINFO + sed -r -i -e 's/(josm=)[0-9]+/\1'$upstreamVersion'/' .SRCINFO + sed -r -i -e 's/(snapshot-)[0-9]+/\1'$upstreamVersion'/g' .SRCINFO + sed -r -i -e 's/(trunk#revision=)[0-9]+/\1'$upstreamVersion'/' .SRCINFO + + git commit --no-signoff PKGBUILD .SRCINFO -m "Automatic update ($pkgbuildVersion->$upstreamVersion)" + git push +else + echo "No new upstream version found (upstream $upstreamVersion, PKGBUILD $pkgbuildVersion)." +fi diff --git a/update-srcinfo.sh b/update-srcinfo.sh new file mode 100755 index 000000000000..68a604d4492a --- /dev/null +++ b/update-srcinfo.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Update .SRCINFO file +makepkg --printsrcinfo > .SRCINFO |