summaryrefslogblamecommitdiff
path: root/system/bash/APKBUILD
blob: c5a476b1a436910a08a77c28386e1dcc47d75af8 (plain) (tree)



















































































































                                                                                                                                                                
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bash
pkgver=4.4.12
_patchlevel=${pkgver##*.}
_myver=${pkgver%.*}
_patchbase=${_myver/./}
pkgrel=2
pkgdesc="The GNU Bourne Again shell"
url="http://www.gnu.org/software/bash/bash.html"
arch="all"
license="GPL3+"
makedepends_build="bison flex"
makedepends_host="readline-dev ncurses-dev"
depends=""
options="!checkroot"
install="$pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-doc $pkgname-binsh:binsh:noarch"
source="http://ftp.gnu.org/gnu/bash/bash-${_myver}.tar.gz
	bash-noinfo.patch
	bash44-sensible-defaults.patch
	bashrc
	"
# 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 http://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() {
	cd "$builddir"

	# 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##*/} || return 1
			;;
		esac
	done

	default_prepare
	update_config_sub
}

build() {
	cd "$builddir"
	./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() {
	cd "$builddir"
	make check
}

package() {
	cd ${startdir}/src/${pkgname}-${_myver}
	make DESTDIR=${pkgdir} install

	rm -rf "$pkgdir"/usr/share/locale
	install -D -m755 "$srcdir"/bashrc "$pkgdir"/etc/bash/bashrc
}

binsh() {
	pkgdesc="Use bash as /bin/sh"
	provides="/bin/sh"
	mkdir -p "$subpkgdir"/bin
	ln -s /bin/bash "$subpkgdir"/bin/sh
}

sha512sums="73de3b425faaac55e45456b0f6f6d8077b5dfa7bb76e0d1894a19361b4a2b6bd4fbbe182117ddbfe9b07b4d898fba03537c261badc9533dd3c0da891764c7f29  bash-4.4.tar.gz
9d8845491d0fe335bdd8e9a2bd98bda54bfed2ae3c35b2196c6d5a38bdf96c4d97572ba7d6b19ab605ef4e8f001f64cf3312f87dedebb9e37a95ad2c44e33cdb  bash-noinfo.patch
388433e9ab25948747adfa7c2b98021799d5d396e8771d09b5b079054380af3f299f78abef144fe93908f6eff252658137c95ebba9418fe385f0cecbb5795f24  bash44-sensible-defaults.patch
2b6e2e34328f091cbe0882833eab99c6fddbe19a5942382c4c1fbe5b1d20158cfcfcaaaea1f941b9a481be0507b7ea55e6048f79246657019713f0b201318e45  bashrc
fa7a1b277eb3bad6ae7d2c7a2887cbf2c0eb75b7fee8ed03ec1e9d45879a2fb4b8c7cb16d6b029987493b01a461214bd9a24454a6837e7cfe180b1bc56f61caa  bash44-001
526f986057810f89080e283ff95b3a8fd24d37e4ad2f18c39f36d3a2d57956a6441d16220082157735e3c5ccf770d5016e761aa5f309129898e39277d576e6b5  bash44-002
e61db89bdd1a7ae15013fe258046a343c9ea41e5a1c6d2c810947500a617fce7536b8d51194e14bb42499fe0de6d70cc9b2c81da0afdcb5a2278459f4f76d748  bash44-003
7570cf15518f79230cfe91b3e58c795c16c7fb6ba6418d967355b36fb7982e7919a9eaaef9177fb605c7fb7d7efb8a8335e725c1bacffff69a098433f5adc9c7  bash44-004
7546a6c90c8e8508567dde713722291477ca87c1116905b46432514a4fc632840a855b84f102591914cd4c44d5bf2eb7400866e26366fc94525fb401ea844a8f  bash44-005
5edcd76cf97bfe289f71924ba279ff48a1167eb3cc36f811cbcc23732746f5c821d1d39d4b137b7d99d57809a4b7270a54f4a41176fcfde0708bf92ddc68b77f  bash44-006
386c019debee414697abc648d9a77894e842bb0b7a2a71709e8b3398582f25065e68963405fa22fb77439c6b431ee94a2ecbb16734c2436af3dfb4d1b5f06fcf  bash44-007
d9a8924f1c9263deab89153bb688a87f211913ebd72c8077e607db6fdddc7e5af05042dd22a9a2df593e518ea74b54ca79d20afc796e47d871827a2556e233d0  bash44-008
3b01c080cf4a54658679b36c282a69a9ac48b900b19ceb42dbaf084abd395d50e5ff14db90a7fdf0c9856dad150897dca561160686c931634765782447fc076e  bash44-009
54ff556b62fd88381e7a495db50957b016474973b3a566661c65b649a40960f2d3355221b3a71fb292128aad92a45d73d9816d63833bc416b4d15acdef391b98  bash44-010
6b5b068b74978fc691749ccff5e094c768047f702430e97114f5bf342f078696f7d7616d0642d4061b062e9112dfe00a1c2309c65de4147e0e98fb52c593d844  bash44-011
4661c4c132f2ea7c9a70368301041c482d5820d8389334a7e3ae44c36fc16c171b20db2f194b7663c84d6c3dcef81aa90f050a48e205218fc7bd3395d09c6a51  bash44-012"