Name: php
Version: 5.3.28
Release: 1%{?dist}
Summary: php
Group: System Environment/Daemons
License: GPL
URL: http://rolin.com/
Source0: http://aa.com/php/%{name}-%{version}.tar.gz
Source1: php.ini
Source2: php-fpm.conf
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: openssl-devel,libmcrypt-devel,freetype-devel,mhash-devel
Requires: openssl,libmcrypt,freetype,libtool-ltdl,mhash,bash
%description
php-fpm
%prep
%setup -q
%build
#export $RPM_BUILD_ROOT
export INSTALL_ROOT=%{buildroot}
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/data/sock/tmp/mysql.sock --with-gd --with-iconv --with-zlib --enable-xml --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --with-pdo-mysql --disable-cli
make ZEND_EXTRA_LIBS='-liconv' %{?_smp_mflags}
#make %{?_smp_mflags}
%install
rm -rf %{buildroot}
#cd /root/rpmbuild/BUILD/php-5.3.28
#make install
make install INSTALL_ROOT=%{buildroot}
#DESTDIR=%{buildroot}
#cd ../../BUILDROOT
#cp -rf ../SOURCES/php.ini ./php-5.3.28-1.x86_64/
cp $RPM_BUILD_DIR/%{name}-%{version}/sapi/fpm/init.d.php-fpm $RPM_BUILD_ROOT/usr/local/php
#mv %{buildroot}/usr/local/php/etc/php-fpm.conf %{buildroot}/usr/local/php/etc/php-fpm.conf.origin
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}/usr/local/php/etc
#mv %{buildroot}/usr/local/php/etc/php.ini %{buildroot}/usr/local/php/etc/php.ini.origin
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}/usr/local/php/etc
cp %{_sourcedir}/php.ini $RPM_BUILD_ROOT/usr/local/php/etc
cp %{_sourcedir}/php-fpm.conf $RPM_BUILD_ROOT/usr/local/php/etc
#cp %{_sourcedir}/php.ini $RPM_BUILD_ROOT%{prefix}/etc
#cp %{_sourcedir}/php-fpm.conf $RPM_BUILD_ROOT%{prefix}/etc
%clean
rm -rf $RPM_BUILD_ROOT/*
%pre
mkdir /usr/local/php
#cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
ln -s /usr/lib64/libpng.* /usr/lib/
ln -s /usr/lib64/libjpeg.* /usr/lib
echo "/lib" >> /etc/ld.so.conf
echo "/usr/lib" >> /etc/ld.so.conf
echo "/usr/lib64" >> /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
%post
a=`grep ZONE= /etc/sysconfig/clock |awk -F"=" '{print $NF}'|cut -d '"' -f2`
sed -i "s#\;date.timezone\ =#date.timezone\ =\ ${a}#g" /usr/local/php/etc/php.ini
#cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
cp /usr/local/php/init.d.php-fpm /etc/rc.d/init.d/php-fpm
chmod a+x /etc/rc.d/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
%preun
#if [ -f %{_sysconfdir}/php.ini ];then
#mv %{_sysconfdir}/php.ini %{_sysconfdir}/php.ini.rpmold
#fi
#if [ -f %{_initddir}/php-fpm ];then
#mv %{_initddir}/php-fpm %{_initddir}/php-fpm.rpmold
#fi
%postun
rm -rf /usr/local/php
%files
%defattr(-,root,root,-)
/usr/local/php/
%doc
#%config(noreplace) /usr/local/php/etc/php.ini
#%config(noreplace) /usr/local/php/etc/php-fpm.conf
#%config(noreplace) /usr/local/php/etc/php-fpm.conf.default
%changelog
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
網(wǎng)站名稱:用rpmbuild打包php-創(chuàng)新互聯(lián)
網(wǎng)址分享:http://jinyejixie.com/article38/dephpp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、App開發(fā)、虛擬主機(jī)、商城網(wǎng)站、營(yíng)銷型網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容