apkbuild-pypi.in: change position of replaces/provides in template

Most Python aports put replaces/provides
between `builddir` and `build()`.

Follow this convention, so they don't change
position when running `apkbuild-pypi recreate`.
This commit is contained in:
Celeste 2023-12-16 04:10:09 +00:00
parent fc863565f1
commit d05bc1a4af

View File

@ -23,8 +23,6 @@ _pkgreal=[% pkgreal %]
pkgver=[% pkgver %]
pkgrel=[% pkgrel %]
pkgdesc="[% pkgdesc %]"
provides="[% provides %]"
replaces="[% replaces %]"
url="https://pypi.org/project/[% pkgreal %]/"
arch="noarch"
license="[% license %]"
@ -34,7 +32,7 @@ checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="[% source %]"
builddir="$srcdir/$_pkgreal-$pkgver"
[% compatibility %]
build() {
gpep517 build-wheel \
--wheel-dir .dist \
@ -159,9 +157,12 @@ sub write_apkbuild {
source => get_source($distdata),
license => map_license($distdata->{info}{license}),
pkgdesc => $distdata->{info}{summary},
provides => ($provides or ''),
replaces => ($replaces or ''),
);
$repl{compatibility} .= "\nreplaces=\"$replaces\"" if $replaces;
$repl{compatibility} .= "\nprovides=\"$provides\"" if $provides;
$repl{compatibility} .= "\n" if $replaces or $provides;
$repl{source} =~ s/-$repl{pkgver}/-\$pkgver/g;
$template =~ s/\[% (.*?) %\]/$repl{$1}/g;