php定制rpm包支持fpm---spec的书写
安装epel源
- yum install libmcrypt-devel mhash-devel mcrypt gettext glibc-common gd-devel \
- pcre-devel openldap-devel t1lib-devel icu libicu-devel libtidy-devel
- Name: php
- Version: 5.3.21
- Release: 1%{?dist}
- Summary: PHP is a widely-used general-purpose scripting
- Vendor: itnihao@qq.com
- language.
- Group: Development/Languages
- License: PHP License v3.01
- URL: http://www.php.net
- Source0: http://www.php.net/distributions/php-%{version}.tar.bz2
- #Source1: %{name}.conf
- #Source2: %{name}.ini
- #Source3: %{name}-fpm.conf
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
- Obsoletes: php
- BuildRequires: make
- BuildRequires: bzip2 >= 1.0.2-4
- BuildRequires: curl-devel >= 7.19.7
- BuildRequires: gd-devel >= 2.0.35
- BuildRequires: libmcrypt-devel >= 2.5.8-2
- BuildRequires: glibc-common >= 2.12
- BuildRequires: mhash-devel >= 0.9
- BuildRequires: mcrypt >= 2.6
- BuildRequires: libtool-ltdl-devel >= 1.5.26-1
- BuildRequires: libxml2-devel >= 2.6.32-2
- BuildRequires: openldap-devel >= 2.4.23
- BuildRequires: openssl-devel >= 0.9.8
- BuildRequires: pcre-devel >= 7.8-2
- BuildRequires: t1lib-devel >= 5.1.2-1
- BuildRequires: zlib-devel >= 1.2.3-3
- %description
- PHP is a widely-used general-purpose scripting language that is especially
- suited for Web development and can be embedded into HTML.
- %prep
- %setup -q -n %{name}-%{version}
- %build
- EXTENSION_DIR=%{_libdir}/php/modules; export EXTENSION_DIR
- %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
- make %{?_smp_mflags}
- %install
- [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf %{buildroot}
- mkdir -p %{buildroot}%{_initrddir}
- install -Dp -m0755 sapi/fpm/init.d.php-fpm.in %{buildroot}%{_initrddir}/php-fpm
- %{__make} install INSTALL_ROOT="%{buildroot}"
- %clean
- [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf %{buildroot}
- %post
- /sbin/chkconfig --add php-fpm
- /sbin/chkconfig --level 2345 php-fpm on
- %preun
- if [ "$1" = 0 ] ; then
- /sbin/service php-fpm stop > /dev/null 2>&1
- /sbin/chkconfig --del php-fpm
- fi
- exit 0
- %postun
- if [ "$1" -ge 1 ]; then
- /sbin/service php-fpm condrestart > /dev/null 2>&1
- fi
- exit 0
- %files
- %defattr(-,root,root,-)
- %{_bindir}/*
- %{_sbindir}/*
- %{_includedir}/*
- %{_libdir}/*
- %{_mandir}/man1/php*
- %{_sysconfdir}/*
- %{_datadir}/*
- %{_initrddir}/*
- %exclude /.channels
- %exclude /.depdb
- %exclude /.depdblock
- %exclude /.filemap
- %exclude /.lock
- %changelog
- * Fri Jan 25 2013 Itnihao build - 5.3.21-1 <itnihao@qq.com>
- * Wed Dec 21 2011 Mike Willbanks - 5.3.8-1
- - Updated to 5.3.8
- * Tue Feb 23 2011 Mike Willbanks - 5.3.5-1
- - Initial Package
本文转自it你好 51CTO博客,原文链接:http://blog.51cto.com/itnihao/1127500,如需转载请自行联系原作者