Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
isv:ownCloud:devel
php5-posix
php5.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File php5.spec of Package php5-posix
# # spec file for package php5 # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # _without_ make_test by default # use build-test.sh for testing! %bcond_with make_test Name: php5 %global apiver 20121113 %global zendver 20121212 %define suhosin_version 0.9.33 %define pkg_name php5 %define with_spell 1 %define with_systemd 0 BuildRequires: apache2-devel BuildRequires: autoconf BuildRequires: bison BuildRequires: curl-devel BuildRequires: cyrus-sasl-devel BuildRequires: db-devel BuildRequires: enchant-devel %if 0%{suse_version} > 1110 # firebird first added in 11.2; libfbclient2-devel pkg split in 12.2 %define with_firebird 1 BuildRequires: firebird-devel %if 0%{suse_version} > 1210 %define with_firebird 0 # Not found in SLE-12. How did they ever compile their php? # BuildRequires: libfbclient2-devel %endif %else # <= 11.1 or SLES 11 %define with_firebird 0 %endif BuildRequires: freetype2-devel BuildRequires: gcc-c++ BuildRequires: gmp-devel BuildRequires: imap-devel BuildRequires: krb5-devel BuildRequires: libbz2-devel BuildRequires: libevent-devel BuildRequires: libicu-devel BuildRequires: libmcrypt-devel BuildRequires: libopenssl-devel BuildRequires: libpng-devel BuildRequires: libtidy-devel BuildRequires: libtiff-devel BuildRequires: libtool BuildRequires: libxslt-devel BuildRequires: ncurses-devel BuildRequires: net-snmp-devel BuildRequires: openldap2-devel BuildRequires: pam-devel BuildRequires: pkgconfig BuildRequires: postfix BuildRequires: postgresql-devel BuildRequires: tcpd-devel BuildRequires: unixODBC-devel BuildRequires: update-alternatives BuildRequires: xorg-x11-devel %if 0%{suse_version} > 1110 BuildRequires: freetds-devel %endif %if %{with_spell} BuildRequires: aspell-devel %endif # I would like this to become a hard dependency, as PHP is # documented to have this modules by default (no addtional libs are needed) Recommends: php-ctype php-dom php-iconv php-sqlite php-tokenizer Recommends: php-xmlreader php-xmlwriter php-json # other highly reccommended extensions Suggests: php-mbstring php-gd php-pear php-gettext php-mysql php-suhosin BuildRequires: libedit-devel BuildRequires: libjpeg-devel BuildRequires: pcre-devel BuildRequires: re2c BuildRequires: sqlite3-devel #10.3 does not install sendmail binary with the minimal system Requires: smtp_daemon %define extension_dir %{_libdir}/%{pkg_name}/extensions %define peardir %{_datadir}/%{pkg_name}/PEAR %define php_sysconf %{_sysconfdir}/%{pkg_name} %define _x11prefix %(pkg-config --variable=prefix xft) ######################################## # apache macros ######################################## %define apxs2 %{_sbindir}/apxs2 %define apache2_mmn %(MMN=$(%{apxs2} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN) %define apache2_libexecdir %(%{apxs2} -q LIBEXECDIR) %define apache2_sysconfdir %(%{apxs2} -q SYSCONFDIR) %define apache2_includedir %(%{apxs2} -q INCLUDEDIR) %define apache2_serverroot %(%{apxs2} -q PREFIX) %define need_libxml2_hack %(if [ -e %{_includedir}/libxml/parser.h ]; then if grep -q XML_PARSE_OLDSAX %{_includedir}/libxml/parser.h;then echo 1; else echo 0; fi; else echo 0; fi) Version: 5.5.14 Release: 0 Provides: php Provides: php-api = %{apiver} Provides: php-date Provides: php-filter Provides: php-hash Provides: php-pcre Provides: php-reflection Provides: php-session Provides: php-simplexml Provides: php-spl Provides: php-xml Provides: php-zend-abi = %{zendver} Provides: zend Provides: php(api) = %{apiver} Provides: php(zend-abi) = %{zendver} #extensions that are no longer here Obsoletes: php5-dbase Obsoletes: php5-dbx Obsoletes: php5-dio Obsoletes: php5-fam Obsoletes: php5-filepro Obsoletes: php5-ncurses Obsoletes: php5-yp #builtin,nowdays required for everything that uses sha2 Obsoletes: php5-hash < %{version} Provides: php5-hash = %{version} #Old extension, nowdays provided as a "wrapper" in in the hash extension for backward compat. Obsoletes: php5-mhash #Don't mix these packages with php53-* from SLES 11 SP2 Conflicts: php53 Source0: http://www.php.net/distributions/php-%{version}.tar.bz2 Source1: php-suse-addons.tar.bz2 Source2: suhosin-%{suhosin_version}.tgz Source4: README.SUSE-pear Source5: README.macros Source6: macros.php Source7: install-pear-nozlib.phar Source8: php-fpm.init Source100: build-test.sh Source101: unpackaged_files.txt #SUSE specific stuff Patch0: php5-phpize.patch Patch1: php5-apache_sapi_install.patch Patch2: php5-php-config.patch Patch3: php5-ini.patch Patch4: php5-no-build-date.patch Patch5: php5-pts.patch Patch6: php5-openssl.patch Patch7: php5-systzdata-v7.patch Patch8: php5-systemd-unit.patch #bugs # this is from https://raw.github.com/NewEraCracker/suhosin-patches/, check for official # one from suhosin git Patch10: php5-suhosin-php55.patch Patch11: php5-mbstring-missing-return.patch Patch12: php5-BNC-457056.patch Patch13: php5-cloexec.patch Patch14: php5-missing-extdeps.patch # following patch is to fix configure tests for crypt; the aim is to have php # built against glibc's crypt; problem is, that our glibc doesn't support extended # DES, so as soon as upstream fixes this, don't forgot to remove extended DES # from their checking as I indicated in crypt-tests.patch yet, or php will # silently use his own implementation again Patch16: php5-crypt-tests.patch # related to previous patch; !(defined(_REENTRANT) || defined(_THREAD_SAFE)) Patch17: php5-no-reentrant-crypt.patch Patch18: php5-format-string-issues.patch # following patch connected fixes or workarounds https://bugs.php.net/bug.php?id=44522 Patch19: php5-big-file-upload.patch Patch20: php5-per-mod-log.patch Patch21: php5-apache24-updates.patch Patch22: php-CVE-2014-2497.patch Patch23: php-CVE-2014-4670.patch Patch24: php-CVE-2014-4698.patch Patch25: php5-finally-exception-crash.patch Patch26: php-CVE-2014-3597.patch Patch27: php-CVE-2014-5120.patch Url: http://www.php.net BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: PHP5 Core Files License: PHP-3.01 Group: Development/Languages/Other Requires: timezone %description This package contains the PHP5 core files, including PHP binary (CLI) and PHP configuration (php.ini). This package must be installed in order to use PHP. Additionally, extension modules and server modules (e.g. for Apache) may be installed. Additional documentation is available in package php-doc. Authors: -------- The PHP Group See http://www.php.net/credits.php for more details %package posix Provides: php-posix Summary: PHP5 Extension Module Group: Development/Libraries/PHP Requires: %{name} = %{version} %description posix This module allows to use POSIX-like functions in PHP. Authors: -------- The PHP Group See http://www.php.net/credits.php for more details %prep echo %{apache2_mmn} %setup -q -n php-%{version} -a 1 %{__tar} xf %{S:2} -C ext %{__mv} ext/suhosin-%{suhosin_version} ext/suhosin %{__cp} %{S:4} pear/README.SUSE %{__cp} %{S:5} . %{__cp} %{S:7} pear/ %patch0 %patch1 %patch2 %patch3 %patch4 %patch5 %patch6 %patch7 %patch8 %patch10 %patch11 %if %{need_libxml2_hack} echo "*** APPLY LIBXML2.7 FIX ***" %patch12 %else echo "*** SKIPPING LIBMXL2.7 FIX ***" %endif %patch13 %patch14 %patch16 %patch17 %patch18 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch22 %patch23 %patch24 %patch25 %patch26 %patch27 # Safety check for API version change. vapi=`sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h` if test "x${vapi}" != "x%{apiver}"; then : Error: Upstream API version is now ${vapi}, expecting %{apiver}. : Update the apiver macro and rebuild. exit 1 fi vzend=`sed -n '/#define ZEND_MODULE_API_NO/{s/^[^0-9]*//;p;}' Zend/zend_modules.h` if test "x${vzend}" != "x%{zendver}"; then : Error: Upstream Zend ABI version is now ${vzend}, expecting %{zendver}. : Update the zendver macro and rebuild. exit 1 fi %build chmod 644 README.namespaces UPGRADING # aclocal workaround - to be improved cat `aclocal --print-ac-dir`/{libtool,ltoptions,ltsugar,ltversion,lt~obsolete}.m4 >>aclocal.m4 # Force use of system libtool: libtoolize --force --copy cat `aclocal --print-ac-dir`/{libtool,ltoptions,ltsugar,ltversion,lt~obsolete}.m4 >build/libtool.m4 # Regenerate configure scripts (patches change config.m4's) touch configure.in # we build three SAPI %{__mkdir_p} build-apache2 %{__mkdir_p} build-fpm %{__mkdir_p} build-fastcgi %{__mkdir_p} build-cli for parser in `find -name "*.re"`;do re2c --no-generation-date -gi "$parser" > ${parser%.*}.c done %{__rm} -r ext/pcre/pcrelib # regenerate configure etc. # workaround: suhosin-patch updates timestamp of configure, confusing buildconf %{__rm} configure ./buildconf --force # export flags CFLAGS="$RPM_OPT_FLAGS -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing" CXXFLAGS="$RPM_OPT_FLAGS -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing" %if %{with_firebird} CFLAGS="$CFLAGS -I/usr/include/firebird" CXXFLAGS="$CXXFLAGS -I/usr/include/firebird" %endif export CFLAGS export CXXFLAGS export LDFLAGS="-pie" export NO_INTERACTION=true # where to install extensions EXTENSION_DIR=%{extension_dir} export EXTENSION_DIR export PHP_MYSQLND_ENABLED=yes export PHP_MYSQLND_COMPRESSION_SUPPORT=yes # fix build-cli: libc-client.so needs -lssl export IMAP_SHARED_LIBADD='-lssl' # build function Build() { sapi=$1 pushd build-$1 shift ../configure \ --prefix=%{_prefix} \ --datadir=%{_datadir}/%{pkg_name} \ --mandir=%{_mandir} \ --bindir=%{_bindir} \ --with-libdir=%{_lib} \ --includedir=%{_includedir} \ --sysconfdir=%{php_sysconf}/$sapi \ --with-config-file-path=%{php_sysconf}/$sapi \ --with-config-file-scan-dir=%{php_sysconf}/conf.d \ --enable-libxml \ --enable-session \ %if 0%{?suse_version} > 1010 --with-pcre-regex=%{_usr} \ %else --with-pcre-regex \ %endif --enable-xml \ --enable-simplexml \ --enable-spl \ --enable-filter \ --disable-debug \ --enable-inline-optimization \ --disable-rpath \ --disable-static \ --enable-shared \ --with-pic \ --with-gnu-ld \ --enable-re2c-cgoto \ --with-system-tzdata=/usr/share/zoneinfo \ --enable-hash \ --with-mhash \ "$@" || cat config.log # Some modules are builtin, reasons: # - libxml can not be shared (and is needed by PEAR) # - spl doesn't build shared # - simplexml is needed by spl # - session need to be builtin, otherwise sqlite and other session engines fail # - pcre is needed for PEAR # - filter is builtin due security reasons # We have still have harcoded RPATH in some modules %{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool %{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=LIBTOOL_IS_BROKED|g' libtool %{__make} %{?jobs:-j%jobs PHP_PEAR_PHP_BIN=%{_bindir}/php} popd } # perform all builds # apache2 sapi Build apache2 \ --with-apxs2=%{apxs2} \ --disable-all \ --disable-cli \ # fast-cgi sapi Build fastcgi \ --enable-force-cgi-redirect \ --disable-discard-path \ --enable-fastcgi \ --bindir=%{_bindir} \ --disable-cli \ --disable-all \ Build fpm \ %if %{with_systemd} --with-fpm-systemd \ %endif --enable-fpm \ --bindir=%{_bindir} \ --disable-cli \ --disable-all\ # cli sapi with all shared modules # Hack the built configure to also link ncurses together with libedit. # this is reported upstream bug http://bugs.php.net/bug.php?id=21153 sed -i "s/-ledit/-ledit -lncurses/g" configure Build cli \ --enable-cli \ --with-pear=%{peardir} \ --enable-bcmath=shared \ --enable-calendar=shared \ --enable-ctype=shared \ --enable-dom=shared \ --enable-exif=shared \ --enable-ftp=shared \ --enable-mbstring=shared \ --enable-mbregex \ --enable-pcntl=shared \ --enable-posix=shared \ --enable-shmop=shared \ --enable-soap=shared \ --enable-sockets=shared \ --enable-sysvmsg=shared \ --enable-sysvsem=shared \ --enable-sysvshm=shared \ --enable-tokenizer=shared \ --enable-wddx=shared \ --enable-fileinfo=shared \ --with-zlib=shared \ --with-bz2=shared \ --with-curl=shared \ --with-gd=shared \ --enable-gd-native-ttf \ --with-xpm-dir=%{_x11prefix} \ --with-freetype-dir=%{_usr} \ --with-png-dir=%{_usr} \ --with-jpeg-dir=%{_usr} \ --with-zlib-dir=%{_usr} \ --with-gettext=shared \ --with-gmp=shared \ --with-iconv=shared \ --with-imap=shared \ --with-kerberos \ --with-imap-ssl \ --enable-json=shared \ --with-ldap=shared \ --with-ldap-sasl=%{_usr} \ --with-libedit=shared,%{_usr} \ --with-mcrypt=shared \ --with-mysql=shared,mysqlnd \ %if %{with_firebird} --with-interbase=shared \ %endif %if 0%{?suse_version} > 1110 --with-mysql-sock=/var/run/mysql/mysql.sock \ %else --with-mysql-sock=/var/lib/mysql/mysql.sock \ %endif --with-mysqli=shared,mysqlnd \ --with-unixODBC=shared,%{_usr} \ --with-openssl=shared \ --with-pgsql=shared,%{_usr} \ --enable-phar=shared \ %if %{with_spell} --with-pspell=shared \ --with-enchant=shared,%{_usr} \ %endif --with-snmp=shared \ --with-xmlrpc=shared \ --enable-xmlreader=shared \ --enable-xmlwriter=shared \ --with-xsl=shared \ --with-tidy=shared,%{_usr} \ --enable-dba=shared \ --with-db4=%{_usr} \ --without-gdbm \ --with-cdb \ --with-inifile \ --with-flatfile \ --enable-pdo=shared \ --with-pdo_sqlite=shared,%{_usr} \ --with-sqlite3=shared,%{_usr} \ --enable-sqlite-utf8 \ --with-pdo-mysql=shared,mysqlnd \ %if %{with_firebird} --with-pdo-firebird=shared \ %endif --with-pdo-pgsql=shared,%{_usr} \ --with-pdo-odbc=shared,unixODBC,%{_usr} \ --enable-zip=shared \ --enable-suhosin=shared \ --enable-intl=shared,%{_usr} \ %if 0%{suse_version} > 1110 --with-mssql=shared,%{_usr} \ %endif --disable-cgi # things that currently do not compile: # extensions: # --with-recode=shared \ error: recode extension can not be configured together with: imap mysql yaz #disabled extensions # --enable-embedded-mysqli \ %check cd build-cli # check if we link against system libcrypt if [ -z "$(ldd sapi/cli/php | grep libcrypt.so)" ]; then echo 'php do not link against system libcrypt.' exit 1 fi # Run tests, using the CLI SAPI %if %{with make_test} export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 LANG=POSIX LC_ALL=POSIX unset TZ %{__make} test || true set +x for f in `find .. -name "*.diff" -type f -print`; do echo "TEST FAILURE: $f --" cat "$f" echo "-- $f result ends." done set -x unset NO_INTERACTION REPORT_EXIT_STATUS %endif %install # install function Install() { pushd build-$1 %{__make} install INSTALL_ROOT=%{buildroot} PHP_PEAR_PHP_BIN=%{_bindir}/php popd } # do the actual installation Install apache2 #need it for yast module %{__mv} %{buildroot}%{apache2_libexecdir}/libphp5.so %{buildroot}%{apache2_libexecdir}/mod_php5.so Install fastcgi Install cli Install fpm # generate php.ini from php.ini-production: %{__install} -d -m 755 %{buildroot}/%{php_sysconf}/conf.d %{__install} -d -m 755 %{buildroot}/%{php_sysconf}/apache2 %{__install} -d -m 755 %{buildroot}/%{php_sysconf}/cli %{__install} -d -m 755 %{buildroot}/%{php_sysconf}/fastcgi %{__install} -d -m 755 %{buildroot}/%{php_sysconf}/fpm %{__sed} -e "s=@extdir@=%{extension_dir}=" -e "s:expose_php = On:expose_php = Off:" php.ini-production \ > %{buildroot}/%{php_sysconf}/apache2/php.ini %{__sed} "s=@extdir@=%{extension_dir}=" php.ini-production \ | %{__sed} -r 's/^(html_errors|implicit_flush|max_execution_time|register_argc_argv)/;\1/' \ > %{buildroot}/%{php_sysconf}/cli/php.ini %{__sed} "s=@extdir@=%{extension_dir}=" php.ini-production \ > %{buildroot}/%{php_sysconf}/fastcgi/php.ini # prepare configuration files for each extension extern_modules="" for f in %{buildroot}%{extension_dir}/*; do if test ${f##*.} = a; then %{__rm} $f continue fi if test ${f##*.} = so; then f=${f%.so} fi ext=${f##*/} extern_modules="$extern_modules $ext" echo "; comment out next line to disable $ext extension in php" > %{buildroot}/%{php_sysconf}/conf.d/$ext.ini zend_='' if [ $ext == "opcache" ]; then # http://php.net/manual/en/opcache.installation.php zend_='zend_' fi echo "${zend_}extension=$ext.so" >> %{buildroot}/%{php_sysconf}/conf.d/$ext.ini done #suhosin configuration %{__install} -m 644 ext/suhosin/suhosin.ini %{buildroot}/%{php_sysconf}/conf.d/suhosin.ini # list of builtin modules builtin_modules=`./build-cli/sapi/cli/php -m | egrep -v '^(\[.*)?$' | sort | tr '\n' ' '` # update readme %{__sed} "s=@EXTERN_MODULES@=$extern_modules=;s=@BUILTIN_MODULES@=$builtin_modules=" php-suse-addons/README.SUSE > README.SUSE # apache configuration %{__mkdir_p} %{buildroot}%{apache2_sysconfdir}/conf.d %{__install} -m 644 php-suse-addons/sysconfig.apache2 %{buildroot}/%{apache2_sysconfdir}/conf.d/%{pkg_name}.conf # directory for sessions %{__install} -d %{buildroot}/var/lib/%{pkg_name} # documentation %{__mv} sapi/cli/README README.CLI %{__mv} sapi/cgi/README.FastCGI README.FastCGI %{__rm} -rf %{buildroot}/{.channels,.depdb*,.filemap,.lock,usr/bin/peardev} %{__install} -d -m 0755 %{buildroot}/%{peardir}/test # for pear XML files %{__install} -d -m 0755 %{buildroot}/var/lib/pear # provide compat symlink %{__mkdir_p} %{buildroot}/srv/www/cgi-bin %{__ln_s} /usr/bin/php-cgi %{buildroot}/srv/www/cgi-bin/php #fix symlink sed -i -e "s@$RPM_BUILD_DIR/php-%{version}/build-cli/sapi/cli/php@php@g" %{buildroot}%{_bindir}/phar.phar rm %{buildroot}%{_bindir}/phar %{__ln_s} -f %{_bindir}/phar.phar %{buildroot}%{_bindir}/phar # CVE-2014-5459, bnc#893849; couldn't find a way to use PHP_PEAR_CACHE_DIR # (install-pear is checking if the directory is writable by current user?; # unfortunately ENOTIME to figure out) %{__sed} -i 's@15:"/tmp/pear/cache"@19:"/var/cache/php-pear"@' %{buildroot}%{php_sysconf}/cli/pear.conf grep -c '/var/cache/php-pear' %{buildroot}%{php_sysconf}/cli/pear.conf || exit 1 # Install the macros file: install -d $RPM_BUILD_ROOT%{_sysconfdir}/rpm sed -e "s/@PHP_APIVER@/%{apiver}/;s/@PHP_ZENDVER@/%{zendver}/" \ < $RPM_SOURCE_DIR/macros.php > macros.php install -m 644 -c macros.php \ $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.php #install fpm init script. install -d %{buildroot}%{_sysconfdir}/init.d install -m 755 -c %{S:8} %{buildroot}%{_sysconfdir}/init.d/php-fpm %if %{with_systemd} install -D -m 0644 ./build-fpm/sapi/fpm/php-fpm.service %{buildroot}%{_unitdir}/php-fpm.service %if 0%{suse_version} > 1220 ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcphp-fpm %else ln -s /sbin/service %{buildroot}%{_sbindir}/rcphp-fpm %endif %else ln -s %{_sysconfdir}/init.d/php-fpm %{buildroot}%{_sbindir}/rcphp-fpm %endif ## from a previous build # Installed (but unpackaged) file(s) found: # Note that man pages are not yet compressed. Say phar.1* instead of phar.1.gz while read a; do rm -f %{buildroot}/$a; done < %{S:101} # unpackaged_files.txt %files posix %defattr(644,root,root,755) %dir /etc/php5 %dir /etc/php5/conf.d %dir /usr/lib64/php5 %dir /usr/lib64/php5/extensions %{extension_dir}/posix.so %config(noreplace) %{php_sysconf}/conf.d/posix.ini %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor