add script/pkg-arch

This commit is contained in:
Hailey Somerville 2024-03-08 20:56:51 +11:00
parent bccec5c436
commit 86702dbc57
3 changed files with 34 additions and 4 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/dist
/target
/bark.toml

View file

@ -1,5 +1,5 @@
# Maintainer: Hailey Somerville <bark@hails.org>
pkgname=bark-git
pkgname=bark
pkgdesc="Synchronised multicast audio streaming"
license=("AGPL3")
url="https://github.com/haileys/bark"
@ -7,9 +7,23 @@ pkgver=0
pkgrel=1
pkgver() {
local number="$(git -C "$srcdir" rev-list --count HEAD)"
local commit="$(git -C "$srcdir" rev-parse --short=7 HEAD)"
echo "r${number}.g${commit}"
local ver
# get version string from git
ver="$(git describe --tags HEAD)"
# strip leading 'v'
[[ "$ver" == v* ]] && ver="${ver:1}"
# transform hyphens to underscores
ver="$(tr '-' '_' <<<"$ver")"
echo "'$ver'" >&2
echo "$ver"
# local number="$(git -C "$srcdir" rev-list --count HEAD)"
# local commit="$(git -C "$srcdir" rev-parse --short=7 HEAD)"
# echo "r${number}.g${commit}"
}
depends=(

15
script/pkg-arch Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/../pkg/arch"
# reset
rm -rf pkg
rm *.pkg.tar.zst
# build
makepkg --nodeps --force --clean
# copy built package into dist dir in the repo root
mkdir -p ../../dist
cp *.pkg.tar.zst ../../dist/