目次
文書の過去の版を表示しています。
OpenLiteSpeed ビルドスクリプトの Fedora 対応🤤
Install OpenLiteSpeed from Source with Build Script for OLS 1.6 and above – OpenLiteSpeed
2022/09/27 時点の内容🤔
ソースコードのダウンロード🤤
$ cd ~/work $ git clone --depth 1 https://github.com/litespeedtech/openlitespeed.git
Cloning into 'openlitespeed'... remote: Enumerating objects: 1888, done. remote: Counting objects: 100% (1888/1888), done. remote: Compressing objects: 100% (1739/1739), done. remote: Total 1888 (delta 679), reused 572 (delta 108), pack-reused 0 Receiving objects: 100% (1888/1888), 7.97 MiB | 2.20 MiB/s, done. Resolving deltas: 100% (679/679), done.
現時点の最新ソースコードの LSWS バージョンは…🤔
$ cd openlitespeed $ cat CMakeLists.txt | grep "openlitespeed_.*_VERSION "
set(openlitespeed_MAJOR_VERSION 1) set(openlitespeed_MINOR_VERSION 7) set(openlitespeed_PATCH_VERSION 16)
Linux を最新に更新する🤔
$ sudo dnf update -y
しかし、これは Fedora 36 向けには作られていない😅
$ sudo ./build.sh
OS is Linux, APP_MGR_CMD is dnf. メタデータの期限切れの最終確認: 0:22:36 時間前の 2022年09月27日 06時27分22秒 に実施しました。 依存関係が解決しました。 行うべきことはありません。 完了しました! メタデータの期限切れの最終確認: 0:22:43 時間前の 2022年09月27日 06時27分22秒 に実施しました。 一致した引数がありません: epel-release エラー: 一致するものが見つかりません: epel-release This script only works on 7/8/9 for centos family._Static_assert
This script only works on 7/8/9 for centos family._Static_assert このスクリプトは、centos ファミリの 7/8/9 でのみ機能します。_Static_assert😥
build.sh の修正
Fedora で動作しない原因を探る
まずは、シェルスクリプトをバックアップします…🤔
$ cp build.sh build.sh.org
シェルスクリプトを直します…🤔
直すには動きを理解する必要があるので、bash -x
でシェルスクリプトの実行順序を調べる🤤
/bin/sh → bash /bin/sh
は bash
へのシンボルリンクなので /bin/sh -x
に直すだけです😉
$ nano build.sh
#!/bin/sh
↓
#!/bin/sh -x
$ ll /bin/sh
lrwxrwxrwx. 1 root root 4 1月 20 2022 /bin/sh -> bash
直したシェルスクリプトを実行します🤤
$ sudo ./build.sh
+ VERSION=1.0.1 + moduledir='modreqparser modinspector uploadprogress ' ++ uname + OS=Linux ++ arch + ARCH=x86_64 + ISLINUX=no + VERSIONNUMBER= + '[' Linux = FreeBSD ']' + '[' Linux = Linux ']' + APP_MGRS='apt apt-get dnf yum zypper apk' + APP_MGR_CMD= + for APP_MGR in ${APP_MGRS} ++ which apt + APP_MGR_CHECK= + '[' 1 -eq 0 ']' + for APP_MGR in ${APP_MGRS} ++ which apt-get + APP_MGR_CHECK= + '[' 1 -eq 0 ']' + for APP_MGR in ${APP_MGRS} ++ which dnf + APP_MGR_CHECK= + '[' 0 -eq 0 ']' + APP_MGR_CMD=dnf + break + echo OS is Linux, APP_MGR_CMD is dnf. OS is Linux, APP_MGR_CMD is dnf. + '[' xdnf = x ']' ++ dirname ./build.sh + cd . ++ pwd + CURDIR=/home/tomoyan/work/openlitespeed + '[' Linux = FreeBSD ']' + '[' Linux = Linux ']' + ISLINUX=yes + prepareLinux + OSTYPE=unknownlinux + '[' -f /etc/redhat-release ']' + OSTYPE=CENTOS + yum update -y メタデータの期限切れの最終確認: 0:34:56 時間前の 2022年09月27日 22時02分24秒 に実施しました。 + yum install -y epel-release メタデータの期限切れの最終確認: 0:37:46 時間前の 2022年09月27日 22時02分24秒 に実施しました。 一致した引数がありません: epel-release エラー: 一致するものが見つかりません: epel-release ++ cat /etc/redhat-release + output='Fedora release 36 (Thirty Six)' + echo Fedora release 36 '(Thirty' 'Six)' + grep ' 7.' + echo Fedora release 36 '(Thirty' 'Six)' + grep ' 8.' + echo Fedora release 36 '(Thirty' 'Six)' + grep ' 9.' + '[' CENTOS = CENTOS7 ']' + '[' CENTOS = CENTOS8 ']' + '[' CENTOS = CENTOS9 ']' + echo This script only works on 7/8/9 for centos family._Static_assert This script only works on 7/8/9 for centos family._Static_assert + exit 1
最低限の対応でスクリプトをデバッグする
$ diff build.sh build.sh.org
1c1 < #!/bin/sh -x --- > #!/bin/sh 162c162 < #yum install -y epel-release --- > yum install -y epel-release 164,166c164 < if echo $output | grep "Fedora"; then < OSTYPE=FEDORA < elif echo $output | grep " 7."; then --- > if echo $output | grep " 7."; then 174,177d171 < if [ ! "${OSTYPE}" = "FEDORA" ] ; then < yum install -y epel-release < fi < 193,194c187 < #elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then < elif [ "${OSTYPE}" = "FEDORA" ] || ["${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then --- > elif [ "${OSTYPE}" = "CENTOS8" ] || [ "${OSTYPE}" = "CENTOS9" ] ; then
シェルスクリプトのデバッグ…🤔
001 最低限の対応スクリプト (実行結果)🤤
golang パッケージがインストールされていない🤔
-- Checking for module 'libunwind-generic' -- Package 'libunwind-generic', required by 'virtual:world', not found libunwind not found. Disabling unwind tests. CMake Error at CMakeLists.txt:51 (message): Could not find Go -- Configuring incomplete, errors occurred!
autoheader は autoconf パッケージに含まれる…🤔
go で golang パッケージがインストールされない…😢
※以下を修正すると clang、llvm もインストールされるようになる😍
198c207,208 < yum -y install libtool autoconf autoheader automake wget go clang patch expat-devel --- > #yum -y install libtool autoconf autoheader automake wget go clang patch expat-devel > yum -y install libtool autoconf automake wget golang clang patch expat-devel
Fedora 対応後のビルドスクリプト
修正後の build.sh は、以下の内容です🤤
Fedora 対応 + ビルド時間短縮スクリプト
Git の shallow clone で最新履歴のみを取得するようにしただけです😅
シャロークローン (shallow clone) [git clone --depth 1] - Git - 分散型バージョン管理システム
参考文献
付録
OpenLiteSpeedをFedora向けに直してみるよ!
epel-releaseパッケージが無い...🤔AlmaLinux、CentOS、Debian 、Ubuntuでのビルドしか想定されていないのかも😇
Development Tools パッケージ グループの内容
$ dnf groupinfo "Development Tools"
メタデータの期限切れの最終確認: 0:00:28 時間前の 2022年09月28日 06時04分15秒 に実施しました。 グループ: 開発ツール 説明: These tools include general development tools such as git and CVS. 必須なパッケージ: gettext 標準パッケージ: diffstat doxygen git patch patchutils subversion systemtap オプション パッケージ: buildbot colordiff cvs cvs2cl cvsgraph cvsps darcs dejagnu expect gambas3-ide git-annex git-cola git2cl gitg gtranslator highlight lcov manedit meld monotone myrepos nemiver qgit quilt rapidsvn rcs robodoc scanmem subunit svn2cl tig tkcvs tortoisehg translate-toolkit utrac