[Pkg-owncloud-commits] [php-sabre-vobject] 07/10: Provide homemade autoload.php
David Prévot
taffit at moszumanska.debian.org
Tue Mar 31 22:25:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch 2.1
in repository php-sabre-vobject.
commit b1711de51a9b0c53f91e185bb91e668104fb8749
Author: David Prévot <taffit at debian.org>
Date: Tue Feb 24 15:21:04 2015 -0400
Provide homemade autoload.php
---
debian/clean | 1 +
debian/control | 2 +-
...ssLoader-from-Symfony-instead-of-autoload.patch | 41 -----------
.../patches/0001-Use-homemade-autoloader.php.patch | 83 ++++++++++++++++++++++
.../Use-installed-class-for-DEP-8-tests.patch | 19 -----
debian/patches/series | 2 +-
debian/rules | 6 +-
debian/tests/control | 5 +-
debian/tests/phpunit | 8 ---
9 files changed, 93 insertions(+), 74 deletions(-)
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..afaff9e
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1 @@
+lib/Sabre/VObject/autoload.php
diff --git a/debian/control b/debian/control
index 11fa2e6..3809e21 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: ownCloud for Debian maintainers <pkg-owncloud-maintainers at lists.alioth.debian.org>
Uploaders: David Prévot <taffit at debian.org>
Build-Depends: debhelper (>= 9),
- php-symfony-class-loader,
+ phpab,
phpunit,
pkg-php-tools (>= 1.7~)
Standards-Version: 3.9.6
diff --git a/debian/patches/0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch b/debian/patches/0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch
deleted file mode 100644
index 4c6f39b..0000000
--- a/debian/patches/0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
-Date: Wed, 19 Mar 2014 11:07:08 -0400
-Subject: Use ClassLoader from Symfony instead of autoload
-
-Work around the lack of proper autoload.php from composer by using the
-ClassLoader element from Symfony.
-
-http://symfony.com/doc/current/components/class_loader/class_loader.html
-
-Forwarded: not-needed
----
- tests/bootstrap.php | 19 ++++++++-----------
- 1 file changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/tests/bootstrap.php b/tests/bootstrap.php
-index 3608abe..8cb056a 100644
---- a/tests/bootstrap.php
-+++ b/tests/bootstrap.php
-@@ -2,14 +2,11 @@
-
- date_default_timezone_set('UTC');
-
--$try = array(
-- __DIR__ . '/../vendor/autoload.php',
-- __DIR__ . '/../../../autoload.php',
--);
--
--foreach($try as $path) {
-- if (file_exists($path)) {
-- include $path;
-- break;
-- }
--}
-+require_once 'Symfony/Component/ClassLoader/ClassLoader.php';
-+use Symfony\Component\ClassLoader\ClassLoader;
-+$loader = new ClassLoader();
-+$loader->setUseIncludePath(true);
-+$loader->register();
-+$loader->addPrefixes(array(
-+ 'Sabre' => __DIR__.'/../lib',
-+));
diff --git a/debian/patches/0001-Use-homemade-autoloader.php.patch b/debian/patches/0001-Use-homemade-autoloader.php.patch
new file mode 100644
index 0000000..553e08c
--- /dev/null
+++ b/debian/patches/0001-Use-homemade-autoloader.php.patch
@@ -0,0 +1,83 @@
+From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
+Date: Wed, 19 Mar 2014 11:07:08 -0400
+Subject: Use homemade autoloader.php
+
+Work around the lack of proper autoload.php from Composer.
+
+Forwarded: not-needed
+---
+ bin/bench.php | 4 ++--
+ bin/generateicalendardata.php | 4 ++--
+ bin/vobjectvalidate.php | 6 +++---
+ tests/bootstrap.php | 4 ++--
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/bin/bench.php b/bin/bench.php
+index b949c8e..ad61098 100755
+--- a/bin/bench.php
++++ b/bin/bench.php
+@@ -1,7 +1,7 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+
+-include __DIR__ . '/../vendor/autoload.php';
++include __DIR__ . '/../lib/Sabre/VObject/autoload.php';
+
+ $data = stream_get_contents(STDIN);
+
+diff --git a/bin/generateicalendardata.php b/bin/generateicalendardata.php
+index 92c8c10..9e5d2de 100755
+--- a/bin/generateicalendardata.php
++++ b/bin/generateicalendardata.php
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+
+ use Sabre\VObject;
+@@ -25,7 +25,7 @@ $events = 100;
+
+ if (isset($argv[1])) $events = (int)$argv[1];
+
+-include __DIR__ . '/../vendor/autoload.php';
++include __DIR__ . '/../lib/Sabre/VObject/autoload.php';
+
+ fwrite(STDERR, "Generating " . $events . " events\n");
+
+diff --git a/bin/vobjectvalidate.php b/bin/vobjectvalidate.php
+index e0b2a47..4e9e606 100755
+--- a/bin/vobjectvalidate.php
++++ b/bin/vobjectvalidate.php
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env php
++#!/usr/bin/php
+ <?php
+
+ namespace Sabre\VObject;
+@@ -6,8 +6,8 @@ namespace Sabre\VObject;
+ // This sucks.. we have to try to find the composer autoloader. But chances
+ // are, we can't find it this way. So we'll do our bestest
+ $paths = array(
+- __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly
+- __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency.
++ __DIR__ . '/../lib/Sabre/VObject/autoload.php', // In case vobject is used from the package tree
++ __DIR__ . '/../share/php/Sabre/VObject/autoload.php', // In case vobject is used from the system path.
+ );
+
+ foreach($paths as $path) {
+diff --git a/tests/bootstrap.php b/tests/bootstrap.php
+index 3608abe..923bbf2 100644
+--- a/tests/bootstrap.php
++++ b/tests/bootstrap.php
+@@ -3,8 +3,8 @@
+ date_default_timezone_set('UTC');
+
+ $try = array(
+- __DIR__ . '/../vendor/autoload.php',
+- __DIR__ . '/../../../autoload.php',
++ __DIR__ . '/../lib/Sabre/VObject/autoload.php',
++ '/usr/share/php/Sabre/VObject/autoload.php',
+ );
+
+ foreach($try as $path) {
diff --git a/debian/patches/DEP-8/Use-installed-class-for-DEP-8-tests.patch b/debian/patches/DEP-8/Use-installed-class-for-DEP-8-tests.patch
deleted file mode 100644
index 863312f..0000000
--- a/debian/patches/DEP-8/Use-installed-class-for-DEP-8-tests.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
-Date: Wed, 19 Mar 2014 11:08:51 -0400
-Subject: Use installed class for DEP-8 tests
-
-Gbp: Topic DEP-8
----
- tests/bootstrap.php | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/tests/bootstrap.php b/tests/bootstrap.php
-index 8cb056a..62106a2 100644
---- a/tests/bootstrap.php
-+++ b/tests/bootstrap.php
-@@ -8,5 +8,4 @@ $loader = new ClassLoader();
- $loader->setUseIncludePath(true);
- $loader->register();
- $loader->addPrefixes(array(
-- 'Sabre' => __DIR__.'/../lib',
- ));
diff --git a/debian/patches/series b/debian/patches/series
index e4166b6..2ed88ed 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch
+0001-Use-homemade-autoloader.php.patch
diff --git a/debian/rules b/debian/rules
index a5cb11d..9667819 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,13 +2,17 @@
%:
dh $@ --with phpcomposer
+override_dh_auto_build:
+ dh_auto_build
+ phpab --output lib/Sabre/VObject/autoload.php lib/Sabre/VObject
+
override_dh_auto_clean:
rm -rf tests/temp
dh_auto_clean
override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
- cd tests && phpunit
+ phpunit --configuration tests/phpunit.xml
else
@echo "** tests disabled"
endif
diff --git a/debian/tests/control b/debian/tests/control
index 4959158..19902d6 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,2 @@
-Tests: phpunit
-Restrictions: rw-build-tree
-Depends: @, patch, php-symfony-class-loader, phpunit
+Test-Command: phpunit --configuration tests/phpunit.xml
+Depends: @, patch, phpunit
diff --git a/debian/tests/phpunit b/debian/tests/phpunit
deleted file mode 100755
index 7584ea9..0000000
--- a/debian/tests/phpunit
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-patch -p1 < debian/patches/DEP-8/Use-installed-class-for-DEP-8-tests.patch
-cd tests
-phpunit
-exit=$?
-cd ..
-patch -Rp1 < debian/patches/DEP-8/Use-installed-class-for-DEP-8-tests.patch
-exit $exit
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list