Apache 2.2.17 のsource から rpmbuild を使って パッケージを作成。 [apache 2.2]
sourceからインストールしたApacheをパッケージにして保存しておきたかったので
rpmbuild コマンドを使ってみたっす。
今までの知識では、src.rpm から作り直す事しか知らなかったのですが、オリジナルの
source から作れるということで、ちょっと食いつきました。
rpmbuild のオプションで -ta, -tb というものがある事を知った。
今回、src.rpmは必要ないので、 -tbオプションを使います。
テストとして、ダウンロードしてきたそのまんまのsourceを試してみることにした。
httpd-2.2.17.tar.bz2 を /usr/src/redhat/SOURCES/ にアップ。
移動。
------------------------------------------------------------------------
# cd /usr/src/redhat/SOURCES/
------------------------------------------------------------------------
早速実行。
------------------------------------------------------------------------
# rpmbuild -tb httpd-2.2.17.tar.bz2
エラー: ファイル /usr/src/redhat/SOURCES/src/httpd-2.2.17.tar.gz: そのようなファイルやディレクトリはありません
------------------------------------------------------------------------
へぇ??
原因判明。source を展開したときに出来る、httpd-2.2.17/httpd.spec に書いてある
これか!
------------------------------------------------------------------------
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
------------------------------------------------------------------------
面倒だけど、解凍 & 圧縮やり直し。 ファイル名を httpd-2.2.17.tar.gz にしてリトライ!
すると、
------------------------------------------------------------------------
checking whether Distcache is required... yes (specified)
checking distcache/dc_client.h usability... no
checking distcache/dc_client.h presence... no
checking for distcache/dc_client.h... no
configure: error: distcache support failed: can't include distcache headers
エラー: /var/tmp/rpm-tmp.23669 の不正な終了ステータス (%build)
RPM ビルドエラー:
/var/tmp/rpm-tmp.23669 の不正な終了ステータス (%build)
------------------------------------------------------------------------
distcache を include 出来ないといってる。 へぇ~ こんなのが必要なんだ。
distcache パッケージ関連を追加しましょ。 そしてリトライ。
------------------------------------------------------------------------
・
・
・
伸張ファイルの検査中: /usr/lib/rpm/check-files /var/tmp/httpd-2.2.17-1-root
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-devel-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-manual-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/mod_ssl-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-debuginfo-2.2.17-1.x86_64.rpm
実行中(%clean): /bin/sh -e /var/tmp/rpm-tmp.20526
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd httpd-2.2.17
+ rm -rf /var/tmp/httpd-2.2.17-1-root
+ exit 0
------------------------------------------------------------------------
おーっと! さっくり終了。 こんなに簡単なのかい!
/usr/src/redhat/RPMS/x86_64/ 配下を見てみると、ご丁寧に複数のパッケージに
分けて作成されてます。
こんな感じ。
------------------------------------------------------------------------
# ls /usr/src/redhat/RPMS/x86_64/
httpd-2.2.17-1.x86_64.rpm
httpd-debuginfo-2.2.17-1.x86_64.rpm
httpd-devel-2.2.17-1.x86_64.rpm
httpd-manual-2.2.17-1.x86_64.rpm
mod_ssl-2.2.17-1.x86_64.rpm
------------------------------------------------------------------------
うまくいったので、本番をやりましょ。
configure , make , make install を実行した httpd-devel-2.2.17 ディレクトリを
tar.gz で固めて/usr/src/redhat/SOURCES/に配置。
さぁ実行!
------------------------------------------------------------------------
# rpmbuild -tb httpd-2.2.17.tar.gz
・
・
・
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:35:23: error: test_char.h: No such file or directory
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c: In function 'log_escape':
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: 'test_char_table' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: for each function it appears in.)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: 'T_ESCAPE_FORENSIC' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c: In function 'count_string':
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:154: error: 'test_char_table' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:154: error: 'T_ESCAPE_FORENSIC' undeclared (first use in this function)
make[4]: *** [mod_log_forensic.slo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules/loggers'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules/loggers'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork'
make: *** [all-recursive] Error 1
エラー: /var/tmp/rpm-tmp.11443 の不正な終了ステータス (%build)
RPM ビルドエラー:
/var/tmp/rpm-tmp.11443 の不正な終了ステータス (%build)
------------------------------------------------------------------------
ぶっ! 怒られた。
意味は分かんないけど、make してるからかな? と、システムエンジニアの勘が
そう感じたので一度 make clean してやり直してみる。
うりゃ~ とリトライしたら、またもやさっくり成功~~
便利だ~
内容確認。
------------------------------------------------------------------------
# rpm -qlp httpd-2.2.17-1.x86_64.rpm
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf/extra/httpd-autoindex.conf
・
・
・
------------------------------------------------------------------------
おや、/usr/local/apache2 じゃないっすね。
いくらSE経験が長いとはいえ、未経験分野の無知度というのは恐ろしい。。
SPECファイルの内容にしたがってrpm を作成しているということを知らなかった。
という事で、ApacheのSPECファイル、http.specを編集して configureオプションと同様に
インストール出来るSPECファイルの作成に挑戦l。
かなり苦戦です。かなりいいところまでは行ったのですが、Try & Error でかなりくたびれました。
挫折しかけているときに、checkinstall というアプリを発見! こんなのがほしかった。
まさにこれじゃ!
インストールして確認してみよっと。
という事で、SPECファイルで何とかするのは一旦諦めることにしました。
でもSPECファイルの書き方はいい勉強になりました。
rpmbuild コマンドを使ってみたっす。
今までの知識では、src.rpm から作り直す事しか知らなかったのですが、オリジナルの
source から作れるということで、ちょっと食いつきました。
rpmbuild のオプションで -ta, -tb というものがある事を知った。
今回、src.rpmは必要ないので、 -tbオプションを使います。
テストとして、ダウンロードしてきたそのまんまのsourceを試してみることにした。
httpd-2.2.17.tar.bz2 を /usr/src/redhat/SOURCES/ にアップ。
移動。
------------------------------------------------------------------------
# cd /usr/src/redhat/SOURCES/
------------------------------------------------------------------------
早速実行。
------------------------------------------------------------------------
# rpmbuild -tb httpd-2.2.17.tar.bz2
エラー: ファイル /usr/src/redhat/SOURCES/src/httpd-2.2.17.tar.gz: そのようなファイルやディレクトリはありません
------------------------------------------------------------------------
へぇ??
原因判明。source を展開したときに出来る、httpd-2.2.17/httpd.spec に書いてある
これか!
------------------------------------------------------------------------
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
------------------------------------------------------------------------
面倒だけど、解凍 & 圧縮やり直し。 ファイル名を httpd-2.2.17.tar.gz にしてリトライ!
すると、
------------------------------------------------------------------------
checking whether Distcache is required... yes (specified)
checking distcache/dc_client.h usability... no
checking distcache/dc_client.h presence... no
checking for distcache/dc_client.h... no
configure: error: distcache support failed: can't include distcache headers
エラー: /var/tmp/rpm-tmp.23669 の不正な終了ステータス (%build)
RPM ビルドエラー:
/var/tmp/rpm-tmp.23669 の不正な終了ステータス (%build)
------------------------------------------------------------------------
distcache を include 出来ないといってる。 へぇ~ こんなのが必要なんだ。
distcache パッケージ関連を追加しましょ。 そしてリトライ。
------------------------------------------------------------------------
・
・
・
伸張ファイルの検査中: /usr/lib/rpm/check-files /var/tmp/httpd-2.2.17-1-root
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-devel-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-manual-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/mod_ssl-2.2.17-1.x86_64.rpm
書き込み完了: /usr/src/redhat/RPMS/x86_64/httpd-debuginfo-2.2.17-1.x86_64.rpm
実行中(%clean): /bin/sh -e /var/tmp/rpm-tmp.20526
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd httpd-2.2.17
+ rm -rf /var/tmp/httpd-2.2.17-1-root
+ exit 0
------------------------------------------------------------------------
おーっと! さっくり終了。 こんなに簡単なのかい!
/usr/src/redhat/RPMS/x86_64/ 配下を見てみると、ご丁寧に複数のパッケージに
分けて作成されてます。
こんな感じ。
------------------------------------------------------------------------
# ls /usr/src/redhat/RPMS/x86_64/
httpd-2.2.17-1.x86_64.rpm
httpd-debuginfo-2.2.17-1.x86_64.rpm
httpd-devel-2.2.17-1.x86_64.rpm
httpd-manual-2.2.17-1.x86_64.rpm
mod_ssl-2.2.17-1.x86_64.rpm
------------------------------------------------------------------------
うまくいったので、本番をやりましょ。
configure , make , make install を実行した httpd-devel-2.2.17 ディレクトリを
tar.gz で固めて/usr/src/redhat/SOURCES/に配置。
さぁ実行!
------------------------------------------------------------------------
# rpmbuild -tb httpd-2.2.17.tar.gz
・
・
・
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:35:23: error: test_char.h: No such file or directory
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c: In function 'log_escape':
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: 'test_char_table' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: for each function it appears in.)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:126: error: 'T_ESCAPE_FORENSIC' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c: In function 'count_string':
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:154: error: 'test_char_table' undeclared (first use in this function)
/usr/src/redhat/BUILD/httpd-2.2.17/modules/loggers/mod_log_forensic.c:154: error: 'T_ESCAPE_FORENSIC' undeclared (first use in this function)
make[4]: *** [mod_log_forensic.slo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules/loggers'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules/loggers'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/httpd-2.2.17/prefork'
make: *** [all-recursive] Error 1
エラー: /var/tmp/rpm-tmp.11443 の不正な終了ステータス (%build)
RPM ビルドエラー:
/var/tmp/rpm-tmp.11443 の不正な終了ステータス (%build)
------------------------------------------------------------------------
ぶっ! 怒られた。
意味は分かんないけど、make してるからかな? と、システムエンジニアの勘が
そう感じたので一度 make clean してやり直してみる。
うりゃ~ とリトライしたら、またもやさっくり成功~~
便利だ~
内容確認。
------------------------------------------------------------------------
# rpm -qlp httpd-2.2.17-1.x86_64.rpm
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf/extra/httpd-autoindex.conf
・
・
・
------------------------------------------------------------------------
おや、/usr/local/apache2 じゃないっすね。
いくらSE経験が長いとはいえ、未経験分野の無知度というのは恐ろしい。。
SPECファイルの内容にしたがってrpm を作成しているということを知らなかった。
という事で、ApacheのSPECファイル、http.specを編集して configureオプションと同様に
インストール出来るSPECファイルの作成に挑戦l。
かなり苦戦です。かなりいいところまでは行ったのですが、Try & Error でかなりくたびれました。
挫折しかけているときに、checkinstall というアプリを発見! こんなのがほしかった。
まさにこれじゃ!
インストールして確認してみよっと。
という事で、SPECファイルで何とかするのは一旦諦めることにしました。
でもSPECファイルの書き方はいい勉強になりました。
コメント 0