#author("2021-09-24T09:54:49+09:00","default:nobuoki","nobuoki") #author("2021-09-24T09:57:29+09:00","default:nobuoki","nobuoki") * はじめに / Introduction [#p2f14847] 社内ネットワークでプロキシを云々するための便利ツール [[Simple Repeater `stone'>https://www.gcd.org/sengoku/stone/Welcome.ja.html]] をコンテナを使ってビルドします。 Build [[(EN) Simple Repeater `stone'>>https://www.gcd.org/sengoku/stone/]], a handy tool for proxies on your corporate network, using a container. ** わざわざビルドするのはなぜ? / Why bother to build? [#c02425c6] 最近はパッケージが提供されてないっぽいので。 It seems that the package has not been provided recently. - 以前のUbuntuでは stone のパッケージ(deb)が用意されてたんだけど、最近はないっぽい Previously Ubuntu had a deb package, but it doesn't seem to be there these days. - CentOS/Fedora系は epel とか rpmfusion とかにはないみたい(単に自分が探せないだけかもですが) CentOS / Fedora system doesn't seem to be in epel or rpmfusion (maybe I just can't find it) * 作り方 / How to build [#l55c23de] docker/podman をインストールしたLinux上でスクリプトを実行します Run the script on Linux with docker / podman installed #prism(bash){{{ #!/bin/sh # vim: set ft=sh ff=unix expandtab ts=2 sw=2 : #set -x set -e STONE_SRC_URL='https://osdn.net/cvs/view/stone/stone/?view=tar' container_name=stone_builder # container management command if command -v docker >/dev/null 2>&1; then CONTAINER_CLI=docker elif command -v podman >/dev/null 2>&1; then CONTAINER_CLI=podman else echo "ERROR: Requires either docker or podman, stopped." exit 1 fi "$CONTAINER_CLI" ps -aq -f "name=$container_name" | xargs -rt podman stop || true "$CONTAINER_CLI" ps -aq -f "name=$container_name" | xargs -rt podman rm || true "$CONTAINER_CLI" run -i \ -v "$(pwd)":/mnt \ -w /mnt \ -e STONE_SRC_URL="$STONE_SRC_URL" \ --name "$container_name" \ ubuntu bash <<'...' set -x apt update apt -y install build-essential curl libssl-dev curl -sSL "$STONE_SRC_URL" | tar zxvf - cd stone sed -i 's/SSL_state/SSL_get_state/' stone.c # https://bit.ly/2XY7QSJ make linux-ssl ... }}} ビルドが正常終了したら実行ファイルを適宜配置します(例 sudo install stone/stone /usr/local/sbin) When the build is completed normally, place the executable file appropriately * 備考 / Remarks [#i01c40f7] - [[CVS リポジトリ>https://osdn.net/cvs/view/stone/stone/]] のソースファイルを使用しているので、-D_GNU_SOURCE オプションを気にする必要がありません(Makefile に修正が加わっています) You don't have to worry about the -D_GNU_SOURCE option because you're using the source files from the [[CVS repository>https://osdn.net/cvs/view/stone/stone/]] (Makefile has been modified). - 最近のopensslに合わせて、ソースコードを修正しています Modifying the source code for recent openssl. -- [[tcpリピータのstone – 極限環境材料化学研究室>https://amorphous.tf.chiba-u.jp/?p=588]]