mirror of
https://github.com/pygos/build.git
synced 2024-11-14 15:37:11 +01:00
60 lines
1.3 KiB
Text
Executable file
60 lines
1.3 KiB
Text
Executable file
VERSION="1.1.1a"
|
|
SRCDIR="openssl-${VERSION}"
|
|
TARBALL="${SRCDIR}.tar.gz"
|
|
URL="https://www.openssl.org/source"
|
|
SHA256SUM="fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41"
|
|
DEPENDS="zlib-dev crt-dev"
|
|
SUBPKG="openssl openssl-dev"
|
|
|
|
prepare() {
|
|
return
|
|
}
|
|
|
|
build() {
|
|
local OPENSSL_TARGET=""
|
|
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
|
|
|
|
case "$TARGET" in
|
|
i*86-*)
|
|
OPENSSL_TARGET="linux-generic32 386"
|
|
;;
|
|
x86_64-*)
|
|
OPENSSL_TARGET="linux-x86_64"
|
|
;;
|
|
arm-*)
|
|
OPENSSL_TARGET="linux-generic32"
|
|
;;
|
|
*)
|
|
echo "don't know how to map $TARGET to OpenSSL arch"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
$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() {
|
|
make DESTDIR="$PKGDEPLOYDIR" install
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
|
|
}
|
|
|
|
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"
|
|
}
|