在Redhat 9创建自己的rpm 打包环境

发表于:2007-07-04来源:作者:点击数: 标签:
原文参见:HOWTO: How to create rpmbuild directory 方法1: [h ant sy@localhost hantsy]cd ~ [hantsy@localhost hantsy]mkdir rpmbuild [hantsy@localhost hantsy]cp -a /usr/src/redhat/ rpmbuild [hantsy@localhost hantsy]echo '%_topdir %(echo HOME)/r
原文参见:HOWTO: How to create rpmbuild directory

方法1:
[hantsy@localhost hantsy]$cd ~
[hantsy@localhost hantsy]$mkdir rpmbuild
[hantsy@localhost hantsy]$cp -a /usr/src/redhat/ rpmbuild
[hantsy@localhost hantsy]$echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros
如果不想编译debug包,向.rpmmacros中追加%debug_package %
[hantsy@localhost hantsy]$echo '%debug_package %' >> .rpmmacros

方法2
也可直接安装现成的rpm文件:
[hantsy@localhost hantsy]$sudo rpm -ivh http://download.fedora.us/fedora/fedora/1/i386/RPMS.stable/fedora-rpmdevtools-0.1.7-0.fdr.5.noarch.rpm
[hantsy@localhost hantsy]$fedora-buildrpmtree

使用sudo 取得root权限

编辑/etc/sudoers文件
root ALL=(ALL) ALL
hantsy ALL=(ALL) ALL

例子,重新为redhat 9打AdobeReader 7.0 rpms包 参见 HOWTO: Buiding a custom Adobe Reader 7.0 RPM for FC3

[hantsy@localhost hantsy]$ cd rpmbuild/SOURCE
[hantsy@localhost hantsy]$wget -c linux_enu.tar.gz>ftp://ftp.adobe.com/pub/adobe/reader/unix/7x/7.0/enu/AdbeRdr70_linux_enu.tar.gz
[hantsy@localhost hantsy]$cd ../SPECS
[hantsy@localhost hantsy]$wget -c http://fedoranews.org/tchung/AdobeReader/7.0/AdobeReader.spec
[hantsy@localhost hantsy]$sudo rpmbuild -ba AdobeReader.spec

安装自己的rpm包
[hantsy@localhost hantsy]$sudo rpm -ivh ~/rpmbuild/RPMS/i386/AdobeReader-7.0-1.rh9.i386.rpm


参考资料:
1.你可以从这里下载我修改过的specs文件specs.tar.gz
2.www.fedoranews.org 上有大量有关redhat和fedora的教程。

原文转自:http://www.ltesting.net