1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00
build/pkg/iproute2/build
David Oberhollenzer 8e5c6d3a2e Make toolchain and user space hardening configurable
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-19 21:50:57 +02:00

40 lines
948 B
Text
Executable file

VERSION="4.18.0"
SRCDIR="iproute2-${VERSION}"
TARBALL="${SRCDIR}.tar.xz"
URL="https://www.kernel.org/pub/linux/utils/net/iproute2/"
SHA256SUM="a9e6c70c95f513871c5e1f4e452c04fcb3c4d8a05be651bd794cd994a52daa45"
DEPENDS="libmnl"
prepare() {
apply_patches
}
build() {
cp -r ${1}/* ${PKGBUILDDIR}
local cflags=""
local ldflags=""
if [ "x$TC_HARDENING" = "xyes" ]; then
cflags="-fstack-protector-all"
ldflags="-z noexecstack -z relro -z now"
fi
make CCOPTS="-O2 $cflags" LDFLAGS="$ldflags" \
HOSTCC="gcc" AR="${TARGET}-ar" LD="${TARGET}-ld" \
CC="${TARGET}-gcc" SYSROOT="$TCDIR/$TARGET"
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
make DESTDIR="$DEPLOY" SYSROOT="$TCDIR/$TARGET" install
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
}
check_update() {
curl --silent -L $URL | grep -o "iproute2-[0-9.]*tar.xz" | \
sed 's/iproute2-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}