[php-symfony] fix PEAR compatibility: add missing "autoloader.php"

Remi Collet remi at fedoraproject.org
Mon Dec 16 13:22:26 UTC 2013


commit 65dccd9b35c6dffd739f788cae11d4c2a24fe177
Author: Remi Collet <remi at fedoraproject.org>
Date:   Mon Dec 16 14:22:30 2013 +0100

    fix PEAR compatibility: add missing "autoloader.php"

 .gitignore       |    3 +++
 getautoloader.sh |   32 ++++++++++++++++++++++++++++++++
 php-symfony.spec |   19 ++++++++++++++++++-
 sources          |    1 +
 4 files changed, 54 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 79db14b..8fa4129 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
+php-symfony.spec~
+clog
 /php-symfony-2.3.7-2829b471871c2564228fe9f0832a0f928a8ffaa1.tar.gz
+/autoloader-2.3.7.tgz
diff --git a/getautoloader.sh b/getautoloader.sh
new file mode 100644
index 0000000..0e9af18
--- /dev/null
+++ b/getautoloader.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [ "$1" = "" ]
+then
+	echo usage $0 version
+	exit 1
+fi
+
+tmp=$(mktemp --dir)
+pushd $tmp
+
+echo -e "\n+ channel"
+pear channel-discover pear.symfony.com
+
+echo -e "\n+ packages"
+pear list-all -c symfony2 | while read name version descr
+do
+	if [ "$name" = "ALL" -o "$name" = "PACKAGE" -o "$version" = "" ]
+	then
+		continue
+	fi
+	pear download $name-$1
+	tar xf $(basename $name)-$1.tgz --strip-components=1
+done
+lst=$(find Symfony -name autoloader.php)
+
+popd
+echo -e "\n+ archive: autoloader-$1.tgz"
+tar cvzf autoloader-$1.tgz -C $tmp $lst
+
+echo -e "\n+ cleanups"
+rm -rf $tmp
diff --git a/php-symfony.spec b/php-symfony.spec
index 8cecc4b..269cfa8 100644
--- a/php-symfony.spec
+++ b/php-symfony.spec
@@ -34,10 +34,11 @@
 
 %global symfony_dir             %{_datadir}/php/Symfony
 %global pear_channel            pear.symfony.com
+%global with_tests              %{?_without_tests:0}%{!?_without_tests:1}
 
 Name:          php-symfony
 Version:       %{github_version}
-Release:       3%{dist}
+Release:       4%{dist}
 Summary:       PHP framework for web projects
 
 Group:         Development/Libraries
@@ -45,6 +46,11 @@ License:       MIT
 URL:           http://symfony.com
 Source0:       https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
 
+# Run this command to download the PEAR package
+# and retrieve missing files github archive
+Source1:       getautoloader.sh
+Source2:       autoloader-%{version}.tgz
+
 BuildArch:     noarch
 # For tests
 BuildRequires: php(language) >= %{php_min_ver}
@@ -1166,6 +1172,10 @@ The YAML Component loads and dumps YAML files.
 find src -name '.git*' -delete
 rm -rf src/Symfony/Bridge/{Propel1,ProxyManager}
 
+# Add missing files for PEAR compatibility
+cd src
+tar xf %{SOURCE2}
+
 
 %build
 # Empty build section, nothing required
@@ -1233,6 +1243,7 @@ sed -i \
 rm -f src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
 %endif
 
+%if %{with_tests}
 # Run tests
 for PKG in src/Symfony/*/*; do
     echo -e "\n>>>>>>>>>>>>>>>>>>>>>>> ${PKG}\n"
@@ -1242,6 +1253,9 @@ for PKG in src/Symfony/*/*; do
         -d date.timezone="UTC" \
         $PKG
 done
+%else
+: Skip test suite
+%endif
 
 
 %files
@@ -1823,6 +1837,9 @@ done
 # ##############################################################################
 
 %changelog
+* Sat Dec 14 2013 Remi Collet <remi at fedoraproject.org> 2.3.7-4
+- fix PEAR compatibility: add missing "autoloader.php"
+
 * Tue Nov 26 2013 Shawn Iwinski <shawn.iwinski at gmail.com> 2.3.7-3
 - Fixed several summaries and descriptions ("Symfony2" => "Symfony")
 
diff --git a/sources b/sources
index bc9c107..17e7162 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 15f8aaf542157d48c94c2c8f09dbafd0  php-symfony-2.3.7-2829b471871c2564228fe9f0832a0f928a8ffaa1.tar.gz
+4e14800077a9041b34d47efce82dcf58  autoloader-2.3.7.tgz


More information about the scm-commits mailing list