インストール: OpenSSL | 安全なWebの根幹を担う暗号化ライブラリー
GitやcURL,Apache HTTP Serverなど通信関係で広く使われている暗号化のライブラリーであるOpenSSLをソースコードからインストールする。
項目 | 説明 |
---|---|
配布元 | OpenSSL |
リポジトリー | openssl/openssl: TLS/SSL and crypto library |
手順 | openssl/INSTALL at master · openssl/openssl |
依存情報 | openssl/INSTALL at master · openssl/openssl |
依存先 | Make (GNU Make), Perl 5 |
依存元 | PHP openssl拡張機能, OpenSSH, libeventなど |
sh -eux <<-"EOT"
LOCAL=~/.local J=$(grep -cs '^processor' /proc/cpuinfo || echo 2)
PKG=openssl VER=1.1.1a TAG=OpenSSL_$(echo $VER | sed 's/\./_/g')
mkdir -p "$LOCAL/src"
cd "$LOCAL/src"
if command -v git >/dev/null; then
[ -e $PKG ] || git clone --depth 1 https://github.com/$PKG/$PKG.git $PKG
cd $PKG
git fetch --depth 1 origin tag $TAG
git checkout -f $TAG
else
[ -e $PKG-$VER ] || wget https://www.openssl.org/source/$PKG-$VER.tar.gz
tar -xf $PKG-$VER.tar.gz
cd $PKG-$VER
make -kj $J distclean clean || :
fi
./config --prefix="$LOCAL/stow/$PKG-$VER" shared
make -j $J
make -j $J test
make -j $J install
cd "$LOCAL/stow"
echo $PKG-[0-9]* | xargs -n 1 stow --ignore=dir -D
stow --ignore=dir $PKG-$VER
EOT
日付 | バージョン | OS | 依存関係 |
---|---|---|---|
2018-05-17 | 1.1.0h | Ubuntu 16.04 | GNU Make 4.2.1, GCC 8.1.0 |
2019-02-08 | 1.1.1a | Ubuntu 16.04 | GNU Make 4.2.1, GCC 8.1.0 |
2019-03-31 | 1.1.1a | Ubuntu 18.04 | GNU Make 4.2.1, GCC 7.4.0 |
./configの実行時にsharedオプションをつけている。このsharedオプションは,ビルド時に共有オブジェクト (libssl.so, libcrypto.so) を作成することを意味する。
ただし,以下の記載通り1.1.xではデフォルトでsharedありとみなしてくれるため,本来ならば付ける必要はない。
Notes on shared libraries
————————-
For most systems the OpenSSL Configure script knows what is needed to
build shared libraries for libcrypto and libssl. On these systems
the shared libraries will be created by default. This can be suppressed and
only static libraries created by using the “no-shared” option. On systems
where OpenSSL does not know how to build shared libraries the “no-shared”
option will be forced and only static libraries will be created.
しかし,以下の記載通り1.0.xではsharedを指定しないと.soファイルを作成しない。
Note on shared libraries
————————
Shared libraries have certain caveats. Binary backward compatibility
can’t be guaranteed before OpenSSL version 1.0. The only reason to
use them would be to conserve memory on systems where several programs
are using OpenSSL.
For some systems, the OpenSSL Configure script knows what is needed to
build shared libraries for libcrypto and libssl. On these systems,
the shared libraries are currently not created by default, but giving
the option “shared” will get them created. This method supports Makefile
targets for shared library creation, like linux-shared. Those targets
can currently be used on their own just as well, but this is expected
to change in future versions of OpenSSL.
PHPなど他のライブラリーのビルド時や実行時に共有オブジェクト (shared object) が要求される。そのため,openssl-1.0.xと1.1.xとの手順を共通化するため,sharedオプションを指定している。
“インストール: OpenSSL | 安全なWebの根幹を担う暗号化ライブラリー” に対して2件のコメントがあります。