RedHatEL5.6のPHP5.3を野良コンパイル

先日、RedHatEL5.6がリリースされた。

php53というパッケージが追加され、EL6に移行しなくてもPHP5.3が使えるようになる。

CentOS5.6が待てないので、とりあえずRedHatのphp53パッケージをCentOS5.5で野良コンパイルしてみた。
CentOS5.6にアップデートしてもたぶん大丈夫だろう。

SRPMをダウンロードしてくる

ここらへんから
http://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/
php53-5.3.3-1.el5.src.rpm

野良コンパイルの準備

一般ユーザーの場合は↓参照
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/952rpmbuild.html

ビルドコマンド実行

$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm
warning: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID 37017186
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
error: Failed build dependencies:
        bzip2-devel is needed by php53-5.3.3-1.el5.x86_64
        curl-devel >= 7.9 is needed by php53-5.3.3-1.el5.x86_64
        db4-devel is needed by php53-5.3.3-1.el5.x86_64
        gmp-devel is needed by php53-5.3.3-1.el5.x86_64
        httpd-devel >= 2.0.46-1 is needed by php53-5.3.3-1.el5.x86_64
        pam-devel is needed by php53-5.3.3-1.el5.x86_64
        openssl-devel is needed by php53-5.3.3-1.el5.x86_64
        sqlite-devel is needed by php53-5.3.3-1.el5.x86_64
        zlib-devel is needed by php53-5.3.3-1.el5.x86_64
        pcre-devel >= 6.6 is needed by php53-5.3.3-1.el5.x86_64
        libtool >= 1.4.3 is needed by php53-5.3.3-1.el5.x86_64
        krb5-devel is needed by php53-5.3.3-1.el5.x86_64
        libc-client-devel is needed by php53-5.3.3-1.el5.x86_64
        cyrus-sasl-devel is needed by php53-5.3.3-1.el5.x86_64
        openldap-devel is needed by php53-5.3.3-1.el5.x86_64
        mysql-devel >= 4.1.0 is needed by php53-5.3.3-1.el5.x86_64
        postgresql-devel is needed by php53-5.3.3-1.el5.x86_64
        unixODBC-devel is needed by php53-5.3.3-1.el5.x86_64
        libxml2-devel is needed by php53-5.3.3-1.el5.x86_64
        net-snmp-devel is needed by php53-5.3.3-1.el5.x86_64
        libxslt-devel >= 1.0.18-1 is needed by php53-5.3.3-1.el5.x86_64
        libxml2-devel >= 2.4.14-1 is needed by php53-5.3.3-1.el5.x86_64
        libXpm-devel is needed by php53-5.3.3-1.el5.x86_64
        libjpeg-devel is needed by php53-5.3.3-1.el5.x86_64
        libpng-devel is needed by php53-5.3.3-1.el5.x86_64
        freetype-devel is needed by php53-5.3.3-1.el5.x86_64
        aspell-devel >= 0.50.0 is needed by php53-5.3.3-1.el5.x86_64
        libicu-devel >= 3.6 is needed by php53-5.3.3-1.el5.x86_64

なんかいっぱい要求されたw
warning〜は気にしなくていいらしい。

とりあえず、rootになって要求されたパッケージインストール

# yum install -y bzip2-devel curl-devel db4-devel gmp-devel httpd-devel pam-devel openssl-devel sqlite-devel zlib-devel  pcre-devel libtool krb5-devel libc-client-devel cyrus-sasl-devel openldap-devel mysql-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel libXpm-devel libjpeg-devel libpng-devel freetype-devel aspell-devel libicu-devel

再度コンパイル実行
$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm

まだ何か足りなさそう。

checking for bison... no
checking for byacc... no
checking for bison version... invalid
configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 (found: none).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

#  yum install bison byacc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: ftp.riken.jp
 * base: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
Setting up Install Process
Resolving Dependencies
    • > Running transaction check
      • > Package bison.x86_64 0:2.3-2.1 set to be updated
      • > Package byacc.x86_64 0:1.9-29.2.2 set to be updated
    • > Finished Dependency Resolution

re2cも入れておく

# wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
# tar xfz re2c-0.13.5.tar.gz
# cd re2c-0.13.5
# ./configure
# make
# make install

なんかまだPHPのチェックでエラーでてる・・・
えい。めんどくさい。開発関係ぜんぶいれてやれ。

# yum groupinstall "Development Tools"
# yum groupinstall "Development Libraries"
$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm
(省略)
=====================================================================
FAILED TEST SUMMARY
                                                                                                                                        • -
