diff --git a/check-version.sh b/check-version.sh index 1accd29..07458f8 100644 --- a/check-version.sh +++ b/check-version.sh @@ -1,8 +1,11 @@ #!/bin/bash -URL="https://www.gnu.org/software/m4/" +URL="ftp://ftp.gnu.org/gnu/m4/" -# Get version number from tag name -VERSION=$(curl -s -L "$URL" | grep 'The latest stable version is ' | grep -o -E '([0-9]*\.[0-9]*)\.[0-9]*') +# Get version number from FTP server +VERSION=$(curl -s --list-only "$URL" | grep -E '^m4-[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})?.tar.xz$' | cut -d '-' -f2 | sort -V | tail -n1) + +# Remove '.tar.gz' suffix from VERSION variable +VERSION=${VERSION//.tar.xz/} echo "$VERSION" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..23f6b00 --- /dev/null +++ b/info.yml @@ -0,0 +1,21 @@ +name: m4 +description: GNU macro processor +version: 1.4.21 +revision: 1 +url: https://www.gnu.org/software/m4/ +license: GPL3 +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - glibc +make_depends: + - gperf + - help2man + - python3 +downloads: + - url: https://ftpmirror.gnu.org/gnu/m4/m4-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: f25c6ab51548a73a75558742fb031e0625d6485fe5f9155949d6486a2408ab66 diff --git a/pkg.info b/pkg.info deleted file mode 100644 index cc75527..0000000 --- a/pkg.info +++ /dev/null @@ -1,9 +0,0 @@ -name: m4 -description: GNU macro processor -version: 1.4.20 -url: https://www.gnu.org/software/m4/ -license: GPL3 -architecture: any -depends: ["bash","glibc"] -make_depends: ["bash","binutils","coreutils","gcc","glibc","grep","make","sed","texinfo"] -type: source diff --git a/source.sh b/recipe.sh similarity index 61% rename from source.sh rename to recipe.sh index 090af20..0df0d49 100644 --- a/source.sh +++ b/recipe.sh @@ -1,17 +1,7 @@ -# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://ftpmirror.gnu.org/gnu/m4/m4-${BPM_PKG_VERSION}.tar.xz" -FILENAME="${DOWNLOAD##*/}" - -# The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location -prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" -} - # The build function is executed in the source directory # This function is used to compile the source code build() { @@ -29,6 +19,7 @@ check() { # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install - mkdir -p "$BPM_OUTPUT"/usr/share/licenses/M4 - cp COPYING "$BPM_OUTPUT"/usr/share/licenses/M4/COPYING + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/m4/COPYING }