blob: 7514fa40dddd6a49b2ae21d4490933102d5464e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
# The PKGBUILD for Maison.
# Maintainer: Matheus <matheusgwdl@protonmail.com>
# Contributor: Matheus <matheusgwdl@protonmail.com>
readonly _pkgname="maison"
pkgname="python-maison"
pkgver="2.0.0"
pkgrel="1"
pkgdesc="Read settings from config files."
arch=("any")
url="https://github.com/dbatten5/${_pkgname}"
license=("MIT")
depends=("python" "python-click" "python-toml")
makedepends=("python-build" "python-installer" "python-poetry")
checkdepends=("python-coverage" "python-pydantic" "python-pytest" "python-six")
source=("${pkgname}-v${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=("9274fc89083eec10f933a6f0e40556e18fea0ef11c13cb10338a90070b4042d87b0250a9c112a059644f6db1da4c5bbd956e3efa0cd9bd1ac1d2059f1a659eb0")
build()
{
cd "${srcdir}"/"${_pkgname}"-"${pkgver}"/ || exit 1
# -n cannot be used as Python files will be missing.
python -m build -w
}
check()
{
cd "${srcdir}"/"${_pkgname}"-"${pkgver}"/ || exit 1
poetry install
# shellcheck disable=SC1091
source ./.venv/bin/activate
pytest
deactivate
}
package()
{
# Assure that the directories exist.
mkdir -p "${pkgdir}"/usr/share/doc/"${pkgname}"/
mkdir -p "${pkgdir}"/usr/share/licenses/"${pkgname}"/
# Install the software.
cd "${srcdir}"/"${_pkgname}"-"${pkgver}"/ || exit 1
python -m installer -d "${pkgdir}" "${srcdir}"/"${_pkgname}"-"${pkgver}"/dist/*.whl
# Install the documentation.
install -Dm644 "${srcdir}"/"${_pkgname}"-"${pkgver}"/README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/
cp -r "${srcdir}"/"${_pkgname}"-"${pkgver}"/docs/* "${pkgdir}"/usr/share/doc/"${pkgname}"/
find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type d -exec chmod 755 {} +
find "${pkgdir}"/usr/share/doc/"${pkgname}"/ -type f -exec chmod 644 {} +
# Install the license.
install -Dm644 "${srcdir}"/"${_pkgname}"-"${pkgver}"/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/
}
|