summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-03-30 10:42:28 +0200
committerRemi Collet <fedora@famillecollet.com>2017-03-30 10:42:28 +0200
commit39b0e8d0481b4269746f8c3f9d1357431a860c53 (patch)
tree64d76c72507fbe5cb4586670a4ee65869e5f9215
parente6a38be74e14f2030ecf7d74f898ce723ca6d371 (diff)
1.0.0rc1 from Fedora
-rw-r--r--.gitignore6
-rw-r--r--composer.json4
-rw-r--r--php-fedora-autoloader.spec72
3 files changed, 39 insertions, 43 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..95b26a9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
index dfde398..c7cfd3d 100644
--- a/composer.json
+++ b/composer.json
@@ -24,9 +24,9 @@
"php": ">= 5.3.3"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "*",
+ "friendsofphp/php-cs-fixer": "^2.0",
"phpdocumentor/phpdocumentor": "*",
- "phpunit/phpunit": "*",
+ "phpunit/phpunit": "^4.8.35 || ^5.7.11 || ^6.0.5",
"theseer/autoload": "^1.22"
},
"autoload": {
diff --git a/php-fedora-autoloader.spec b/php-fedora-autoloader.spec
index 2d60ae1..f636f14 100644
--- a/php-fedora-autoloader.spec
+++ b/php-fedora-autoloader.spec
@@ -2,8 +2,8 @@
#
# Fedora spec file for php-fedora-autoloader
#
-# Copyright (c) 2016 Shawn Iwinski <shawn@iwin.ski>
-# Remi Collet <remi@fedoraproject.org>
+# Copyright (c) 2016-2017 Shawn Iwinski <shawn@iwin.ski>
+# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -13,8 +13,9 @@
%global github_owner php-fedora
%global github_name autoloader
-%global github_version 0.2.1
-%global github_commit 98d5a2ec9389686eec8e185c1d0495ef1a6a75c3
+%global github_version 1.0.0
+%global github_commit addebaa1443049934a64377862227bbbeb3385dc
+%global github_release .rc1
%global composer_vendor fedora
%global composer_project autoloader
@@ -33,7 +34,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 2%{?github_release}%{?dist}
+Release: 0.1%{?github_release}%{?dist}
Summary: Fedora Autoloader
Group: Development/Libraries
@@ -41,7 +42,6 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -51,13 +51,15 @@ BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
BuildRequires: php-composer(theseer/autoload) >= %{phpab_min_ver}
BuildRequires: php-pear
-## phpcompatinfo (computed from version 0.2.1)
+## phpcompatinfo (computed from version 1.0.0)
+BuildRequires: php-ctype
BuildRequires: php-spl
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 0.2.1)
+# phpcompatinfo (computed from version 1.0.0)
+Requires: php-ctype
Requires: php-spl
# Composer
@@ -93,7 +95,9 @@ Provides needed tools to build other packages:
%prep
%setup -qn %{github_name}-%{github_commit}
-: Set autoload path in phpab template
+: Set autoload path in phpab templates
+sed "s#___AUTOLOAD_PATH___#'Fedora/Autoloader'#" \
+ res/phpab/fedora.php.tpl >res/phpab/fedora2.php.tpl
sed "s#___AUTOLOAD_PATH___#'%{phpdir}/Fedora/Autoloader'#" \
-i res/phpab/fedora.php.tpl
@@ -103,53 +107,34 @@ sed "s#___AUTOLOAD_PATH___#'%{phpdir}/Fedora/Autoloader'#" \
%install
-rm -rf %{buildroot}
: Main
mkdir -p %{buildroot}%{phpdir}/Fedora/Autoloader
cp -rp src/* %{buildroot}%{phpdir}/Fedora/Autoloader/
: Devel
mkdir -p %{buildroot}%{phpab_template_dir}
-cp -p res/phpab/fedora.php.tpl %{buildroot}%{phpab_template_dir}/
+cp -p res/phpab/fedora*.php.tpl %{buildroot}%{phpab_template_dir}/
%check
%if %{with_tests}
-# remirepo:15
-run=0
-ret=0
-if which php56; then
- : Run upstream test suite with PHP 5
- php56 -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php:%{_datadir}/pear \
- %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php || ret=1
- run=1
-fi
-if which php71; then
- : Run upstream test suite with PHP 7
- php71 -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php:%{_datadir}/pear \
- %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/php \
- -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \
- %{_bindir}/phpunit \
- --bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php \
- --verbose
-# remirepo:2
-fi
-exit $ret
+RETURN_CODE=0
+for PHP_EXEC in php %{?rhel:php54 php55} php56 php70 php71; do
+ if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC \
+ -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \
+ %{_bindir}/phpunit \
+ --bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php \
+ --verbose
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%dir %{phpdir}/Fedora
@@ -158,10 +143,15 @@ rm -rf %{buildroot}
%files devel
%doc *.md
%doc composer.json
-%{phpab_template_dir}/fedora.php.tpl
+%{phpab_template_dir}/fedora*.php.tpl
%changelog
+* Tue Mar 28 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-0.1.rc1
+- Update to 1.0.0
+- Test with SCLs if available
+- Add fedora2 template relying on include_path
+
* Fri Oct 28 2016 Shawn Iwinski <shawn@iwin.ski> - 0.2.1-2
- Do not install tests into buildroot