package.mk/wip/bash/APKBUILD

99 lines
3.2 KiB
Plaintext
Raw Normal View History

# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bash
pkgver=5.1.4
_patchlevel=${pkgver##*.}
_myver=${pkgver%.*}
_patchbase=${_myver/./}
pkgrel=0
pkgdesc="The GNU Bourne Again shell"
url="https://www.gnu.org/software/bash/bash.html"
arch="all"
license="GPL-3.0-or-later"
makedepends_build="bison flex"
makedepends_host="readline-dev>8 ncurses-dev"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/bash/bash-$_myver.tar.gz
bash-noinfo.patch
"
# generate url's to patches. note: no forks allowed!
_i=1
_pad=00
while [ $_i -le $_patchlevel ]; do
[ $_i -ge 10 ] && _pad="0"
[ $_i -ge 100 ] && _pad=
source="$source https://ftp.gnu.org/gnu/bash/bash-$_myver-patches/bash$_patchbase-$_pad$_i"
_i=$(( $_i + 1))
done
# secfixes:
# 4.4.12-r1:
# - CVE-2016-0634
builddir="$srcdir/$pkgname-$_myver"
prepare() {
# NOTE: This section is for applying the vendor patches, which are required to fix
# security holes. `default_prepare` does *not* apply vendor patches in the format
# shipped with bash. We also need to make sure vendor patches are applied before
# our own.
# If you disagree, please request an experimental rebuild with bash as /bin/sh,
# before removing this section.
for p in $source; do
case $p in
*/bash[0-9][0-9]-[0-9]*)
msg "$p (vendor)"
patch -p0 -i "$srcdir"/${p##*/}
;;
esac
done
default_prepare
# preventively set Version to please 'apk version --check'
sed -i "s/@PACKAGE_VERSION@/$pkgver/" "$builddir"/support/bash.pc.in
}
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--bindir=/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-curses \
--disable-nls \
--enable-readline \
--without-bash-malloc \
--with-installed-readline
# parallel build workarounds
make y.tab.c && make builtins/libbuiltins.a && make
}
check() {
make test
}
package() {
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/share/locale
}
dev() {
default_dev
mkdir -p "$subpkgdir"/bin "$subpkgdir"/usr/lib/$pkgname
mv "$pkgdir"/bin/${pkgname}bug "$subpkgdir"/bin
mv "$pkgdir"/usr/lib/$pkgname/Makefile* "$subpkgdir"/usr/lib/$pkgname
}
sha512sums="c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c bash-5.1.tar.gz
9d8845491d0fe335bdd8e9a2bd98bda54bfed2ae3c35b2196c6d5a38bdf96c4d97572ba7d6b19ab605ef4e8f001f64cf3312f87dedebb9e37a95ad2c44e33cdb bash-noinfo.patch
1cd86805a2639614372aec29a710bc456e330abcbbaa0867820c94f714a1fa5fb5c1b18aa2c10263ae0bce9dad7579c7af2f732282315c1c34bfd6a90777bfd2 bash51-001
923e7822a9629645347d3aea0058fb5e2d52223507159a62369309f264612df44a84931c19e0ccb3852e98ce672dfbd454477090b4041b5a0de477c94eb61088 bash51-002
01e952dcfdae58624723d64912ea3444eed2fdcd266ba1a929b95ec3abd70f914bf400607c3f7bb7a94ac2925f794f91f37c1929d5bb987de2ba7f60a19cb8bd bash51-003
10ff24cd91a2cd88818bfa7218050843af6b409e43fcca89f5ec70d8266020c6c2a55132426271f165cd0f154f49eb0f8ec2761b80fc066c921b83120bb543ce bash51-004"