1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-23 03:29:46 +01:00
build/pkg/dnsmasq/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

42 lines
984 B
Text

VERSION="2.79"
SRCDIR="dnsmasq-${VERSION}"
TARBALL="${SRCDIR}.tar.xz"
URL="http://www.thekelleys.org.uk/dnsmasq"
SHA256SUM="78ad74f5ca14fd85a8bac93f764cd9d60b27579e90eabd3687ca7b030e67861f"
DEPENDS="toolchain"
prepare() {
return
}
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
CFLAGS="-O2 $cflags" \
LDFLAGS="$ldflags" \
make CC=${TARGET}-gcc PREFIX="/" BINDIR="/bin" -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
make CC=${TARGET}-gcc PREFIX="/" BINDIR="/bin" DESTDIR="$DEPLOY" install
mkdir -p "$DEPLOY/etc"
cat_file_override "dnsmasq.conf" > "$DEPLOY/etc/dnsmasq.conf"
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
}
check_update() {
curl --silent -L "$URL" | grep -o ">dnsmasq-[0-9.]*tar.xz<" | \
sed 's/>dnsmasq-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}