From 3af42fe075f3333441d27c3dd2720efd0fe2ee1d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 30 Jun 2015 13:33:10 +0200 Subject: php-scssphp: 0.1.6 (backport from fedora) --- php-scssphp-bin.patch | 20 +++------ php-scssphp-pre-0-1-0-compat.patch | 19 +++----- php-scssphp.spec | 91 +++++++++++++++++++++++++++----------- 3 files changed, 78 insertions(+), 52 deletions(-) diff --git a/php-scssphp-bin.patch b/php-scssphp-bin.patch index a941334..1513f17 100644 --- a/php-scssphp-bin.patch +++ b/php-scssphp-bin.patch @@ -1,21 +1,13 @@ diff --git a/bin/pscss b/bin/pscss -index 451f0fb..38f0a8e 100755 +index e986585..d68a875 100755 --- a/bin/pscss +++ b/bin/pscss -@@ -1,9 +1,14 @@ --#!/usr/bin/env php -+#!/usr/bin/php - +# Copyright (c) 2012-2015 Shawn Iwinski # Remi Collet # # License: MIT @@ -12,8 +13,8 @@ %global github_owner leafo %global github_name scssphp -%global github_version 0.1.1 -%global github_commit 8c08da585537e97efd528c7d278463d2b9396371 +%global github_version 0.1.6 +%global github_commit 22b369377e5db5a6a93cdb42485852fc652749c0 %global composer_vendor leafo %global composer_project scssphp @@ -22,10 +23,9 @@ %global php_min_ver 5.3.0 # Build using "--without tests" to disable tests -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} +%global with_tests 0%{!?_without_tests:1} -%{!?phpdir: %global phpdir %{_datadir}/php} -%{!?__phpunit: %global __phpunit %{_bindir}/phpunit} +%{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{github_name} Version: %{github_version} @@ -41,23 +41,32 @@ Patch1: %{name}-bin.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +# Tests %if %{with_tests} -# composer.json +## composer.json +BuildRequires: %{_bindir}/phpunit BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-phpunit-PHPUnit -# phpcompatinfo (computed from version 0.1.1) +## phpcompatinfo (computed from version 0.1.6) BuildRequires: php-ctype BuildRequires: php-date +BuildRequires: php-mbstring BuildRequires: php-pcre +## Autoloader +BuildRequires: php-composer(symfony/class-loader) %endif +Requires: php-cli # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 0.1.1) +# phpcompatinfo (computed from version 0.1.6) Requires: php-ctype Requires: php-date +Requires: php-mbstring Requires: php-pcre +# Autoloader +Requires: php-composer(symfony/class-loader) +# Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -77,11 +86,36 @@ the SCSS syntax. %prep %setup -qn %{github_name}-%{github_commit} -# Lib pre-0.1.0 compat +: Lib pre-0.1.0 compat %patch0 -p1 -# Bin +: Bin %patch1 -p1 +sed 's#__PHPDIR__#%{phpdir}#' -i bin/pscss + +: Create autoloader +(cat <<'AUTOLOAD' +register(); +} + +$fedoraClassLoader->addPrefix('Leafo\\ScssPhp\\', dirname(dirname(__DIR__))); + +return $fedoraClassLoader; +AUTOLOAD +) | tee src/autoload.php %build @@ -89,42 +123,49 @@ the SCSS syntax. %install -# Lib -mkdir -pm 0755 %{buildroot}%{phpdir}/Leafo/ScssPhp +rm -rf %{buildroot} + +: Lib +mkdir -p %{buildroot}%{phpdir}/Leafo/ScssPhp cp -pr src/* %{buildroot}%{phpdir}/Leafo/ScssPhp/ -# Lib pre-0.1.0 compat -mkdir -pm 0755 %{buildroot}%{phpdir}/%{github_name} +: Lib pre-0.1.0 compat +mkdir -p %{buildroot}%{phpdir}/%{github_name} cp -p classmap.php %{buildroot}%{phpdir}/%{github_name}/scss.inc.php -# Bin -mkdir -pm 0755 %{buildroot}%{_bindir} +: Bin +mkdir -p %{buildroot}%{_bindir} install -pm 0755 bin/pscss %{buildroot}%{_bindir}/ %check %if %{with_tests} - -%{__phpunit} \ - --bootstrap %{buildroot}%{phpdir}/%{github_name}/scss.inc.php \ - --include-path %{buildroot}%{phpdir} \ - -d date.timezone="UTC" +%{_bindir}/phpunit -v --bootstrap %{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php %else : Tests skipped %endif +%clean +rm -rf %{buildroot} + + %files %defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE.md -%doc README.md composer.json +%doc README.md +%doc composer.json %{phpdir}/%{github_name}/scss.inc.php %{phpdir}/Leafo/ScssPhp %{_bindir}/pscss %changelog +* Sun Jun 28 2015 Shawn Iwinski - 0.1.6-1 +- Updated to 0.1.6 (RHBZ #1226748) +- Added autoloader + * Thu Oct 30 2014 Shawn Iwinski - 0.1.1-1 - Updated to 0.1.1 (BZ #1126612) - Removed man page -- cgit