博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
构建自动化运维之基础设施—定制php for fpm 的rpm包
阅读量:6909 次
发布时间:2019-06-27

本文共 3034 字,大约阅读时间需要 10 分钟。

 php定制rpm包支持fpm---spec的书写

安装epel源

 
  1. yum install libmcrypt-devel mhash-devel mcrypt gettext glibc-common gd-devel \
  2. pcre-devel openldap-devel t1lib-devel icu libicu-devel libtidy-devel 
 
  1. Name:           php 
  2. Version:        5.3.21 
  3. Release:        1%{?dist} 
  4. Summary:        PHP is a widely-used general-purpose scripting  
  5. Vendor:         itnihao@qq.com 
  6. language. 
  7.  
  8. Group:          Development/Languages 
  9. License:        PHP License v3.01 
  10. URL:            http://www.php.net 
  11. Source0:        http://www.php.net/distributions/php-%{version}.tar.bz2 
  12. #Source1:        %{name}.conf 
  13. #Source2:        %{name}.ini 
  14. #Source3:        %{name}-fpm.conf 
  15. BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot 
  16.  
  17. Obsoletes:      php 
  18.  
  19. BuildRequires: make 
  20. BuildRequires: bzip2 >= 1.0.2-4 
  21. BuildRequires: curl-devel >= 7.19.7 
  22. BuildRequires: gd-devel >= 2.0.35 
  23. BuildRequires: libmcrypt-devel >= 2.5.8-2 
  24. BuildRequires: glibc-common >= 2.12 
  25. BuildRequires: mhash-devel >= 0.9 
  26. BuildRequires: mcrypt >= 2.6 
  27. BuildRequires: libtool-ltdl-devel >= 1.5.26-1 
  28. BuildRequires: libxml2-devel >= 2.6.32-2 
  29. BuildRequires: openldap-devel >= 2.4.23 
  30. BuildRequires: openssl-devel >= 0.9.8 
  31. BuildRequires: pcre-devel >= 7.8-2 
  32. BuildRequires: t1lib-devel >= 5.1.2-1 
  33. BuildRequires: zlib-devel >= 1.2.3-3 
  34.  
  35. %description 
  36. PHP is a widely-used general-purpose scripting language that is especially 
  37. suited for Web development and can be embedded into HTML. 
  38.  
  39. %prep 
  40. %setup -q -n %{name}-%{version} 
  41. %build 
  42. EXTENSION_DIR=%{_libdir}/php/modules; export EXTENSION_DIR 
  43. %configure  --with-layout=GNU --with-libdir=lib64 --enable-fpm --with-gd --enable-intl --enable-bcmath --enable-mbstring --enable-pcntl --enable-json --enable-soap  --enable-sockets --enable-sqlite-utf8 --enable-zip --with-zlib --with-bz2 --with-curl --with-jpeg-dir --with-freetype-dir --with-png-dir --with-iconv --with-xpm-dir --with-zlib-dir --with-gettext --with-pcre-regex --with-mcrypt --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-tidy=/usr --with-pear=%{_datadir}/php/pear --with-icu-dir=/usr --disable-debug 
  44.  
  45. make %{?_smp_mflags} 
  46.  
  47. %install 
  48. [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf %{buildroot} 
  49. mkdir -p %{buildroot}%{_initrddir} 
  50. install -Dp -m0755 sapi/fpm/init.d.php-fpm.in %{buildroot}%{_initrddir}/php-fpm 
  51. %{__make} install INSTALL_ROOT="%{buildroot}" 
  52.  
  53. %clean 
  54. [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf %{buildroot} 
  55.  
  56. %post 
  57. /sbin/chkconfig --add php-fpm 
  58. /sbin/chkconfig --level 2345 php-fpm on 
  59.  
  60. %preun 
  61. if [ "$1" = 0 ] ; then 
  62.     /sbin/service php-fpm stop > /dev/null 2>&1 
  63.     /sbin/chkconfig --del php-fpm 
  64. fi 
  65. exit 0 
  66.  
  67. %postun 
  68. if [ "$1" -ge 1 ]; then 
  69.     /sbin/service php-fpm condrestart > /dev/null 2>&1 
  70. fi 
  71. exit 0 
  72.  
  73. %files 
  74. %defattr(-,root,root,-) 
  75. %{_bindir}/* 
  76. %{_sbindir}/* 
  77. %{_includedir}/* 
  78. %{_libdir}/* 
  79. %{_mandir}/man1/php* 
  80. %{_sysconfdir}/* 
  81. %{_datadir}/* 
  82. %{_initrddir}/* 
  83. %exclude /.channels 
  84. %exclude /.depdb 
  85. %exclude /.depdblock 
  86. %exclude /.filemap 
  87. %exclude /.lock 
  88.  
  89.  
  90. %changelog 
  91. * Fri Jan 25 2013 Itnihao build   - 5.3.21-1 <itnihao@qq.com> 
  92.  
  93. * Wed Dec 21 2011 Mike Willbanks  - 5.3.8-1 
  94. - Updated to 5.3.8 
  95. * Tue Feb 23 2011 Mike Willbanks  - 5.3.5-1 
  96. - Initial Package 

本spec参考而来

功能测试中,需继续完善,待续……

转载地址:http://fsycl.baihongyu.com/

你可能感兴趣的文章
《ArcGIS Engine+C#实例开发教程》第六讲 右键菜单添加与实现
查看>>
ArrayList与LinkedList区别
查看>>
Linux 学习之路:认识shell和bash
查看>>
POJ 3041(最小点覆盖)
查看>>
Viewing the interface of your Swift code,查看Swift代码的头文件的三种方法
查看>>
Custom Accessories
查看>>
【转】xcode APP 打包以及提交apple审核详细流程(新版本更新提交审核)
查看>>
DirectX 3D 之C#开发
查看>>
隐藏nginx 版本号信息(转)
查看>>
转:Java中的Clone()方法详解
查看>>
ping命令
查看>>
【转】PHP网站(nginx、php-fpm、mysql) 用户权限解析
查看>>
Spring Boot项目的打包和部署
查看>>
元素绝对居中终极办法兼容IE8
查看>>
weblogic 的应用 常见问题处理 db2 链接不上(转载)
查看>>
linux下的Shell编程(5)循环
查看>>
Switch 语句
查看>>
[PHP] 网盘搜索引擎-采集爬取百度网盘分享文件实现网盘搜索(二)
查看>>
二叉堆
查看>>
Java中的Enum的继承
查看>>