Simplify source.sh script

This commit is contained in:
2025-05-10 16:23:16 +03:00
parent 56f061c272
commit a7dbcddf11
3 changed files with 21 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Github repository
REPO="westes/flex"
# Get tag name using Github Rest API
TAG_NAME=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name')
# Get version number from tag name
VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev)
# Trim 'v' character in VERSION variable
VERSION=$(echo "$VERSION" | tr -d 'v')
echo "$VERSION"
+1 -1
View File
@@ -1,7 +1,7 @@
name: flex name: flex
description: Tool for generating text-scanning programs description: Tool for generating text-scanning programs
version: 2.6.4 version: 2.6.4
revision: 2 revision: 3
url: https://github.com/westes/flex url: https://github.com/westes/flex
license: Custom license: Custom
architecture: any architecture: any
+5 -2
View File
@@ -29,8 +29,11 @@ check() {
# This function is used to move the compiled files into the output directory # This function is used to move the compiled files into the output directory
package() { package() {
make DESTDIR="$BPM_OUTPUT" install make DESTDIR="$BPM_OUTPUT" install
# Make symlinks
ln -sv flex "$BPM_OUTPUT"/usr/bin/lex ln -sv flex "$BPM_OUTPUT"/usr/bin/lex
ln -sv flex.1 "$BPM_OUTPUT"/usr/share/man/man1/lex.1 ln -sv flex.1 "$BPM_OUTPUT"/usr/share/man/man1/lex.1
mkdir -p "$BPM_OUTPUT"/usr/share/licenses/flex
cp COPYING "$BPM_OUTPUT"/usr/share/licenses/flex # Install package license
install -Dm755 COPYING "$BPM_OUTPUT"/usr/share/licenses/flex/COPYING
} }