summaryrefslogtreecommitdiff
path: root/system/bash/APKBUILD
blob: 85897e3eb0c23c1cf0e7bcfc2d54047361386453 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: TBK <alpine@jjtc.eu>
# Contributor: Elizabeth Myers <elizabeth@adelielinux.org>
# Maintainer: Zach van Rijn <me@zv.io>
pkgname=bash
pkgver=5.1.8
_patchlevel=${pkgver##*.}
_myver=${pkgver%.*}
_patchbase=$(printf '%s' "$_myver" | tr -d .)
pkgrel=0
pkgdesc="The GNU Bourne Again shell"
url="https://www.gnu.org/software/bash/bash.html"
arch="all"
license="GPL-3.0+"
makedepends_build="byacc flex"
makedepends_host="ncurses-dev"
depends=""
install="$pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang
	$pkgname-binsh:binsh:noarch"
source="https://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 https://ftp.gnu.org/gnu/bash/bash-$_myver-patches/bash$_patchbase-$_pad$_i"
	_i=$(( $_i + 1))
done

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

	default_prepare
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--bindir=/bin \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-curses \
		--without-bash-malloc
	# parallel build workarounds
	make y.tab.c && make builtins/libbuiltins.a && make
}

check() {
	make check
}

package() {
	make DESTDIR=${pkgdir} install
	install -D -m755 "$srcdir"/bashrc "$pkgdir"/etc/bash/bashrc
}

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

sha512sums="c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c  bash-5.1.tar.gz
9d8845491d0fe335bdd8e9a2bd98bda54bfed2ae3c35b2196c6d5a38bdf96c4d97572ba7d6b19ab605ef4e8f001f64cf3312f87dedebb9e37a95ad2c44e33cdb  bash-noinfo.patch
388433e9ab25948747adfa7c2b98021799d5d396e8771d09b5b079054380af3f299f78abef144fe93908f6eff252658137c95ebba9418fe385f0cecbb5795f24  bash44-sensible-defaults.patch
de08a409023973352437a90101cec23eb3b282d0e7e2f5dc14f2da9f9ba4307d681a302ab86517761a1c5adbd79222e409d6f9d129c7f70af5a71f69a23b6b6a  bashrc
1cd86805a2639614372aec29a710bc456e330abcbbaa0867820c94f714a1fa5fb5c1b18aa2c10263ae0bce9dad7579c7af2f732282315c1c34bfd6a90777bfd2  bash51-001
923e7822a9629645347d3aea0058fb5e2d52223507159a62369309f264612df44a84931c19e0ccb3852e98ce672dfbd454477090b4041b5a0de477c94eb61088  bash51-002
01e952dcfdae58624723d64912ea3444eed2fdcd266ba1a929b95ec3abd70f914bf400607c3f7bb7a94ac2925f794f91f37c1929d5bb987de2ba7f60a19cb8bd  bash51-003
10ff24cd91a2cd88818bfa7218050843af6b409e43fcca89f5ec70d8266020c6c2a55132426271f165cd0f154f49eb0f8ec2761b80fc066c921b83120bb543ce  bash51-004
fa83d894fe874a05b9a7d47b8bca8e5b7f4067221d82e8b1af616d17725592c3737c621f2a8ad3c917b29846012c37c85acd34dcbb43eb6b05065ccce89b260c  bash51-005
b9b6e3d71f7b7718e2e8598ec8e337dcc675571fb233c29e5230ebf14eab2249204531f2fe8c4d1459c5fed10acb679048588d1e457e98dbc00ffc4d2cd227e3  bash51-006
e4ebdc47e780ddc2588ecdfcfe00cb618039c7044e250ab2b836b0735c461ebacd15beaf2145e277c70b7f51cded55bd8dde7757df810f33f8dae306ee5ba571  bash51-007
97f9558a08a66cc9da62c285bf9118b39328e25ed3b9277728e0539b1ac0adef176a090e39cd96dc03d6fd900d8155bd58040cb3390a09f637bab1de8af3faf6  bash51-008"