apkbuild-cpan.in: move .pod files to the -doc subpackage

this `doc()` function is copied from main/perl/APKBUILD
This commit is contained in:
Celeste 2024-01-14 07:47:54 +00:00 committed by Timothy Legge
parent 3336955a4a
commit 41a36bca95
1 changed files with 14 additions and 1 deletions

View File

@ -259,8 +259,9 @@ sub prepare_tree {
sub update_functions {
my $apkbuild = read_apkbuild;
my $pkgver = $apkbuild->{'pkgver'};
my $metaprefix =
"src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/";
"src/" . $apkbuild->{'_pkgreal'} . "-" . $pkgver . "/";
my $build_func;
my $check_func;
my $package_func;
@ -311,6 +312,18 @@ check() {
EOF
}
if ( length(`find src/*$pkgver/lib -name '*.pod'`) ) {
$package_func .= <<'EOF';
doc() {
local file; find "$pkgdir" -name "*.pod" | while read -r file; do
amove "${file#"$pkgdir"}"
done
default_doc
}
EOF
}
$text =~ s/^build\(\) \{.*?^\}\n/$build_func/smg
or die "Can't replace build function APKBUILD";
$text =~ s/^package\(\) \{.*?^\}\n/$package_func/smg