CentOS 3.4上重新编译php 5 rpm包

发表于:2007-05-26来源:作者:点击数: 标签:
本人在CentOS 3.4上编译php5 srpms的经历,本文对于redhat 9 ,redhat enterprise linux 3同样适用 。 从 Fedora Core Development Source 源中获得php的srpms文件: [hantsy@localhosthantsy]$ proz -k=10 http://download.fedora.redhat.com/pub/fedora/lin
本人在CentOS 3.4上编译php5 srpms的经历,本文对于redhat 9 ,redhat enterprise linux 3同样适用 。


Fedora Core Development Source 源中获得php的srpms文件:

[hantsy@localhost hantsy]$ proz -k=10 http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/php-5.0.4-2.src.rpm

All Done: Download Suclearcase/" target="_blank" >ccesfull!


根据需要我对源代码中的spec作了一些修改,添加oracle oci8支持,sqlite utf-8支持。

安装源代码:
[hantsy@localhost hantsy]$ rpm -ivh php-5.0.4-2.src.rpm
warning: php-5.0.4-2.src.rpm: V3 DSA signature: NOKEY, key ID 30c9ecf8
1:php ########################################### [100%]
[hantsy@localhost hantsy]$


升级系统相关的软件(参考资料1):
httpd 2.0.46 (redhat 9从rhel 3或是CentOS3.4中获得)
file 4.0 fc1
aspell 0.50 aspell-en 0.50(从rhel 4中获得,系统自带的apsell0.33bugs太多,要重新编译aspell相关的包,已知的有gedit,gtkspell,gnome-spell,最新的gaim1.1.x)
curl 7.10 fc1
mysql 4.10a (从www.mysql.com下载rpm包,或者从fedora core development 中获得srpm重新编译)
sqlite 3(fedora core development)
oracle-instantclient-devel-10.1.0.3-1(编译oci8支持需要,www.oracle.com)
oracle-instantclient-basic-10.1.0.3-1(php-oci8支持需要,www.oracle.com)
最新的libxml2 libxslt (www.xmlsoft.org)


重新编译:
[hantsy@localhost hantsy]$cd rpmbuild/SPECS
[hantsy@localhost SPECS]$ sudo rpmbuild -ba php-5.0.4.spec
。。。。。
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/php-root
Wrote: /home/hantsy/rpmbuild/SRPMS/php-5.0.4-2.rh9.src.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-devel-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-pear-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-imap-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-ldap-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-mysql-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-pgsql-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-odbc-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-soap-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-oci8-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-snmp-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-xml-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-xmlrpc-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-mbstring-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-ncurses-5.0.4-2.rh9.i386.rpm
Wrote: /home/hantsy/rpmbuild/RPMS/i386/php-gd-5.0.4-2.rh9.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.26855
+ umask 022
+ cd /home/hantsy/rpmbuild/BUILD
+ cd php-5.0.4
+ '[' /var/tmp/php-root '!=' / ']'
+ rm -rf /var/tmp/php-root
+ rm files.dom files.gd files.imap files.ldap files.mbstring files.mysql files.mysqli files.ncurses files.oci8 files.odbc files.pgsql files.snmp files.soap files.xml files.xmlrpc files.xsl
+ exit 0
[hantsy@localhost SPECS]$



安装编译好的php rpm 包:
[hantsy@localhost SPECS]$ sudo rpm -Uvh ../RPMS/i386/php-*5.0.4-2*
Password:
Preparing... ########################################### [100%]
1:php-xmlrpc ########################################### [ 6%]
2:php-xml ########################################### [ 13%]
3:php-soap ########################################### [ 19%]
4:php-snmp ########################################### [ 25%]
5:php-pgsql ########################################### [ 31%]
6:php-pear ########################################### [ 38%]
7:php-odbc ########################################### [ 44%]
8:php-oci8 ########################################### [ 50%]
9:php-ncurses ########################################### [ 56%]
10:php-mysql ########################################### [ 63%]
11:php-mbstring ########################################### [ 69%]
12:php-ldap ########################################### [ 75%]
13:php-imap ########################################### [ 81%]
14:php-gd ########################################### [ 88%]
15:php-devel ########################################### [ 94%]
16:php ########################################### [100%]


参考资料:
1. 资源站点,所有的srpms或rpms都可以从这里找到。
Fedora Core Development Source RPMS
Redhat Enterprise Linux SRPMS (kernel.org mirror)
Rpmfind
Oracle Instant Client
2.下载我针对redhat 9/CentOS3.4修改过的specs文件specs.tar.gz

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