From b8b5ff05eccf08213126ad1c84f4895f67f03cf4 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 13 Sep 2025 21:05:04 +0300 Subject: [PATCH] Update source.sh script and add check-version.sh script --- check-version.sh | 18 ++++++++++++++++++ source.sh | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 check-version.sh diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..cd71858 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Gitlab repository +REPO="xdg/startup-notification" + +# Replace slash with URL encoded representation +REPO=$(echo "$REPO" | sed 's|/|%2F|g') + +# Get tag name using Gitlab Rest API +TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[0].name') + +# Trim prefix +VERSION=${TAG_NAME//STARTUP_NOTIFICATION_/} + +# Replace '_' with '.' +VERSION=${VERSION//_/.} + +echo "$VERSION" diff --git a/source.sh b/source.sh index 0abe188..8aad48a 100644 --- a/source.sh +++ b/source.sh @@ -10,12 +10,14 @@ FILENAME="${DOWNLOAD##*/}" prepare() { wget "$DOWNLOAD" tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + autoreconf -fi } # The build function is executed in the source directory # This function is used to compile the source code build() { - autoreconf -fi ./configure --prefix=/usr --disable-static make } @@ -24,7 +26,10 @@ build() { # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install + + # Install documentation install -Dm644 doc/startup-notification.txt "$BPM_OUTPUT"/usr/share/doc/startup-notification/startup-notification.txt + # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/startup-notification/COPYING }