Update source.sh script and add check-version.sh script
This commit is contained in:
@@ -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"
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user