From 452b6af88dec2f5b0a68c06ea92d41f568e0e6ee Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 12 Jun 2016 09:06:06 +0200 Subject: php-ZendFramework2: 2.4.10 (backported from Fedora) --- ZendFramework-autoload.php | 15 ------ php-ZendFramework2-get-source.sh | 69 ++++++++++++++++++++++++ php-ZendFramework2.spec | 111 ++++++++++++++++++--------------------- 3 files changed, 121 insertions(+), 74 deletions(-) delete mode 100644 ZendFramework-autoload.php create mode 100755 php-ZendFramework2-get-source.sh diff --git a/ZendFramework-autoload.php b/ZendFramework-autoload.php deleted file mode 100644 index 659144a..0000000 --- a/ZendFramework-autoload.php +++ /dev/null @@ -1,15 +0,0 @@ - array( - 'fallback_autoloader' => true, - 'autoregister_zf' => true - ) -)); diff --git a/php-ZendFramework2-get-source.sh b/php-ZendFramework2-get-source.sh new file mode 100755 index 0000000..48b8385 --- /dev/null +++ b/php-ZendFramework2-get-source.sh @@ -0,0 +1,69 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) +TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-ZendFramework2.spec b/php-ZendFramework2.spec index 4e41233..6a9b7e9 100644 --- a/php-ZendFramework2.spec +++ b/php-ZendFramework2.spec @@ -1,8 +1,7 @@ -# remirepo spec file for php-ZendFramework2, from: # # Fedora spec file for php-ZendFramework2 # -# Copyright (c) 2013-2015 Shawn Iwinski +# Copyright (c) 2013-2016 Shawn Iwinski # Remi Collet # # License: MIT @@ -11,27 +10,30 @@ # Please preserve changelog entries # -%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} +%global github_owner zendframework +%global github_name zendframework +%global github_version 2.4.10 +%global github_commit 7e5bdc38820aef518c1c49d4b6e8fcb0083b165b + %global composer_vendor zendframework -#global with_tests %{?_with_tests:1}%{!?_with_tests:0} -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} + +%global with_tests 0%{!?_without_tests:1} + +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: php-ZendFramework2 -Version: 2.4.9 +Version: %{github_version} Release: 1%{?dist} Summary: Zend Framework 2 Group: Development/Libraries License: BSD URL: http://framework.zend.com -Source0: https://packages.zendframework.com/releases/ZendFramework-%{version}/ZendFramework-%{version}.tgz -# git clone https://github.com/zendframework/zf2.git ; cf zf2 -# OR cd /work/GIT/zf2; git pull; git pull --tags -# git checkout release-2.3.9 -# tar czf ../ZendFramework-tests-2.3.9.tgz tests -Source1: ZendFramework-tests-%{version}.tgz -# Autoloader -Source2: ZendFramework-autoload.php + +# GitHub export does not include tests. +# Run php-ZendFramework2-get-source.sh to create full source. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -76,6 +78,7 @@ BuildRequires: php-zip BuildRequires: php-zlib BuildRequires: php-composer(ircmaxell/random-lib) BuildRequires: php-composer(mikey179/vfsStream) >= 1.2 +BuildRequires: php-composer(%{composer_vendor}/zendxml) %endif Requires: php-composer(%{composer_vendor}/zend-authentication) = %{version} @@ -128,7 +131,7 @@ Requires: php-composer(%{composer_vendor}/zend-validator) = %{version} Requires: php-composer(%{composer_vendor}/zend-version) = %{version} Requires: php-composer(%{composer_vendor}/zend-view) = %{version} Requires: php-composer(%{composer_vendor}/zend-xmlrpc) = %{version} -Requires: php-composer(%{composer_vendor}/zendxml) = %{version} +Requires: php-composer(%{composer_vendor}/zendxml) Provides: php-composer(%{composer_vendor}/zendframework) = %{version} @@ -889,13 +892,13 @@ Group: Development/Libraries URL: http://framework.zend.com/manual/2.3/en/modules/zend.json.introduction.html Requires: %{name}-common = %{version}-%{release} -Requires: php-composer(%{composer_vendor}/zendxml) = %{version} +Requires: php-composer(%{composer_vendor}/zendxml) # composer.json Requires: php-composer(%{composer_vendor}/zend-stdlib) = %{version} # composer.json (optional) Requires: php-composer(%{composer_vendor}/zend-http) = %{version} Requires: php-composer(%{composer_vendor}/zend-server) = %{version} -Requires: php-composer(%{composer_vendor}/zendxml) = %{version} +Requires: php-composer(%{composer_vendor}/zendxml) # phpcompatinfo (computed from version 2.3.1) Requires: php-json Requires: php-mbstring @@ -1389,7 +1392,6 @@ Requires: php-dom Requires: php-libxml Requires: php-pcre Requires: php-pecl(igbinary) -Requires: php-pecl(msgpack) Requires: php-simplexml Requires: php-spl @@ -1400,6 +1402,8 @@ The Zend\Serializer component provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover. +Optional: msgpack (php-pecl-msgpack) + # ------------------------------------------------------------------------------ %package Server @@ -1785,13 +1789,13 @@ Group: Development/Libraries URL: http://framework.zend.com/manual/2.3/en/modules/zend.xmlrpc.intro.html Requires: %{name}-common = %{version}-%{release} -Requires: php-composer(%{composer_vendor}/zendxml) = %{version} +Requires: php-composer(%{composer_vendor}/zendxml) # composer.json Requires: php-composer(%{composer_vendor}/zend-http) = %{version} Requires: php-composer(%{composer_vendor}/zend-math) = %{version} Requires: php-composer(%{composer_vendor}/zend-server) = %{version} Requires: php-composer(%{composer_vendor}/zend-stdlib) = %{version} -Requires: php-composer(%{composer_vendor}/zendxml) = %{version} +Requires: php-composer(%{composer_vendor}/zendxml) # composer.json (optional) Requires: php-composer(%{composer_vendor}/zend-cache) = %{version} # phpcompatinfo (computed from version 2.3.1) @@ -1818,49 +1822,38 @@ and building new XML-RPC servers. [1] http://www.xmlrpc.com/ -# ------------------------------------------------------------------------------ - -%package ZendXml - -Summary: Zend Framework 2: XML usage, best practices, and security in PHP -Group: Development/Libraries -URL: https://github.com/zendframework/ZendXml - -Requires: %{name}-common = %{version}-%{release} -# phpcompatinfo (computed from version 2.3.1) -Requires: php-dom -Requires: php-libxml -Requires: php-simplexml -Requires: php-spl - -Provides: php-composer(%{composer_vendor}/zendxml) = %{version} - -%description ZendXml -This is a security component to prevent XML eXternal Entity (XXE) and -XML Entity Expansion (XEE) attacks on XML documents. - -The XXE attack is prevented disabling the load of external entities in -the libxml library used by PHP, using the function libxml_disable_entity_loader. - -The XEE attack is prevented looking inside the XML document for ENTITY usage. -If the XML document uses ENTITY the library throw an Exception. # ############################################################################## %prep -%setup -q -n ZendFramework-%{version} -a 1 +%setup -qn %{github_name}-%{github_commit} %build -# Empty build section, nothing required +: Create autoloader +cat <<'AUTOLOAD' | tee library/Zend/autoload.php + array( + 'fallback_autoloader' => true, + 'autoregister_zf' => true + ) +)); +AUTOLOAD %install mkdir -p %{buildroot}%{_datadir}/php -cp -rp library/* %{buildroot}%{_datadir}/php - -install -pm 644 %{SOURCE2} %{buildroot}%{_datadir}/php/Zend/autoload.php +cp -rp library/* %{buildroot}%{_datadir}/php/ # Symlink package docs to common sub-package docs mkdir -p %{buildroot}%{_docdir} @@ -1883,7 +1876,9 @@ Zend\Loader\AutoloaderFactory::factory(array( 'Zend\\Loader\\StandardAutoloader' => array( 'namespaces' => array( 'ZendTest' => __DIR__ . '/ZendTest', -)))); + ) + ) +)); AUTOLOADER : ignore these for now @@ -2521,16 +2516,14 @@ exit $RET %exclude %{_datadir}/php/Zend/XmlRpc/*.md %exclude %{_datadir}/php/Zend/XmlRpc/composer.json -# ------------------------------------------------------------------------------ - -%files ZendXml -%defattr(-,root,root,-) - -%{_datadir}/php/ZendXml - # ############################################################################## %changelog +* Sun Jun 12 2016 Shawn Iwinski - 2.4.10-1 +- Update to 2.4.10 (RHBZ #1343995 / RHBZ #1343990) +- Switch to GitHub source (and separate ZendXml pkg) +- Move autoloader into spec + * Wed Nov 25 2015 Remi Collet - 2.4.9-1 - Update to 2.4.9 -- cgit