diff --git a/check-version.sh b/check-version.sh index ae1e985..0e3146e 100644 --- a/check-version.sh +++ b/check-version.sh @@ -4,7 +4,7 @@ REPO="pypa/setuptools" # Get tag name using Github Rest API -TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases | jq -r '.[].tag_name' | sort -V | tail -n1) # Trim 'v' character in TAG_NAME variable VERSION=$(echo "$TAG_NAME" | tr -d 'v') diff --git a/pkg.info b/pkg.info index e619e27..0acee44 100644 --- a/pkg.info +++ b/pkg.info @@ -9,3 +9,8 @@ output_architecture: any type: source depends: - python3 +downloads: + - url: https://pypi.org/packages/source/s/setuptools/setuptools-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c diff --git a/source.sh b/source.sh index 746ec64..2742f1a 100644 --- a/source.sh +++ b/source.sh @@ -2,16 +2,6 @@ # 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://pypi.org/packages/source/s/setuptools/setuptools-${BPM_PKG_VERSION}.tar.gz" -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() {