summaryrefslogtreecommitdiff
path: root/etc/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'etc/pkgs')
-rwxr-xr-xetc/pkgs/003-openssl.sh76
-rwxr-xr-xetc/pkgs/004-nodejs.sh17
-rwxr-xr-xetc/pkgs/005-tini.sh18
3 files changed, 111 insertions, 0 deletions
diff --git a/etc/pkgs/003-openssl.sh b/etc/pkgs/003-openssl.sh
new file mode 100755
index 0000000..92a4658
--- /dev/null
+++ b/etc/pkgs/003-openssl.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+set -x
+
+name="openssl"
+version="1.1.0j"
+
+tarball="${name}-${version}.tar.gz"
+dest="${tarball%%.tar.gz}"
+url="https://www.openssl.org/source/${tarball}"
+prefix="${TOOLCHAIN}"
+
+
+function pre()
+{
+ curl -LO "${url}"
+ tar xf "${tarball}"
+}
+
+
+function get_system_cacert() {
+ local paths=(
+ /etc/ssl/cert.pem
+ /etc/ssl/cacert.pem
+ /etc/ssl/certs/cacert.pem
+ /etc/ssl/certs/ca-bundle.crt
+ )
+ for bundle in "${paths[@]}"
+ do
+ if [[ -f ${bundle} ]]; then
+ echo "${bundle}"
+ break
+ fi
+ done
+}
+
+
+function build()
+{
+ pre
+ pushd "${dest}"
+ export PATH="${prefix}/bin:${PATH}"
+ export KERNEL_BITS=64
+ target="linux-x86_64"
+
+ sed -i -e "s@./demoCA@${TOOLCHAIN}/ssl@" \
+ apps/openssl.cnf \
+ apps/CA.pl.in
+
+ ./Configure \
+ --prefix="${prefix}" \
+ --openssldir="ssl" \
+ --libdir="lib" \
+ ${LDFLAGS} \
+ ${target} \
+ enable-ec_nistp_64_gcc_128 \
+ zlib-dynamic \
+ shared \
+ no-ssl3-method
+ make -j${_maxjobs}
+ make install MANDIR="${prefix}/share/man" MANSUFFIX=ssl
+ popd
+ post
+}
+
+function post()
+{
+ bundle=$(get_system_cacert)
+ install -D -m644 "${bundle}" "${prefix}/ssl/cert.pem"
+ rm -rf "${prefix}/share/doc/openssl/html"
+ rm -rf "${dest}"
+ rm -rf "${tarball}"
+ echo "All done."
+}
+
+# Main
+build
diff --git a/etc/pkgs/004-nodejs.sh b/etc/pkgs/004-nodejs.sh
new file mode 100755
index 0000000..b52a229
--- /dev/null
+++ b/etc/pkgs/004-nodejs.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -x
+
+name=node
+version=v10.15.0
+srcdir=${name}-${version}
+tarball=${srcdir}.tar.gz
+url=https://nodejs.org/dist/${version}/${tarball}
+
+curl -LO "${url}"
+tar xf "${tarball}"
+pushd "${srcdir}"
+ export CFLAGS="${CFLAGS} -fPIC"
+ ./configure --prefix=${TOOLCHAIN}
+ make -j${_maxjobs}
+ make install
+popd
diff --git a/etc/pkgs/005-tini.sh b/etc/pkgs/005-tini.sh
new file mode 100755
index 0000000..44bb172
--- /dev/null
+++ b/etc/pkgs/005-tini.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -x
+
+sudo yum install -y cmake glibc-static || exit 1
+git clone https://github.com/krallin/tini.git
+export CFLAGS="${CFLAGS} -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
+
+pushd tini
+ git checkout v0.18.0
+ mkdir -p build
+ pushd build
+ cmake ..
+ make
+ install -m755 tini ${TOOLCHAIN_BIN}
+ popd
+popd
+
+rm -rf tini