Simplify source.sh script
This commit is contained in:
@@ -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,7 +1,7 @@
|
||||
name: flex
|
||||
description: Tool for generating text-scanning programs
|
||||
version: 2.6.4
|
||||
revision: 2
|
||||
revision: 3
|
||||
url: https://github.com/westes/flex
|
||||
license: Custom
|
||||
architecture: any
|
||||
|
||||
@@ -29,8 +29,11 @@ check() {
|
||||
# This function is used to move the compiled files into the output directory
|
||||
package() {
|
||||
make DESTDIR="$BPM_OUTPUT" install
|
||||
|
||||
# Make symlinks
|
||||
ln -sv flex "$BPM_OUTPUT"/usr/bin/lex
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user