Most Python aports put replaces/provides
between `builddir` and `build()`.
Follow this convention, so they don't change
position when running `apkbuild-pypi recreate`.
Upon `apkbuild-cpan upgrade`, an aport without any
checkdepends would get a line like this inserted:
`checkdepends=""subpackages="$pkgname-doc"`
which would then be deleted by the substitution
that removes empty variables, so the net result
is an APKBUILD with the subpackages field removed.
Inserting a newline results in `checkdepends=""`
being a line all by itself, which then gets
correctly removed by the empty variables regex.
this is a preliminary attempt at fixing #10126, however, i think
the whole logic around recreating depends should be reviewed and
improved, as we may want to carry over all the depends from the
old APKBUILD, and not just the non-perl libs, as the old depends
may be compensating for something not declared in the META file.
the regex used to match options_comment in read_assignments_from_file
starts matching immediately after the closing double quote (it does
not remove the prefixing space), so without this change, a new space
is inserted by the template upon each `recreate`.
by not installing .packlist and perllocal.pod.
The call to find -delete has been removed as
the modifications to build() have covered
almost all cases, so deleting .packlist and
perllocal.pod manually is no longer necessary.
Also, increment template version from 3
to 4 to allow easy identification of
aports that have this change applied.
apkbuild-cpan.in: attempt to get a metaprefix if no metafiles exist
apkbuild-cpan.in: try harder to find a metaprefix
apkbuild-cpan.in: redefine builddir if not based on $_pkgreal
Since the changeset committed by psykose a while ago in commit
26118d4997 we now extract the
previous soname. We can pass this previous soname to `apk search -R`
to figure out how many packages are linked against this old soname.
I believe this to be useful for reviewing MRs since the checkapk
output will directly tell us if a contributor has missed rebuilds.
It will also inform us when no rebuilds are necessary, e.g. if the
SONAME was changed but no packages is linked against the library.
Example output for `main/libsodium`:
```
>>> Size difference for libsodium: 336 KiB -> 340 KiB
--- filelist-libsodium-old 2023-09-22 11:24:54.799204225 +0200
+++ filelist-libsodium-new 2023-09-22 11:24:54.799204225 +0200
@@ -1,5 +1,5 @@
.PKGINFO
usr/
usr/lib/
-usr/lib/libsodium.so.23
-usr/lib/libsodium.so.23.3.0
+usr/lib/libsodium.so.26
+usr/lib/libsodium.so.26.1.0
SODIFF:
-usr/lib/libsodium.so.23.3.0: SONAME libsodium.so.23
+usr/lib/libsodium.so.26.1.0: SONAME libsodium.so.26
REBUILDS:
*** 36 packages linked against 'libsodium.so.23' need to be rebuild!
```