有些新的軟體更新,它不見得會跟著推出新的 rpm 檔。
除了使用 tarball 安裝方法,也可以自己包一個 rpm 檔。
環境:RHEL 5.6
安裝必備套件
yum groupinstall "Development Tools" yum install rpmdevtools
you should NEVER build an RPM with the root user.
絕對不要使用 root 來打包 rpm!
建立一個專門打包 rpm 的使用者帳號
useradd rpm_maker
切換成該使用者
su - rpm_maker
在 rpm_maker 的家目錄下執行
rpmdev-setuptree # 會建立 ~/rpmbuild 目錄
下載 Python2.7 原始檔,解壓縮,放置 python-2.7.spec 與原始檔
cd ~ wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tar.bz2 tar jxvf Python-2.7.1.tar.bz2 cp ~/Python-2.7.1/Misc/RPM/python-2.7.spec ~/rpmbuild/SPECS/ mv Python-2.7.1.tar.bz2 ~/rpmbuild/SOURCES/
補足相關套件
yum install tk-devel tcl-devel expat-devel db4-devel gdbm-devel sqlite-devel
根據指定的 spec 建立 rpm 檔
cd ~/rpmbuild/SPECS/ rpmbuild -ba python-2.7.spec
http://blog.milford.io/2012/01/building-and-installing-python-2-7-rpms-on-centos-5-7/
Reference:
01. https://fedoraproject.org/wiki/How_to_create_an_RPM_package/zh-tw
02. http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/
03. http://www.ibm.com/developerworks/library/l-rpm1/
04. http://villaroad.com/2010/10/rolling-python-2-6-2-on-centos-5-3/
05. http://willsani.com/2011/03/02/centos-5-5-x86_64-install-python-2-7/
06. http://www.joywang.info/?p=112
07. http://serverfault.com/questions/11209/python-3-0-rpms-for-centos-5-rhel-5
08. http://serverfault.com/questions/162217/upgrading-python-on-rhel5
09. http://stackoverflow.com/questions/4149361/on-linux-suse-or-redhat-how-do-i-load-python-2-7
沒有留言:
張貼留言