aboutsummaryrefslogblamecommitdiffstats
path: root/main/bash/APKBUILD
blob: ac289ccc60ecdd15e4cf36e87cc0638cde62ff75 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                   
                                   
                                                   
            
            

                         
                       
        
                                    
                                                 
          
                          
                              
                                             
                                                                            
                                                    
                                                        

                         
                                                    
    
       


                                  
                                                                                                   

                        
 
           

                     
 
                                   
 
           









                                                                                          
                                                       



                          
                       


                                                                            
 
 
         






                                           
                               
                               

                                       
                                         
                                    
                                                           

 
         


                 
           
                                      
 
                                         
 
 






                                                                             

                                                                                                                                                             
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bash
pkgver=5.1.0
_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"