1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-17 03:06:12 +02:00
build/pkg/openssl/build
David Oberhollenzer 69aa1d33e9 Set hardening options for packages with custom build system
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-19 00:18:51 +02:00

41 lines
1,004 B
Plaintext
Executable file

VERSION="1.1.1"
SRCDIR="openssl-${VERSION}"
TARBALL="${SRCDIR}.tar.gz"
URL="https://www.openssl.org/source"
SHA256SUM="2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d"
DEPENDS="zlib"
prepare() {
return
}
build() {
local cflags="-fstack-protector-all"
local ldflags="-z noexecstack -z relro -z now"
$1/Configure --prefix=/ --cross-compile-prefix="${TARGET}-" \
--openssldir=/etc/ssl --libdir=/lib \
CFLAGS="-DOPENSSL_NO_HEARTBEATS $cflags" \
LDFLAGS="$ldflags" \
threads shared zlib-dynamic no-async $OPENSSL_TARGET
make -j 1
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
make DESTDIR="$DEPLOY" install
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
}
check_update() {
local version=$(echo $VERSION | sed 's/\([[:lower:]]\)/.\1/g')
curl --silent -L "$URL" | grep -o ">openssl-[0-9a-z.]*tar.gz<" | \
sed 's/>openssl-//g' | sed 's/.tar.gz<//g' | \
sed 's/\([[:lower:]]\)/.\1/g' | \
verson_find_greatest "$version"
}