Update source.sh script and add check-version.sh script

This commit is contained in:
2025-09-13 21:05:04 +03:00
parent 49c8c25404
commit b8b5ff05ec
2 changed files with 24 additions and 1 deletions
+18
View File
@@ -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"
+6 -1
View File
@@ -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
}