From eacc32a3103b80e70475f5f38845b2970a4b413a Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Mon, 9 Mar 2026 21:41:21 +0100 Subject: [PATCH] first commit --- .SRCINFO | 15 +++++++++++++++ .gitignore | 4 ++++ LICENSE | 21 +++++++++++++++++++++ PKGBUILD | 20 ++++++++++++++++++++ README.md | 2 ++ push.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 112 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 PKGBUILD create mode 100644 README.md create mode 100755 push.sh diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..196a00c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = tsparams + pkgdesc = A simple tool to extract and display Tailscale parameters + pkgver = 1.0.0 + pkgrel = 1 + url = https://git.bjphoster.com/source/tsparams + arch = any + license = GPL3 + depends = python + depends = tailscale + source = https://git.bjphoster.com/source/tsparams/archive/1.0.0.tar.gz + md5sums = b215f07928ceb4399b51ab8107d275cc + sha1sums = 316becbc9b10d004cfc89e3eeb3e2f3498b70035 + sha256sums = 2cbf10ffca2f0adf21daff04bfb1cde401b2f9e713863a23b01aa6bddf1ff62d + +pkgname = tsparams diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..deccadf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# downloaded tarbals +*.tar.gz +# built packages +*.pkg.tar.zst diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..04f030a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Bryan Joshua Pedini + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..4ae49e1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,20 @@ +# Maintainer: Bryan Joshua Pedini + +pkgname="tsparams" +pkgver="1.0.0" +pkgrel="1" +pkgdesc="A simple tool to extract and display Tailscale parameters" +url="https://git.bjphoster.com/source/${pkgname}" +arch=("any") +license=("GPL3") +depends=("python" "tailscale") +source=("https://git.bjphoster.com/source/${pkgname}/archive/${pkgver}.tar.gz") + +sha1sums=("316becbc9b10d004cfc89e3eeb3e2f3498b70035") +sha256sums=("2cbf10ffca2f0adf21daff04bfb1cde401b2f9e713863a23b01aa6bddf1ff62d") +md5sums=("b215f07928ceb4399b51ab8107d275cc") + +package() { + install -Dm644 "${srcdir}/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm755 "${srcdir}/${pkgname}/tsparams.py" "${pkgdir}/usr/bin/${pkgname}" +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..4d873ef --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# tsparams +PKGBUILD script for Arch Linux for `tsparams` package diff --git a/push.sh b/push.sh new file mode 100755 index 0000000..a45ccaa --- /dev/null +++ b/push.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# Get version +oldver=$(grep "pkgver=" PKGBUILD | sed 's/pkgver="//;s/"//') +if [ $# -eq 1 ]; then + pkgver="${1}" +else + echo "Old version: ${oldver}" + read -p "New version: " pkgver +fi +# Check version +if [ "${pkgver}" = "${oldver}" ]; then + echo >/dev/stderr "Error: same (old) version specified - update aborted" + exit 1 +fi + +# Get variables from PKGBUILD +url=$(grep "source=" PKGBUILD | sed 's/source=("//;s/")//') +pkgname=$(grep "pkgname=" PKGBUILD | sed 's/pkgname="//;s/"//') +pkgrel=$(grep "pkgrel=" PKGBUILD | sed 's/pkgrel="//;s/"//') +aur_url="ssh://aur@aur.archlinux.org/${pkgname}.git" + +# Perform variable substitution +archive_url="${url//\$\{pkgname\}/$pkgname}" +archive_url="${archive_url//\$\{pkgver\}/$pkgver}" + +# Download archive +wget -O ${pkgname}.tar.gz "${archive_url}" +# Calculate checksums +sha1sum=$(sha1sum ${pkgname}.tar.gz | awk '{print $1}') +sha256sum=$(sha256sum ${pkgname}.tar.gz | awk '{print $1}') +md5sum=$(md5sum ${pkgname}.tar.gz | awk '{print $1}') +# Yoink the archive - unnecessary anymore +rm -f ${pkgname}.tar.gz + +# Update PKGBUILD with new values +sed -i -E "s/^pkgver=\"[^\"]+\"/pkgver=\"$pkgver\"/" PKGBUILD +sed -i -E "s/^sha1sums=\(\"[^\"]+\"\)/sha1sums=(\"$sha1sum\")/" PKGBUILD +sed -i -E "s/^sha256sums=\(\"[^\"]+\"\)/sha256sums=(\"$sha256sum\")/" PKGBUILD +sed -i -E "s/^md5sums=\(\"[^\"]+\"\)/md5sums=(\"$md5sum\")/" PKGBUILD + +# Update .SRCINFO +makepkg --printsrcinfo > .SRCINFO + +# In case of fire, git commit, git push, leave building +git add . +git commit -m "Updated ${pkgname} to ${pkgver}-${pkgrel}" +git remote add aur ${aur_url} +git push origin main +git push aur main:master