From c7e3c88a08aa8bc5f73ef54fdaa339fc2f5bcd22 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 1 Oct 2025 15:34:20 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 9 +++++++++ pkg.info | 18 ++++++++++++++++++ source.sh | 19 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..834055f --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Sourceforge project +REPO="docutils" + +# Get version using best_release.json +VERSION=$(curl -s -L https://sourceforge.net/projects/"$REPO"/best_release.json | jq '.platform_releases.linux.filename' | cut -d'/' -f3) + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..9ceb351 --- /dev/null +++ b/pkg.info @@ -0,0 +1,18 @@ +name: python-docutils +description: Open-source python text processing system for processing plaintext documentation into other formats +version: 0.22.2 +revision: 1 +license: Public-Domain,BSD-2-Clause,GPL3-or-later,Python-2.0 +architecture: any +type: source +depends: + - python3 +make_depends: + - python-build + - python-flit-core + - python-installer +downloads: + - url: https://downloads.sourceforge.net/project/docutils/docutils/${BPM_PKG_VERSION}/docutils-${BPM_PKG_VERSION}.tar.gz + extract_to_bpm_source: true + extract_strip_components: 1 + checksum: 9fdb771707c8784c8f2728b67cb2c691305933d68137ef95a75db5f4dfbc213d diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..fa75744 --- /dev/null +++ b/source.sh @@ -0,0 +1,19 @@ +# This is the source.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 + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + python3 -m build --wheel --no-isolation . +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + python3 -m installer --destdir="$BPM_OUTPUT" dist/*.whl + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING.rst "$BPM_OUTPUT"/usr/share/licenses/python-docutils/COPYING.rst + install -Dm644 "$BPM_SOURCE"/licenses/{*.rst,*.txt} -t "$BPM_OUTPUT"/usr/share/licenses/python-docutils/ +}