aboutsummaryrefslogtreecommitdiff
path: root/build/socat
diff options
context:
space:
mode:
Diffstat (limited to 'build/socat')
-rw-r--r--build/socat/.gitignore1
-rw-r--r--build/socat/Dockerfile5
-rw-r--r--build/socat/build-int.sh26
-rw-r--r--build/socat/build.sh16
4 files changed, 48 insertions, 0 deletions
diff --git a/build/socat/.gitignore b/build/socat/.gitignore
new file mode 100644
index 0000000..378eac2
--- /dev/null
+++ b/build/socat/.gitignore
@@ -0,0 +1 @@
+build
diff --git a/build/socat/Dockerfile b/build/socat/Dockerfile
new file mode 100644
index 0000000..1850917
--- /dev/null
+++ b/build/socat/Dockerfile
@@ -0,0 +1,5 @@
+FROM alpine:latest
+
+RUN apk add gcc libc-dev make
+
+
diff --git a/build/socat/build-int.sh b/build/socat/build-int.sh
new file mode 100644
index 0000000..0709a90
--- /dev/null
+++ b/build/socat/build-int.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+set -x
+ver=1.7.3.4
+export LDFLAGS='-static'
+
+cd /build
+
+if [ -e socat ] ; then exit 0 ; fi
+
+if ! [ -e socat.tgz ] ; then
+ wget -O socat.tgz "http://www.dest-unreach.org/socat/download/socat-${ver}.tar.gz"
+fi
+
+tar xzvf socat.tgz
+
+cd socat-${ver}
+
+./configure
+make -j$(nproc)
+cp socat ../
+
+cd ..
+
+gzip -c < socat > socat.gz
+base64 < socat.gz > socat.base64.gz
diff --git a/build/socat/build.sh b/build/socat/build.sh
new file mode 100644
index 0000000..d0d6ef9
--- /dev/null
+++ b/build/socat/build.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+image="socat-builder"
+docker build -t "$image" .
+
+
+if ! [ -d build ] ; then
+ mkdir build;
+fi
+
+cp build-int.sh build/build.sh
+echo "chown -R $(id -u):$(id -g) /build" >> build/build.sh
+
+docker run -it \
+ -v `pwd`/build:/build \
+ "$image" \
+ sh /build/build.sh