LoginSignup
1
1

More than 5 years have passed since last update.

srpmでSPECファイル編集してrpm作ってみた

Last updated at Posted at 2015-04-06

参考

現状確認

$ php -i | grep script
mbstring.script_encoding => no value => no value

というのを期待したが、無い。
./configure時に--enable-zend-multibyteをつけないとこの指定が出来ないようだ。

対処

yum install rpm-build
mkdir -p /usr/src/redhat/SOURCES
rpm -ivh php-5.1.6-45.el5_11.src.rpm
vim /usr/src/redhat/SPECS/php.spec
/usr/src/redhat/SPECS/php.spec
    --with-mime-magic=%{_datadir}/file/magic.mime \
    --without-sqlite \
    --with-libxml-dir=%{_prefix} \
    --with-xml \
    --with-system-tzdata \
+   --enable-zend-multibyte \
    $* 
    if test $? != 0; then 
      tail -500 config.log
      : configure failed
      exit 1
yum deplist php
yum install -y aspell-devel bzip2-devel bzip2-libs-devel curl-devel cyrus-sasl-devel db4-devel e2fsprogs-libs-devel expat-devel file-devel freetype-devel gd-devel gmp-devel httpd-devel krb5-devel krb5-libs-devel libc-client-devel libidn-devel libjpeg-devel libpng-devel libtool libxml2-devel libxslt-devel mysql-devel net-snmp-devel openldap-devel openssl-devel pam-devel pcre-devel postgresql-devel smtpdaemon sqlite-devel unixODBC-devel zlib-devel
リビルド
rpmbuild -ba /usr/src/redhat/SPECS/php.spec

buildしたrpmをインストール

cd /usr/src/redhat/RPMS/x86_64/
rpm -ivh php-mbstring-* \
  php-cli-* \
  php-common-* \
  php-pdo-* \
  php-* \
  php-devel-*
/etc/init.d/httpd restart
動作確認
$ php -i | grep script
mbstring.script_encoding => no value => no value

成果物

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1