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

                                                   
            
        
                              
                                                                                
          
                          
                               
                                                       
                                                                   
                                                                               

                                
 



                      
           
                       
                                                     
                                                                 
                                            
                                         
 
 
         


                                 


                                         
                                    
                                           


           
                                          
 
 



                                                              


                                                
                                      



                                                        
                                                                                                                                                                   

                                                                                                                                                          
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=iproute2
pkgver=5.6.0
pkgrel=0
pkgdesc="IP Routing Utilities"
url="https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
arch="all"
license="GPL-2.0-or-later"
install="$pkgname.post-install"
makedepends="bison flex bash iptables-dev elfutils-dev"
subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="https://kernel.org/pub/linux/utils/net/iproute2/iproute2-$pkgver.tar.xz
	fix-install-errors.patch
	musl-fixes.patch"

# secfixes:
#   5.1.0-r0:
#     - CVE-2019-20795

prepare() {
	default_prepare
	sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
	sed -i 's:/usr/local:/usr:' tc/m_ipt.c include/iptables.h
	sed -i -e 's:=/share:=/usr/share:' \
		-e 's:-Werror::' Makefile
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make CCOPTS="-D_GNU_SOURCE $CFLAGS"
}

package() {
	make -j1 DESTDIR="$pkgdir" install
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/bash-completion \
		"$subpkgdir"/usr/share

	rmdir -p "$pkgdir"/usr/share 2>/dev/null || true
}

sha512sums="e52c6c8b676ab79401ae815fe3f80268c1edb490c0a00826e0f7181a816e9bf6549df9e77a40b0d56855db8ad312179b3a40002a2dd6f66c807039cff0cdfb6c  iproute2-5.6.0.tar.xz
24fc2a901650e11f80bcaa82c839e70c21aafdf3c5b8a357d932d066a0b98ae2ec8379fc17a0a16a1b5b4fa5edc131179c10fc02e55d6101701df5a09966912c  fix-install-errors.patch
2e3558caddf814da8c4d78c74eddb7a659d6f94b93de5396bdd995e2333e3cd656f9c936ac7a5a86d0477abc27a92550582575ab4ed19fc2ec0d9b6699cd612c  musl-fixes.patch"