diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-29 21:53:53 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-29 21:53:53 -0400 |
| commit | 5b25c5155312f626813e0d36b7933f5eba801dd2 (patch) | |
| tree | 6e264a92dbe13ed77821a5c5bd536b6701768442 /build | |
| parent | e9b933ea6ce85f5d4f4653b7e5e6a7c836fcc893 (diff) | |
| download | dotfiles-5b25c5155312f626813e0d36b7933f5eba801dd2.tar.gz dotfiles-5b25c5155312f626813e0d36b7933f5eba801dd2.tar.xz | |
Major dotfile cleanup
Diffstat (limited to 'build')
| -rwxr-xr-x | build/oksh | 33 | ||||
| -rw-r--r-- | build/pass | 28 | ||||
| -rw-r--r-- | build/readme.md | 7 | ||||
| -rw-r--r-- | build/socat/Dockerfile | 2 | ||||
| -rw-r--r-- | build/socat/build.sh | 15 | ||||
| -rwxr-xr-x | build/tmux | 36 | ||||
| -rw-r--r-- | build/tmux/.gitignore | 1 | ||||
| -rw-r--r-- | build/tmux/Dockerfile | 14 | ||||
| -rw-r--r-- | build/tmux/build-int.sh | 25 | ||||
| -rw-r--r-- | build/tmux/build.sh | 16 | ||||
| -rwxr-xr-x | build/upx | 26 |
11 files changed, 116 insertions, 87 deletions
diff --git a/build/oksh b/build/oksh new file mode 100755 index 0000000..3588d76 --- /dev/null +++ b/build/oksh @@ -0,0 +1,33 @@ +#!/bin/sh +set -e +set -x +relver="6.9" +build_dir="/v/autobuild/oksh" + +export LDFLAGS="-static" +PREFIX="${PREFIX:-$HOME/pkg}" + +if ! [ -d "$build_dir" ] ; then + mkdir -p "$build_dir" +fi +cd "$build_dir" + +arLoc="https://github.com/ibara/oksh/releases/download/oksh-%s/oksh-%s.tar.gz" +arLoc="$(printf "$arLoc\n" "$relver" "$relver")" +arFn="oksh-${relver}.tar.gz" + +checksum=c08d97b2ac9ee5d88e9e508d27c75502b2d06c20d4c5ab87b496cb3b9951bd35 + +if ! [ -e "$arFn" ] ; then + curl -L -o "$arFn" "$arLoc" +fi + +echo "${checksum} $arFn" | sha256sum -c + +tar xzvf "$arFn" +cd "oksh-${relver}" +./configure --prefix="$PREFIX" --bindir="$PREFIX/bin" --enable-ksh \ + --enable-static +make +make install -j$(nproc) + diff --git a/build/pass b/build/pass deleted file mode 100644 index 0c06564..0000000 --- a/build/pass +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -set -e -set -x - -_install() { -remote="" -dest="" -while [ $# -gt 0 ] ; do case $1 in - -r) remote="$2"; shift ; shift ;; - -d) dest="$2"; shift ; shift ;; - -m) _mkopts="$2"; shift ; shift ;; - *) echo "Unknown option $1" ; return ;; -esac ; done - -if ! [ -d "$dest" ] ; then - git clone "$remote" "$dest" -fi - -cd "$dest" - -git pull --ff-only origin master - -sudo make $_mkopts install -} - -_install -d /v/pub/pass -r https://git.zx2c4.com/password-store -_install -d /v/pub/pass-otp -r https://github.com/tadfisher/pass-otp \ - -m PREFIX=/usr diff --git a/build/readme.md b/build/readme.md new file mode 100644 index 0000000..df1845d --- /dev/null +++ b/build/readme.md @@ -0,0 +1,7 @@ +# build scripts + + +Probably not a ton of use to others, specific configuration for me +to build a few applications from source. Mostly because things on +Ubuntu LTS become rather out of date over time and there are cases +wehre I need to run that OS. diff --git a/build/socat/Dockerfile b/build/socat/Dockerfile index 1850917..e872ec8 100644 --- a/build/socat/Dockerfile +++ b/build/socat/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk add gcc libc-dev make +RUN apk add gcc libc-dev make openssl-dev diff --git a/build/socat/build.sh b/build/socat/build.sh index d0d6ef9..fbc70d9 100644 --- a/build/socat/build.sh +++ b/build/socat/build.sh @@ -1,6 +1,17 @@ #!/bin/sh + +build=docker +if [ -x "$(command -v buildah)" ] ; then + build=buildah +fi + +run=docker +if [ -x "$(command -v podman)" ] ; then + run=podman +fi + image="socat-builder" -docker build -t "$image" . +$build build -t "$image" . if ! [ -d build ] ; then @@ -10,7 +21,7 @@ fi cp build-int.sh build/build.sh echo "chown -R $(id -u):$(id -g) /build" >> build/build.sh -docker run -it \ +$run run --rm -it \ -v `pwd`/build:/build \ "$image" \ sh /build/build.sh diff --git a/build/tmux b/build/tmux new file mode 100755 index 0000000..f160062 --- /dev/null +++ b/build/tmux @@ -0,0 +1,36 @@ +#!/bin/sh +set -e +set -x +relver="3.2a" +build_dir="/v/muslbuild/tmux" + +PREFIX="$HOME/musl" +export CC="musl-gcc -static -I. -I$PREFIX/include/ncursesw -DHAVE_FORKPTY=1 -DHAVE_FDFORKPTY=1" + +if ! [ -d "$build_dir" ] ; then + mkdir -p "$build_dir" +fi +cd "$build_dir" + +arLoc="https://github.com/tmux/tmux/releases/download/%s/tmux-%s.tar.gz" +arLoc="$(printf "$arLoc\n" "$relver" "$relver")" +arFn="tmux-${relver}.tar.gz" + +checksum=551553a4f82beaa8dadc9256800bcc284d7c000081e47aa6ecbb6ff36eacd05f + +if ! [ -e "$arFn" ] ; then + curl -L -o "$arFn" "$arLoc" +fi + +echo "${checksum} $arFn" | sha256sum -c + +tar xzvf "$arFn" +cd "tmux-${relver}" +./configure --prefix="$PREFIX" --bindir="$HOME/bin" \ + --enable-static \ + --host=x86_64-alpine-linux-musl \ + --build=x86_64-alpine-linux-musl +make clean +make -j$(nproc) +make install -j$(nproc) + diff --git a/build/tmux/.gitignore b/build/tmux/.gitignore deleted file mode 100644 index 378eac2..0000000 --- a/build/tmux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/build/tmux/Dockerfile b/build/tmux/Dockerfile deleted file mode 100644 index 463e964..0000000 --- a/build/tmux/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:20.04 - -RUN sed -i -e'/deb-src/s/^#//g' /etc/apt/sources.list -RUN apt-get update -RUN apt-get install -y build-essential -RUN env DEBIAN_FRONTEND=noninteractive apt-get build-dep -y tmux - - -# RUN apk add libevent-dev gcc libc-dev make git -# RUN apk add automake -# RUN apk add autoconf -# RUN apk add ncurses-dev - - diff --git a/build/tmux/build-int.sh b/build/tmux/build-int.sh deleted file mode 100644 index b4687aa..0000000 --- a/build/tmux/build-int.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -e -set -x -ver=3.1a -export LDFLAGS='-static' - -cd /build - -if [ -e tmux ] ; then exit 0 ; fi - -if ! [ -e git ] ; then - git clone --depth 1 --branch "$ver" https://github.com/tmux/tmux git -fi - -cd git - -./autogen.sh -./configure --enable-static -make -j$(nproc) -cp tmux ../ - -cd .. - -gzip -c < tmux > tmux.gz -base64 < tmux.gz > tmux.base64.gz diff --git a/build/tmux/build.sh b/build/tmux/build.sh deleted file mode 100644 index 763b045..0000000 --- a/build/tmux/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -image="tmux-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 diff --git a/build/upx b/build/upx new file mode 100755 index 0000000..9658832 --- /dev/null +++ b/build/upx @@ -0,0 +1,26 @@ +#!/bin/sh +set -e +set -x +relver="3.96" +build_dir="/v/autobuild/jq" + +if ! [ -d "$build_dir" ] ; then + mkdir -p "$build_dir" +fi +cd "$build_dir" + +arLoc="https://github.com/upx/upx/releases/download/v%s/upx-%s-amd64_linux.tar.xz" +arLoc="$(printf "$arLoc\n" "$relver" "$relver")" +arFn="upx-${relver}-amd64_linux.tar.xz" + +checksum=ac75f5172c1c530d1b5ce7215ca9e94586c07b675a26af3b97f8421b8b8d413d + +if ! [ -e "$arFn" ] ; then + curl -L -o "$arFn" "$arLoc" +fi + +echo "${checksum} $arFn" | sha256sum -c + +tar xJvf "$arFn" +cd "upx-${relver}-amd64_linux" +cp upx "$HOME/bin/upx" |
