mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
38 lines
984 B
Text
Executable file
38 lines
984 B
Text
Executable file
VERSION="4.20.0"
|
|
SRCDIR="iproute2-${VERSION}"
|
|
TARBALL="${SRCDIR}.tar.xz"
|
|
URL="https://www.kernel.org/pub/linux/utils/net/iproute2/"
|
|
SHA256SUM="c8adaa6a40f888476b23acb283cfa30c0dd55f07b5aa20663ed5ba2ef1f6fda8"
|
|
DEPENDS="libmnl-dev crt-dev"
|
|
SUBPKG="iproute2 iproute2-dev"
|
|
|
|
prepare() {
|
|
apply_patches
|
|
}
|
|
|
|
build() {
|
|
cp -r ${1}/* ${PKGBUILDDIR}
|
|
|
|
local cflags="-O2 -Os"
|
|
local ldflags=""
|
|
|
|
if [ "x$TC_HARDENING" = "xyes" ]; then
|
|
cflags="$cflags -fstack-protector-all"
|
|
ldflags="$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() {
|
|
make DESTDIR="$PKGDEPLOYDIR" SYSROOT="$TCDIR/$TARGET" install
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
|
|
}
|
|
|
|
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"
|
|
}
|