Testing php_egg_logo_guid() function [tests/basic/php_egg_logo_guid.phpt] Class constant whose initial value refereces a non-existent class [tests/classes/constants_error_004.phpt] easter_date() [ext/calendar/tests/easter_date.phpt] unixtojd() [ext/calendar/tests/unixtojd.phpt] timezone_abbreviations_list() tests [ext/date/tests/010.phpt] Test DateTime::modify() function : usage variation - Passing unexpected values to first argument $modify. [ext/date/tests/DateTime_modify_variation1.phpt] Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts) [ext/date/tests/bug33415-2.phpt] Bug #48187 (DateTime::diff() corrupting microtime() result) [ext/date/tests/bug48187.phpt] Bug #50475 (DateTime::setISODate followed by DateTime::setTime) [ext/date/tests/bug50475.phpt] Bug #51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error) [ext/date/tests/bug51819.phpt] Bug #51994 (date_parse_from_format is parsing invalid date using 'yz' format) [ext/date/tests/bug51994.phpt] Bug #52290 (setDate, setISODate, setTime works wrong when DateTime created from timestamp) [ext/date/tests/bug52290.phpt] Test date_modify() function : usage variation - Passing unexpected values to second argument $format. [ext/date/tests/date_modify_variation2.phpt] Test timezone_abbreviations_list() function : basic functionality [ext/date/tests/timezone_abbreviations_list_basic1.phpt] timezone_location_get: Test that timezone_location_get returns a correct array of information [ext/date/tests/timezone_location_get.phpt] Feature Request #50283 (allow base in gmp_strval to use full range: 2 to 62, and -2 to -36) [ext/gmp/tests/bug50283.phpt] Bug #41638 (pcre 7.0 regression) [ext/pcre/tests/bug41638.phpt] Bug #42298 (pcre gives bogus results with /u) [ext/pcre/tests/bug42298.phpt] ReflectionClass::getConstructor() [ext/reflection/tests/ReflectionClass_getConstructor_basic.phpt] ReflectionMethod::isConstructor() [ext/reflection/tests/ReflectionMethod_constructor_basic.phpt] ReflectionObject::getConstructor() - basic function test [ext/reflection/tests/ReflectionObject_getConstructor_basic.phpt] a script should not be able to modify session.use_trans_sid [ext/session/tests/014.phpt] use_trans_sid should not affect SID [ext/session/tests/015.phpt] rewriter correctly handles attribute names which contain dashes [ext/session/tests/018.phpt] rewriter uses arg_seperator.output for modifying URLs [ext/session/tests/020.phpt] rewriter handles form and fieldset tags correctly [ext/session/tests/021.phpt] Bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n) [ext/session/tests/bug36459.phpt] Bug #41600 (url rewriter tags doesn't work with namespaced tags) [ext/session/tests/bug41600.phpt] Test session_encode() function : error functionality [ext/session/tests/session_encode_error2.phpt] SimpleXML: XPath [ext/simplexml/tests/008.phpt] Bug #51615 (PHP crash with wrong HTML in SimpleXML) [ext/simplexml/tests/bug51615.phpt] Test fscanf() function: usage variations - unsigned int formats with integer values [ext/standard/tests/file/fscanf_variation39.phpt] Test fscanf() function: usage variations - tracking file pointer while reading [ext/standard/tests/file/fscanf_variation55.phpt] Bug #44394 (Last two bytes missing from output) with session.use_trans_id [ext/standard/tests/general_functions/bug44394_2.phpt] htmlentities() / html_entity_decode() #8592 - #9002 table test [ext/standard/tests/strings/htmlentities17.phpt] Test sscanf() function : basic functionality - unsigned format [ext/standard/tests/strings/sscanf_basic6.phpt] ===================================================================== ===================================================================== EXPECTED FAILED TEST SUMMARY
                                                                                                                                        • -
output buffering - fatalism [tests/output/ob_011.phpt] Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt] Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt] Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt] SimpleXML: array casting bug [ext/simplexml/tests/034.phpt] Bug #39863 (file_exists() silently truncates after a null byte) [ext/standard/tests/file/bug39863.phpt] =====================================================================

なんかテストまだエラーでてるけど・・・。ま、いっか。
とりあえず、rpmはできたので。

$ cd ../RPMS
$ ll -G -g
total 13332
-rw-r--r-- 1 4345396 Jan 27 16:06 php53-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1   85009 Jan 27 16:06 php53-bcmath-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1 2751789 Jan 27 16:06 php53-cli-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1 1247899 Jan 27 16:06 php53-common-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  137380 Jan 27 16:06 php53-dba-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  611538 Jan 27 16:06 php53-devel-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  347931 Jan 27 16:06 php53-gd-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  113370 Jan 27 16:06 php53-imap-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  343364 Jan 27 16:06 php53-intl-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1   69120 Jan 27 16:06 php53-ldap-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1 1535891 Jan 27 16:06 php53-mbstring-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  313225 Jan 27 16:06 php53-mysql-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  122708 Jan 27 16:06 php53-odbc-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  178956 Jan 27 16:06 php53-pdo-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  185038 Jan 27 16:06 php53-pgsql-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  105595 Jan 27 16:06 php53-process-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1   43657 Jan 27 16:06 php53-pspell-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1   48589 Jan 27 16:06 php53-snmp-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  382597 Jan 27 16:06 php53-soap-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  427156 Jan 27 16:06 php53-xml-5.3.3-1.el5.x86_64.rpm
-rw-r--r-- 1  143052 Jan 27 16:06 php53-xmlrpc-5.3.3-1.el5.x86_64.rpm

php-mcryptはサポートされてないんだ・・・。
ショボーン(´・ω・`)

とりあえずできたものはこの辺に保存。
ftp://ns.cool-creators.com/pub/centos/5/RPMS/