用rpmbuild打包php
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
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
本文轉自 luoguo 51CTO部落格,原文連結:http://blog.51cto.com/luoguoling/1639293
相關文章
- docker 打包 php 應用DockerPHP
- 將 PHP 應用快速打包為 PHARPHP
- php 打包 zipPHP
- (十三) electron 應用打包
- 拯救php效能的神器webman-打包二進位制PHPWeb
- Android 多包名打包應用Android
- 用Docker打包Python執行環境DockerPython
- Pyinstaller打包用spec新增資原始檔
- PHP - 什麼是 PHP? 為什麼用 PHP? 有誰在用 PHP?PHP
- PHP websocket 應用PHPWeb
- webpack如何打包多頁面應用(mpa)Web
- C#—使用InstallerProjects打包桌面應用程式C#Project
- Erlang/Elixir: 用Distillery替換Exam打包器
- Microsoft Store 桌面應用釋出流程(一)之打包應用ROS
- Kibana 啟用 PHP APMPHP
- 用PHP編寫Android應用程式PHPAndroid
- 用nodejs刪除檔案,資料夾(採用webpack打包時必用)NodeJSWeb
- Android 應用防止被二次打包指南Android
- React Native釋出APP之打包iOS應用React NativeAPPiOS
- Flutter-Android 應用打包相關問題FlutterAndroid
- Parker 輕量級打包工具與容器執行時,一條命令將 php 指令碼打包成可執行檔案PHP指令碼
- Flutter Distributor 用於打包和釋出 Flutter 應用的完整工具Flutter
- 用SAP WebIDE將CRUD Master-Detail應用打包成Hybrid AppWebIDEASTAIAPP
- Cordova 打包 apk,html 打包 apkAPKHTML
- 打包策略 自定義打包配置
- PHP 請求用 cURL 還是用 guzzle?PHP
- php中ThinkPHP的用處PHP
- PHP 用正則分章節PHP
- 用php開一個埠PHP
- Nuget一鍵打包上傳以及高階應用
- 用 GitHub Actions 自動打包釋出 Python 專案GithubPython
- 用pyinstaller打包你的Python程式並繫結CPUPython
- 最佳化Spring Boot應用的Docker打包速度Spring BootDocker
- PHP擴充套件php-redis 用起來so easyPHP套件Redis
- 使用Cordova將您的前端JavaScript應用打包成手機原生應用前端JavaScript
- PHP - 《高效能php應用開發》學習筆記PHP筆記
- 用 PHP-CPP 開發 PHP 擴充套件:raylib-phpcppPHP套件
- 使用Eclipse除錯PHP應用Eclipse除錯PHP
- 用php讀取elf結構PHP