abuild: allow uncompressed manpages

Many packages installs only uncompressed manpages, but users may want
to keep APKBUILDs simple. So allowing uncompressed manpages.
This commit is contained in:
Leonid Pliushch 2018-11-19 14:13:24 +02:00 committed by Fredrik Fornwall
parent 2ecc0e95f2
commit d0216b11d7

View File

@ -1,5 +1,5 @@
--- abuild-3.2.0/abuild.in 2018-06-22 10:24:10.000000000 +0300 --- abuild-3.2.0/abuild.in 2018-06-22 10:24:10.000000000 +0300
+++ abuild-3.2.0.mod/abuild.in 2018-11-19 00:34:07.861614858 +0200 +++ abuild-3.2.0.mod/abuild.in 2018-11-19 03:27:15.434597940 +0200
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-#!/bin/ash -e -#!/bin/ash -e
+#!/bin/bash -e +#!/bin/bash -e
@ -77,7 +77,7 @@
return 1 return 1
fi fi
# look for /etc/init.d and /etc/conf.d # look for /etc/init.d and /etc/conf.d
@@ -682,18 +658,18 @@ @@ -682,22 +658,15 @@
&& ! is_openrc_pkg "$name"; then && ! is_openrc_pkg "$name"; then
warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc" warning "Found OpenRC directory (/etc/conf.d or /etc/init.d) but name doesn't end with -openrc"
fi fi
@ -95,15 +95,18 @@
+ if [ -e "$dir"/@TERMUX_PREFIX@/share/man ]; then + if [ -e "$dir"/@TERMUX_PREFIX@/share/man ]; then
if ! is_doc_pkg "$name"; then if ! is_doc_pkg "$name"; then
- warning "Found /usr/share/man but package name doesn't end with -doc" - warning "Found /usr/share/man but package name doesn't end with -doc"
- fi
- # check for uncompressed man pages
- i=$(find "$dir"/usr/share/man -name '*.[0-8]' -type f | sed "s|^$dir|\t|")
- if [ -n "$i" ]; then
- error "Found uncompressed man pages:"
- echo "$i"
- return 1
+ warning "Found @TERMUX_PREFIX@/share/man but package name doesn't end with -doc" + warning "Found @TERMUX_PREFIX@/share/man but package name doesn't end with -doc"
fi fi
# check for uncompressed man pages fi
- i=$(find "$dir"/usr/share/man -name '*.[0-8]' -type f | sed "s|^$dir|\t|") # check directory permissions
+ i=$(find "$dir"/@TERMUX_PREFIX@/share/man -name '*.[0-8]' -type f | sed "s|^$dir|\t|") @@ -758,9 +727,9 @@
if [ -n "$i" ]; then
error "Found uncompressed man pages:"
echo "$i"
@@ -758,9 +734,9 @@
&& postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1 && postcheck "$pkgbasedir/$subpkgname" "$subpkgname" ) || return 1
done done
postcheck "$pkgdir" "$pkgname" || return 1 postcheck "$pkgdir" "$pkgname" || return 1
@ -116,7 +119,7 @@
warning2 "Maybe add \$pkgname-lang to subpackages?" warning2 "Maybe add \$pkgname-lang to subpackages?"
fi fi
} }
@@ -770,7 +746,7 @@ @@ -770,7 +739,7 @@
install_if="$pkgname=$pkgver-r$pkgrel lang" install_if="$pkgname=$pkgver-r$pkgrel lang"
local dir local dir
@ -125,7 +128,7 @@
mkdir -p "$subpkgdir"/${dir%/*} mkdir -p "$subpkgdir"/${dir%/*}
mv "$pkgdir"/"$dir" "$subpkgdir"/"$dir" || return 1 mv "$pkgdir"/"$dir" "$subpkgdir"/"$dir" || return 1
done done
@@ -789,7 +765,7 @@ @@ -789,7 +758,7 @@
install_if="$pkgname=$pkgver-r$pkgrel lang-$lang" install_if="$pkgname=$pkgver-r$pkgrel lang-$lang"
local dir local dir
@ -134,7 +137,7 @@
mkdir -p "$subpkgdir"/$dir mkdir -p "$subpkgdir"/$dir
mv "$pkgdir"/$dir/$lang* \ mv "$pkgdir"/$dir/$lang* \
"$subpkgdir"/$dir/ \ "$subpkgdir"/$dir/ \
@@ -844,7 +820,7 @@ @@ -844,7 +813,7 @@
check_license() { check_license() {
local ret=0 local ret=0
@ -143,7 +146,7 @@
local exclude="AND OR WITH" local exclude="AND OR WITH"
if options_has "!spdx" || ! [ -f "$license_list" ]; then if options_has "!spdx" || ! [ -f "$license_list" ]; then
return 0 return 0
@@ -933,7 +909,7 @@ @@ -933,7 +902,7 @@
echo "# Generated by $(basename $0) $program_version" >"$pkginfo" echo "# Generated by $(basename $0) $program_version" >"$pkginfo"
if [ -n "$FAKEROOTKEY" ]; then if [ -n "$FAKEROOTKEY" ]; then
@ -152,7 +155,7 @@
fi fi
echo "# $(date -u)" >> "$pkginfo" echo "# $(date -u)" >> "$pkginfo"
cat >> "$pkginfo" <<-EOF cat >> "$pkginfo" <<-EOF
@@ -953,9 +929,9 @@ @@ -953,9 +922,9 @@
for i in $install $triggers; do for i in $install $triggers; do
local s=${i%=*} local s=${i%=*}
[ "$name" != "${s%.*}" ] && continue [ "$name" != "${s%.*}" ] && continue
@ -165,7 +168,7 @@
break break
fi fi
done done
@@ -1025,8 +1001,8 @@ @@ -1025,8 +994,8 @@
scanelf --quiet --recursive --rpath "$dir" \ scanelf --quiet --recursive --rpath "$dir" \
| sed -e 's/[[:space:]].*//' -e 's/:/\n/' | sort -u \ | sed -e 's/[[:space:]].*//' -e 's/:/\n/' | sort -u \
>"$controldir"/.rpaths >"$controldir"/.rpaths
@ -176,7 +179,7 @@
fi fi
if grep '^/home/' "$controldir"/.rpaths; then if grep '^/home/' "$controldir"/.rpaths; then
error "Has /home/... in rpath" error "Has /home/... in rpath"
@@ -1052,12 +1028,12 @@ @@ -1052,12 +1021,12 @@
local dir="${subpkgdir:-$pkgdir}" local dir="${subpkgdir:-$pkgdir}"
options_has "!tracedeps" && return 0 options_has "!tracedeps" && return 0
cd "$dir" || return 1 cd "$dir" || return 1
@ -191,7 +194,7 @@
--modversion ${f%.pc}) --modversion ${f%.pc})
echo "${f%.pc}=${v:-0}" >> "$controldir"/.provides-pc echo "${f%.pc}=${v:-0}" >> "$controldir"/.provides-pc
done done
@@ -1147,12 +1123,12 @@ @@ -1147,12 +1116,12 @@
return 1 return 1
} }
@ -206,7 +209,7 @@
shift shift
done done
return 0 return 0
@@ -1185,8 +1161,8 @@ @@ -1185,8 +1154,8 @@
esac esac
msg "Tracing dependencies..." msg "Tracing dependencies..."
@ -217,7 +220,7 @@
&& ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then && ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then
autodeps="$autodeps pkgconfig" autodeps="$autodeps pkgconfig"
fi fi
@@ -1244,7 +1220,7 @@ @@ -1244,7 +1213,7 @@
autodeps="$autodeps pc:$i" autodeps="$autodeps pc:$i"
else else
warning "Could not find any provider for pc:$i" warning "Could not find any provider for pc:$i"
@ -226,7 +229,7 @@
if [ -e "$pcfile" ]; then if [ -e "$pcfile" ]; then
local owner=$($APK $apkroot info --quiet --who-owns $pcfile) local owner=$($APK $apkroot info --quiet --who-owns $pcfile)
warning "${owner:-package providing $pcfile} needs to be rebuilt" warning "${owner:-package providing $pcfile} needs to be rebuilt"
@@ -1276,7 +1252,7 @@ @@ -1276,7 +1245,7 @@
find_scanelf_paths() { find_scanelf_paths() {
local datadir="$1" local datadir="$1"
@ -235,7 +238,7 @@
if [ -n "$ldpath" ]; then if [ -n "$ldpath" ]; then
paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")" paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")"
fi fi
@@ -1422,7 +1398,7 @@ @@ -1422,7 +1391,7 @@
name="$(pkginfo_val pkgname "$controldir"/.PKGINFO)" name="$(pkginfo_val pkgname "$controldir"/.PKGINFO)"
datadir="$pkgbasedir"/$name datadir="$pkgbasedir"/$name
for i in $(sort -u "$provides_pc"); do for i in $(sort -u "$provides_pc"); do
@ -244,7 +247,7 @@
--print-requires \ --print-requires \
--print-requires-private ${i%=*} \ --print-requires-private ${i%=*} \
| sed -E 's/\s*([<>=]+)\s*/\1/' \ | sed -E 's/\s*([<>=]+)\s*/\1/' \
@@ -1502,14 +1478,11 @@ @@ -1502,14 +1471,11 @@
} }
build_abuildrepo() { build_abuildrepo() {
@ -260,7 +263,7 @@
if ! want_check; then if ! want_check; then
_check=true _check=true
fi fi
@@ -1524,7 +1497,6 @@ @@ -1524,7 +1490,6 @@
fetch fetch
unpack unpack
prepare prepare
@ -268,7 +271,7 @@
$_build $_build
$_check $_check
rootpkg rootpkg
@@ -1590,14 +1562,14 @@ @@ -1590,14 +1555,14 @@
local i local i
for i in doc man info html sgml licenses gtk-doc ri help; do for i in doc man info html sgml licenses gtk-doc ri help; do
@ -287,7 +290,7 @@
[ -d "$mandir" ] && find "$mandir" -type l \ [ -d "$mandir" ] && find "$mandir" -type l \
-a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \
-a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \
@@ -1629,10 +1601,10 @@ @@ -1629,10 +1594,10 @@
[ $islink -eq 0 ] && gzip -9 "$name" [ $islink -eq 0 ] && gzip -9 "$name"
done done
@ -300,7 +303,7 @@
} }
doc() { doc() {
@@ -1648,8 +1620,8 @@ @@ -1648,8 +1613,8 @@
for f in $binfiles; do for f in $binfiles; do
srcdir=$(dirname $pkgdir/$f) srcdir=$(dirname $pkgdir/$f)
srcfile=$(basename $pkgdir/$f) srcfile=$(basename $pkgdir/$f)
@ -311,7 +314,7 @@
if [ ! -d $dstdir ] ; then if [ ! -d $dstdir ] ; then
mkdir -p $dstdir mkdir -p $dstdir
fi fi
@@ -1675,14 +1647,14 @@ @@ -1675,14 +1640,14 @@
pkgdesc="$pkgdesc (development files)" pkgdesc="$pkgdesc (development files)"
cd "$pkgdir" || return 0 cd "$pkgdir" || return 0
@ -333,7 +336,7 @@
$(find . -name include -type d) \ $(find . -name include -type d) \
$(find $libdirs -name '*.[acho]' \ $(find $libdirs -name '*.[acho]' \
-o -name '*.prl' 2>/dev/null); do -o -name '*.prl' 2>/dev/null); do
@@ -1747,33 +1719,17 @@ @@ -1747,33 +1712,17 @@
type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function" type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function"
} }
@ -370,7 +373,7 @@
$_package \ $_package \
prepare_subpackages \ prepare_subpackages \
prepare_language_packs \ prepare_language_packs \
@@ -2096,7 +2052,7 @@ @@ -2096,7 +2045,7 @@
$install_deps $recursive $upgrade $color_opt \ $install_deps $recursive $upgrade $color_opt \
abuildindex || return 1 abuildindex || return 1
done done
@ -379,7 +382,7 @@
$apk_opt_wait \ $apk_opt_wait \
--virtual .makedepends-$pkgname $builddeps \ --virtual .makedepends-$pkgname $builddeps \
|| return 1 || return 1
@@ -2125,14 +2081,11 @@ @@ -2125,14 +2074,11 @@
} }
rootbld_actions() { rootbld_actions() {
@ -395,7 +398,7 @@
if ! want_check; then if ! want_check; then
_check=true _check=true
fi fi
@@ -2163,8 +2116,6 @@ @@ -2163,8 +2109,6 @@
msg "Preparing build chroot..." msg "Preparing build chroot..."
@ -404,7 +407,7 @@
BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX) BUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX)
local aportsgit=${APORTSDIR:-${startdir}} local aportsgit=${APORTSDIR:-${startdir}}
@@ -2205,7 +2156,7 @@ @@ -2205,7 +2149,7 @@
) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories" ) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories"
calcdeps calcdeps
@ -413,7 +416,7 @@
abuild alpine-base build-base git $hostdeps $builddeps abuild alpine-base build-base git $hostdeps $builddeps
local bwrap_opts="" local bwrap_opts=""
@@ -2346,22 +2297,22 @@ @@ -2346,22 +2290,22 @@
local _quiet="$1" local _quiet="$1"
[ -z "$_quiet" ] && msg "Installing for build:$builddeps" [ -z "$_quiet" ] && msg "Installing for build:$builddeps"
@ -440,7 +443,7 @@
--no-scripts .makedepends-$pkgname || : --no-scripts .makedepends-$pkgname || :
fi fi
} }
@@ -2481,7 +2432,7 @@ @@ -2481,7 +2425,7 @@
package Install project into $pkgdir package Install project into $pkgdir
prepare Apply patches prepare Apply patches
rootbld Build package in clean chroot rootbld Build package in clean chroot
@ -449,7 +452,7 @@
sanitycheck Basic sanity check of APKBUILD sanitycheck Basic sanity check of APKBUILD
snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl
sourcecheck Check if remote source package exists upstream sourcecheck Check if remote source package exists upstream
@@ -2563,7 +2514,7 @@ @@ -2563,7 +2507,7 @@
if [ -z "$REPODEST" ]; then if [ -z "$REPODEST" ]; then
warning "REPODEST is not set and is now required. Defaulting to ~/packages" warning "REPODEST is not set and is now required. Defaulting to ~/packages"
[ -n "$PKGDEST" ] && die "PKGDEST is no longer supported." [ -n "$PKGDEST" ] && die "PKGDEST is no longer supported."