Created
June 10, 2021 08:40
-
-
Save tantan-tanuki/06b71aff8913e0d1ef02050ba27f044c to your computer and use it in GitHub Desktop.
日本語MANページのインストールスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# JMプロジェクトURL | |
JM_URL=https://linuxjm.osdn.jp | |
# ダウンロードページ情報取得 | |
DOWNLOAD_PAGE="$(curl -s $JM_URL/download.html)" | |
# 最新アーカイブ名取得 | |
ARCHIVE_NAME="$(xmllint --html --xpath "//a[contains(@href, 'ja-2')]/text()" - < <(echo -e "$DOWNLOAD_PAGE"))" | |
# 一時作業ディレクトリ作成 | |
TEMP_DIR="$(mktemp -d)" | |
# 一時作業ディレクトリへ移動 | |
cd "$TEMP_DIR" | |
# アーカイブの解凍とダウンロード | |
curl -s "$JM_URL/$ARCHIVE_NAME" | tar xzvf - | |
# 解凍ディレクトリへ移動 | |
cd man-pages-ja-???????? | |
# make実行 | |
expect -c " | |
set timeout 180 | |
spawn make config | |
expect \"Install directory\"; send \"\n\" | |
expect \"select\"; send \"\n\" | |
expect \"uname\"; send \"\n\" | |
expect \"group\"; send \"\n\" | |
while 1 { | |
expect { | |
\"All OK?\" { send \"y\n\" } | |
-nocase \"Y/n\" { send \"\n\" } | |
\"Which to install\" { send \"\n\" } | |
\"make install\" { exit 0 } | |
} | |
} | |
" | |
# install | |
sudo make install | |
# 後片付け | |
cd && rm -fr $TEMP_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JM Projectのインストール自動化スクリプトです
UbuntuのDocker上で動作確認した際に以下のパッケージをインストールしたので
使用する際は依存関係として確認して下さい。
使い方は
curl RawのURL | bash -
で実行されます
インストール実行時に
sudo make install
するのでsudoが使えるユーザにて実行して下さい