summaryrefslogtreecommitdiffstats
path: root/php-scssphp.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-scssphp.spec')
-rw-r--r--php-scssphp.spec73
1 files changed, 32 insertions, 41 deletions
diff --git a/php-scssphp.spec b/php-scssphp.spec
index 2d94bb3..3a4a13c 100644
--- a/php-scssphp.spec
+++ b/php-scssphp.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-scssphp
#
-# Copyright (c) 2012-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2012-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
# Remi Collet <remi@fedoraproject.org>
#
# License: MIT
@@ -13,8 +13,8 @@
%global github_owner leafo
%global github_name scssphp
-%global github_version 0.6.6
-%global github_commit 6fdfe19d2b13a3f12ba0792227f0718809ce4e4d
+%global github_version 0.6.7
+%global github_commit 562213cd803e42ea53b0735554794c4022d8db89
%global composer_vendor leafo
%global composer_project scssphp
@@ -50,25 +50,25 @@ BuildRequires: php-cli
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo (computed from version 0.6.6)
+## phpcompatinfo (computed from version 0.6.7)
BuildRequires: php-ctype
BuildRequires: php-date
BuildRequires: php-mbstring
BuildRequires: php-pcre
## Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
Requires: php-cli
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 0.6.6)
+# phpcompatinfo (computed from version 0.6.7)
Requires: php-ctype
Requires: php-date
Requires: php-mbstring
Requires: php-pcre
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
@@ -88,43 +88,31 @@ terminal.
scssphp implements SCSS. It does not implement the SASS syntax, only the SCSS
syntax.
+Autoloader: %{phpdir}/Leafo/ScssPhp/autoload.php
+
%prep
%setup -qn %{github_name}-%{github_commit}
-: Bin
+: Adjust bin autoload require
sed "/scss.inc.php/s#.*#require_once '%{phpdir}/Leafo/ScssPhp/autoload.php';#" \
-i bin/pscss
+
+%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Leafo\\ScssPhp\\', dirname(dirname(__DIR__)));
-
-return $fedoraClassLoader;
+\Fedora\Autoloader\Autoload::addPsr4('Leafo\\ScssPhp\\', __DIR__);
AUTOLOAD
-%build
-# Empty build section, nothing to build
-
-
%install
rm -rf %{buildroot}
@@ -147,21 +135,19 @@ install -pm 0755 bin/pscss %{buildroot}%{_bindir}/
'
%if %{with_tests}
-run=0
-ret=0
-if which php56; then
- php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose \
- --bootstrap %{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php
-fi
-exit $ret
+BOOTSTRAP=%{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php
+
+: Upstream tests
+%{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP
+
+: Upstream tests with SCLs if available
+SCL_RETURN_CODE=0
+for SCL in %{?rhel:php55} php56 php70 php71; do
+ if which $SCL; then
+ $SCL %{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP || SCL_RETURN_CODE=1
+ fi
+done
+exit $SCL_RETURN_CODE
%else
: Tests skipped
%endif
@@ -182,6 +168,11 @@ rm -rf %{buildroot}
%changelog
+* Sat Mar 04 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 0.6.7-1
+- Updated to 0.6.7 (RHBZ #1426927)
+- Switch autoloader to php-composer(fedora/autoloader)
+- Test with SCLs if available
+
* Sun Sep 25 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 0.6.6-1
- Updated to 0.6.6 (RHBZ #1376293)