summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-11-26 09:11:37 +0100
committerRemi Collet <fedora@famillecollet.com>2014-11-26 09:11:37 +0100
commite5ef42d07e4b2237129687ea79136a2d0a710797 (patch)
tree4ac9c02f72d3b805c4d730e634ea8386ada7d04b
parent71473016d41d4d3587fc2950097f09ecfe1add41 (diff)
php56-php: add embedded sub package
-rw-r--r--php-5.6.3-embed.patch12
-rw-r--r--php.spec51
2 files changed, 57 insertions, 6 deletions
diff --git a/php-5.6.3-embed.patch b/php-5.6.3-embed.patch
new file mode 100644
index 0000000..af7d355
--- /dev/null
+++ b/php-5.6.3-embed.patch
@@ -0,0 +1,12 @@
+--- php-5.6.3/sapi/embed/config.m4.embed
++++ php-5.6.3/sapi/embed/config.m4
+@@ -12,7 +12,8 @@ if test "$PHP_EMBED" != "no"; then
+ case "$PHP_EMBED" in
+ yes|shared)
+ PHP_EMBED_TYPE=shared
+- INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -release \$(PHP_MAJOR_VERSION).\$(PHP_MINOR_VERSION)"
++ INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(libdir); \$(LIBTOOL) --mode=install \$(INSTALL) -m 0755 \$(OVERALL_TARGET) \$(INSTALL_ROOT)\$(libdir)"
+ ;;
+ static)
+ PHP_EMBED_TYPE=static
diff --git a/php.spec b/php.spec
index 0ee2730..dd45069 100644
--- a/php.spec
+++ b/php.spec
@@ -25,6 +25,9 @@
# Adds -z now to the linker flags
%global _hardened_build 1
+# version used for php embedded library soname
+%global embed_version 5.6
+
# Ugly hack. Harcoded values to avoid relocation.
%global _httpd_mmn %(cat %{_root_includedir}/httpd/.mmn 2>/dev/null || echo 0)
%global _httpd_confdir %{_root_sysconfdir}/httpd/conf.d
@@ -129,7 +132,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: %{?scl_prefix}php
Version: 5.6.3
-Release: 2%{?dist}
+Release: 3%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -156,6 +159,7 @@ Source51: opcache-default.blacklist
# Build fixes
Patch5: php-5.6.3-includedir.patch
+Patch6: php-5.6.3-embed.patch
Patch7: php-5.3.0-recode.patch
Patch8: php-5.6.3-libdb.patch
@@ -230,12 +234,9 @@ Requires(pre): httpd
%endif
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Don't provides extensions, which are not shared library, as .so
-%{?filter_provides_in: %filter_provides_in %{_libdir}/php/modules/.*\.so$}
-%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
+# Don't provides extensions, or shared libraries (embedded)
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
-%endif
%description
@@ -322,6 +323,19 @@ used by the LiteSpeed Web Server (LSAPI enabled PHP).
%endif
+%package embedded
+Summary: PHP library for embedding in applications
+Group: System Environment/Libraries
+Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release}
+# doing a real -devel package for just the .so symlink is a bit overkill
+Provides: %{?scl_prefix}php-embedded-devel = %{version}-%{release}
+Provides: %{?scl_prefix}php-embedded-devel%{?_isa} = %{version}-%{release}
+
+%description embedded
+The %{?scl_prefix}php-embedded package contains a library which can be embedded
+into applications to provide PHP scripting language support.
+
+
%package common
Group: Development/Languages
Summary: Common files for PHP
@@ -840,6 +854,7 @@ support for using the enchant library to PHP.
%setup -q -n php-%{version}%{?rcver}
%patch5 -p1 -b .includedir
+%patch6 -p1 -b .embed
%patch7 -p1 -b .recode
%patch8 -p1 -b .libdb
@@ -892,6 +907,7 @@ cp ext/bcmath/libbcmath/COPYING.LIB libbcmath_COPYING
mkdir \
build-fpm \
build-apache \
+ build-embedded \
build-cgi
# ----- Manage known as failed test -------
@@ -1207,6 +1223,15 @@ build --enable-fpm \
${without_shared}
popd
+# Build for inclusion as embedded script language into applications,
+# /usr/lib[64]/libphp5.so
+pushd build-embedded
+build --enable-embed \
+ --without-mysql \
+ --disable-pdo \
+ ${without_shared}
+popd
+
%check
%if %runselftest
@@ -1236,6 +1261,10 @@ unset NO_INTERACTION REPORT_EXIT_STATUS MALLOC_CHECK_
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+# Install the version for embedded script language in applications + php_embed.h
+make -C build-embedded install-sapi install-headers \
+ INSTALL_ROOT=$RPM_BUILD_ROOT
+
# Install the php-fpm binary
make -C build-fpm install-fpm \
INSTALL_ROOT=$RPM_BUILD_ROOT
@@ -1562,6 +1591,7 @@ if [ -f /etc/rc.d/init.d/%{?scl_prefix}php-fpm ]; then
fi
%endif
+
%{!?_licensedir:%global license %%doc}
%files
@@ -1661,6 +1691,11 @@ fi
%endif
%endif
+%files embedded
+%defattr(-,root,root,-)
+%{_libdir}/libphp5.so
+%{_libdir}/libphp5-%{embed_version}.so
+
%files devel
%defattr(-,root,root)
%{_bindir}/php-config
@@ -1726,6 +1761,10 @@ fi
%changelog
+* Wed Nov 26 2014 Remi Collet <remi@fedoraproject.org> 5.6.3-3
+- add embedded sub package
+- filter all libraries to avoid provides
+
* Sun Nov 16 2014 Remi Collet <remi@fedoraproject.org> 5.6.3-2
- FPM: add upstream patch for https://bugs.php.net/68421
access.format=R doesn't log ipv6 address