summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aad697055451797d57d88441036a580c487b6aed (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer: Donien <donien.96@hotmail.com>

pkgname="pulp-cli"
pkgver="0.39.1"
pkgrel=1
epoch=0
pkgdesc="Command line interface to talk to the Pulp 3 REST API"
arch=(
    "any"
)
url="https://github.com/pulp/pulp-cli"
license=("GPL-2.0-or-later")
groups=()
makedepends=(
    "python-build"
    "python-installer"
    "python-setuptools"

    "python-tomli-w"
    "python-schema"
    "python-multidict"
    "python-requests"
    "python-click"

    "python-pulp-glue"
)
depends=(
    "python"
    "python-tomli-w"
    "python-schema"
    "python-multidict"

    "python-packaging"
    "python-yaml"
    "python-requests"
    "python-click"

    "python-pulp-glue"
)
optdepends=(
    "python-pygments"
)
provides=(
    "pulp-cli"
    "python-pulp-cli"
)
conflicts=()
replaces=()
backup=()
options=()
changelog="pulp-cli.changelog"
source=(
    "https://github.com/pulp/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz"
)
noextract=()
sha256sums=(
    "c43e8dad6e0664f814cd066fdbc81d34d78870d67c3e113c87a12ef716269418"
)


prepare() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    # Allow for higher version of setuptools - pulp-cli
    sed -i '/requires =.*setuptools/s/<[0-9]\+//' pyproject.toml

    # Allow for higher version of setuptools - pulp-glue
    sed -i '/requires =.*setuptools/s/<[0-9]\+//' pulp-glue/pyproject.toml
}


build() {
    # Build pulp-cli
    cd "${srcdir}/${pkgname}-${pkgver}"
    python -m build --wheel \
        --no-isolation \
        #--skip-dependency-check
}

package() {
    cd "${pkgname}-${pkgver}"
    python -m installer --destdir="${pkgdir}" dist/*.whl

    install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    for shell_path in \
            bash:/usr/share/bash-completion/completions/pulp \
            fish:/usr/share/fish/completions/pulp.fish \
            zsh:/usr/share/zsh/site-functions/_pulp
    do
        shell="${shell_path%%:*}"
        path="${shell_path#*:}"
        dir="${path%/*}"

        install -m 755 -d "${pkgdir}${dir}"

        PYTHONPATH="${pkgdir}/usr/lib/python3.14/site-packages/" \
        _PULP_COMPLETE="${shell}_source" \
        python -c \
        "import sys; sys.argv = ['pulp']; from pulp_cli import main; sys.exit(main())" \
        > "${pkgdir}${path}"
    done

}