summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-10-31 18:15:29 +0100
committerRemi Collet <fedora@famillecollet.com>2016-10-31 18:15:29 +0100
commit2c2aa05823b3e726aead850b9b6fdae901a9baa9 (patch)
tree29ef414193df87737989763773ed610e6b5ec31a
parent21f1d519f9c17ef246e18b15181e1eebb112dbf7 (diff)
php-andrewsville-php-token-reflection: add autooader
-rw-r--r--composer.json30
-rw-r--r--php-andrewsville-php-token-reflection.spec29
2 files changed, 51 insertions, 8 deletions
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..1569e61
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "andrewsville/php-token-reflection",
+ "type": "library",
+ "description": "Library emulating the PHP internal reflection using just the tokenized source code.",
+ "keywords": ["library", "tokenizer", "reflection"],
+ "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/",
+ "license": "BSD-3",
+
+ "authors": [
+ {
+ "name": "Ondřej Nešpor",
+ "homepage": "https://github.com/Andrewsville"
+ },
+ {
+ "name": "Jaroslav Hanslík",
+ "homepage": "https://github.com/kukulich"
+ }
+ ],
+
+ "require": {
+ "php": ">=5.3.0",
+ "ext-tokenizer": "*"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "TokenReflection": "./"
+ }
+ }
+}
diff --git a/php-andrewsville-php-token-reflection.spec b/php-andrewsville-php-token-reflection.spec
index 10d82ae..09a1740 100644
--- a/php-andrewsville-php-token-reflection.spec
+++ b/php-andrewsville-php-token-reflection.spec
@@ -14,7 +14,7 @@
Name: php-andrewsville-php-token-reflection
Version: 1.4.0
-Release: 2%{?dist}
+Release: 5%{?dist}
Summary: Library emulating the PHP internal reflection
Group: Development/Libraries
@@ -28,8 +28,9 @@ Source1: makesrc.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.3
+# Autoloader
+BuildRequires: php-composer(fedora/autoloader)
%if %{with_tests}
-BuildRequires: %{_bindir}/phpab
BuildRequires: %{_bindir}/phpunit
%endif
@@ -43,6 +44,8 @@ Requires: php-pcre
Requires: php-phar
Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(andrewsville/php-token-reflection) = %{version}
@@ -50,12 +53,22 @@ Provides: php-composer(andrewsville/php-token-reflection) = %{version}
%description
This library emulates the PHP reflection model using the tokenized PHP source.
+Autoloader: %{_datadir}/php/TokenReflection/autoload.php
+
+
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%build
-# Nothing
+cat << 'EOF' | tee TokenReflection/autoload.php
+<?php
+/* Autoloader for andrewsville/php-token-reflection and its dependencies */
+
+require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('TokenReflection\\', __DIR__);
+EOF
%install
@@ -66,11 +79,8 @@ cp -pr TokenReflection %{buildroot}%{_datadir}/php/TokenReflection
%if %{with_tests}
%check
-: generate the bootstrap/autoloader
-%{_bindir}/phpab --output TokenReflection/bs.php TokenReflection
-
: run test suite
-%{_bindir}/phpunit --bootstrap TokenReflection/bs.php \
+%{_bindir}/phpunit --bootstrap %{buildroot}%{_datadir}/php/TokenReflection/autoload.php \
tests || : results ignored for now, known upstream issues
%endif
@@ -88,8 +98,11 @@ rm -rf %{buildroot}
%changelog
+* Mon Oct 31 2016 Remi Collet <remi@fedoraproject.org> - 1.4.0-5
+- add autoloader using fedora/autoloader
+
* Mon May 4 2015 Remi Collet <remi@fedoraproject.org> - 1.4.0-2
- add mksrc.sh as source1, per review comment #1207591
* Tue Mar 31 2015 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
-- initial package \ No newline at end of file
+- initial package