sergefonville

SFEphp54 (without underscores in packagenames)

Mar 14th, 2012
295
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # spec file for package SFEphp54
  3. #
  4. # includes module(s): php
  5. #
  6. %include Solaris.inc
  7.  
  8. Name:                    SFEphp54
  9. Version:                 5.4.0
  10. Source:                  http://www.php.net/distributions/php-%{version}.tar.bz2
  11. URL:                     http://www.php.net/
  12. #SUNW_BaseDir:           %{_basedir}
  13. BuildRoot:               %{_tmppath}/%{name}-%{version}-build
  14. %include default-depend.inc
  15. BuildRequires: gnu-gettext
  16. BuildRequires: web/server/apache-22
  17. BuildRequires: mysql-51
  18.  
  19. %define phpsuffix php/5.4
  20. %define _sysconfdir /etc/%{phpsuffix}
  21. %define _prefix /usr/%{phpsuffix}
  22. %define _libexecdir %{_prefix}/modules
  23.  
  24. %package php
  25. Summary: php - Hypertext Preprocessor - general-purpose scripting language for Web development
  26. IPS_package_name: web/php-54
  27. SUNW_Pkg: php
  28. Requires: gnu-gettext
  29. Requires: SUNWpostrun-root
  30.  
  31. %package modphp
  32. Summary: PHP Apache Module
  33. IPS_package_name: web/server/apache-22/module/apache-php54
  34. SUNW_Pkg: modphp
  35. Requires: web/server/apache-22
  36. Requires: web/php-54
  37.  
  38. %prep
  39. %setup -q -c -n php-%version
  40.  
  41. %build
  42. CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
  43. if test "x$CPUS" = "x" -o $CPUS = 0; then
  44.     CPUS=1
  45. fi
  46.  
  47. export LDFLAGS="%{_ldflags}"
  48. export CFLAGS="%optflags"
  49.  
  50. cd php-%version
  51. ./configure                                                     \
  52.         --prefix=%{_prefix}                                     \
  53.         --bindir=%{_prefix}/bin                                 \
  54.         --datadir=%{_datadir}                                   \
  55.         --includedir=%{_includedir}                             \
  56.         --libdir=%{_libdir}                                     \
  57.         --libexecdir=%{_libexecdir}                             \
  58.         --mandir=%{_mandir}                                     \
  59.         --sbindir=%{_sbindir}                                   \
  60.         --sysconfdir=%{_sysconfdir}                             \
  61.         --localstatedir=%{_localstatedir}                       \
  62.         --with-apxs2                                            \
  63.         --enable-fpm                                            \
  64.         --with-config-file-path=%{_sysconfdir}/php.ini          \
  65.         --with-config-file-scan-dir=%{_sysconfdir}/conf.d       \
  66.         --with-pcre-regex                                       \
  67.         --with-zlib                                             \
  68.         --enable-bcmath                                         \
  69.         --with-bz2                                              \
  70.         --with-gd                                               \
  71.         --enable-mbstring                                       \
  72.         --with-mysql                                            \
  73.         --with-mysqli                                           \
  74.         --with-pdo-mysql                                        \
  75.         --enable-sockets                                        \
  76.         --with-pear                                             \
  77.         --with-tsrm-pthreads
  78.  
  79.  
  80.  
  81. make -j$CPUS
  82.  
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85.  
  86. # Create a dummy httpd.conf that apxs will populate.
  87. mkdir -p ${RPM_BUILD_ROOT}`apxs -q SYSCONFDIR`/conf.d
  88. mkdir -p ${RPM_BUILD_ROOT}%{_libexecdir}
  89. echo >${RPM_BUILD_ROOT}`apxs -q SYSCONFDIR`/conf.d/modules-32.load
  90. echo "LoadModule "`apxs -q LIBEXECDIR`"/dummy.so" >> ${RPM_BUILD_ROOT}`apxs -q SYSCONFDIR`/conf.d/modules-32.load
  91.  
  92. cd php-%version
  93. make install INSTALL_ROOT=${RPM_BUILD_ROOT}
  94.  
  95. cp php.ini-production ${RPM_BUILD_ROOT}%{_sysconfdir}/php.ini
  96.  
  97. export modules32load="${RPM_BUILD_ROOT}`apxs -q SYSCONFDIR`/conf.d/modules-32.load"
  98. # Remove the dummy line and rename the file.
  99. export loadmodule="$(awk '!/dummy/ {print}' $modules32load | grep -vE '^$' | sed -e "s:${RPM_BUILD_ROOT}::g")"
  100. echo $loadmodule >  $modules32load
  101. # Remove the generated files.
  102. #rm -rf ${RPM_BUILD_ROOT}`apxs -q SYSCONFDIR`/conf.d
  103.  
  104. # Remove files and dirs that should probably be re-generated on the destination
  105. # machine and not simply installed.
  106. rm ${RPM_BUILD_ROOT}%{_sysconfdir}/pear.conf
  107. rm -r ${RPM_BUILD_ROOT}/.registry
  108. rm -r ${RPM_BUILD_ROOT}/.channels
  109. rm -r ${RPM_BUILD_ROOT}/.filemap
  110. rm -r ${RPM_BUILD_ROOT}/.lock
  111. rm -r ${RPM_BUILD_ROOT}/.depdblock
  112. rm -r ${RPM_BUILD_ROOT}/.depdb
  113.  
  114. %clean
  115. #rm -rf $RPM_BUILD_ROOT
  116.  
  117. %files php
  118. %defattr (-, root, bin)
  119. %dir %attr (0755, root, bin) %{_bindir}
  120. %{_bindir}/*
  121. %dir %attr (0755, root, bin) %{_libdir}
  122. %{_libdir}/*
  123. %dir %attr (0755, root, bin) %{_sysconfdir}
  124. %{_sysconfdir}/php.ini
  125. %{_sysconfdir}/php-fpm.conf.default
  126. %dir %attr (0755, root, bin) %dir %{_includedir}
  127. %{_includedir}/*
  128. %dir %attr (0755, root, bin) %{_datadir}
  129. %dir %attr (0755, root, bin) %{_datadir}/fpm
  130. %{_datadir}/fpm/*
  131. #%{_prefix}/php-fpm.conf.default
  132. %dir %attr (0755, root, bin) %{_sbindir}
  133. %{_sbindir}/*
  134. %dir %attr (0755, root, bin) %{_mandir}
  135. %{_mandir}/*
  136. %dir %attr (0755, root, bin) %{_libexecdir}
  137. %dir %attr (0755, root, bin) %{_localstatedir}
  138. %{_localstatedir}/*
  139.  
  140. %files modphp
  141. %%dir %attr (0755, webservd, webservd) %(apxs -q LIBEXECDIR)
  142. %(apxs -q LIBEXECDIR)/*
  143. %%dir %attr (0755, webservd, webservd) %(apxs -q SYSCONFDIR)
  144. %(apxs -q SYSCONFDIR)/*
  145.  
  146. %changelog
  147. * Fri Oct 14 2011 - Ken Mays <kmays2000@gmail.com>
  148. - Bump to 5.3.8
  149. * Wed Jun 8 2011 - Ken Mays <kmays2000@gmail.com>
  150. - Bump to 5.3.6
  151. * Sat Nov 17 2007 - daymobrew@users.sourceforge.net
  152. - Enable building with either SUNWgnu-gettext or SFEgettext.
  153. * Sat May 5 2007 - Thomas Wagner
  154. - Bump: to 5.2.2 (mainly security fixes)
  155. * Wed Mar 28 2007 - Eric Boutilier
  156. - add --enable-mbstring and --with-gettext=/usr/gnu
  157. * Mon Mar 26 2007 - Eric Boutilier
  158. - Work-around: Remove MySQL dependencies and --with-mysql
  159. - Add: --with-pgsql=/usr --with-bz2 --with-zlibs
  160. - Add: cp php.ini-recommended $RPM_BUILD_ROOT%{_libdir}/php.ini
  161. - Bump: to 5.2.1
  162. * Fri Jan 19 2007 - daymobrew@users.sourceforge.net
  163. - Initial spec
RAW Paste Data