大家會不會有遇到tar.gz的檔案要編譯成RPM的需求咧?

底下是小弟實作的結果

以bind-9.6.1-P1.tar.gz為例

step1.
先下載安裝一個東西 checkinstall
http://www.asic-linux.com.mx/~izto/checkinstall/download.php
用tarball或是rpm安裝均可

step2.
解開你要的tarball
#tar -xzvf bind-9.6.1-P1.tar.gz
<解開過程略>

step3.
進到你剛剛解開的目錄
#cd bind-9.6.1-P1

step4.
執行 configure
#./configure

step5
確認沒有錯誤訊息後
執行make
#make

step6
確認make也沒有錯誤訊息後
執行.....
checkinstall <==不是make install喔!!!!

過程如下
# checkinstall

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran This software is released under the GNU GPL.

The checkinstallrc file was not found at:
/usr/local/lib/checkinstall/checkinstallrc

Assuming default values.

The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]:y <==確認一下,按下enter確認
Preparing package documentation...OK

Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R<<==
這裡會問你說要編譯成slackware(S), RPM(R)或是Debian (D)? 當然是選R啦,按下enter確定

Please write a description for the package.
End your description with an empty line or EOF.
>> ((這裡可以填入你對這個RPM檔案的描述,描述結束後按下enter確定))

**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values:

1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ bind-9.6.1 ]
3 - Version: [ P1 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ bind-9.6.1-P1 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ bind-9.6.1 ]

Enter a number to change any of them or press ENTER to continue: 看看這裡有沒有你還想要更改的資訊,可以輸入你想要更改資訊前面的號碼,如果沒有要更改就直接按下enter確定

接下來就是一連串冗長的編譯過程~~~((略))

最後會出現這幾行~~表示正要完成編譯囉

Copying files to the temporary directory...OK

Striping ELF binaries...OK

Compressing man pages...OK

Building file list...OK

Building RPM package...OK

NOTE: The package will not be installed

Erasing temporary files...OK

Deleting doc-pak directory...OK

Writing backup package...OK

Deleting temp dir...OK


**********************************************************************

Done. The new package has been saved to

/usr/src/redhat/RPMS/i386/bind-9.6.1-P1-1.i386.rpm
You can install it in your system anytime using:

rpm -i bind-9.6.1-P1-1.i386.rpm

**********************************************************************

上面那串*框框裡面的資訊就是說~你的RPM已經OK囉~放在/usr/src/redhat/RPMS/i386底下~~~~大成功

有任何問題也請提出喔^^Y

ps...rpm -ivh <套件名稱>.rpm的時候
或許會出現md5 mismatch的錯誤訊息
建議用底下的參數解決
rpm -ivh --nomd5 <套件名稱>.rpm


來源:奇科電腦 資訊部經理 Toni Lin  http://forum.geego.com.tw/forums/

arrow
arrow
    全站熱搜

    台灣 富捷IT培訓 發表在 痞客邦 留言(0) 人氣()