From c185ae6e671c6bb261b62961b324f73603410842 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 24 Jul 2016 07:30:42 +0200 Subject: php-scssphp: 0.6.5 (backported from Fedora) --- composer.json | 43 +++++++++++++++++++++++++++ php-scssphp-get-source.sh | 2 +- php-scssphp-pre-0-1-0-compat.patch | 13 --------- php-scssphp.spec | 59 +++++++++++++++++++++----------------- 4 files changed, 77 insertions(+), 40 deletions(-) create mode 100644 composer.json delete mode 100644 php-scssphp-pre-0-1-0-compat.patch diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..112a6bd --- /dev/null +++ b/composer.json @@ -0,0 +1,43 @@ +{ + "name": "leafo/scssphp", + "type": "library", + "description": "scssphp is a compiler for SCSS written in PHP.", + "keywords": ["css", "stylesheet", "scss", "sass", "less"], + "homepage": "http://leafo.github.io/scssphp/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "autoload": { + "psr-4": { "Leafo\\ScssPhp\\": "src/" } + }, + "autoload-dev": { + "psr-4": { "Leafo\\ScssPhp\\Test\\": "tests/" } + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "~2.5", + "phpunit/phpunit": "~3.7", + "kherge/box": "~2.5" + }, + "bin": ["bin/pscss"], + "archive": { + "exclude": [ + "/Makefile", + "/.gitattributes", + "/.gitignore", + "/.travis.yml", + "/box.json.dist", + "/phpunit.xml.dist", + "/tests" + ] + } +} diff --git a/php-scssphp-get-source.sh b/php-scssphp-get-source.sh index 2397e9b..4ad1051 100755 --- a/php-scssphp-get-source.sh +++ b/php-scssphp-get-source.sh @@ -44,7 +44,7 @@ print "GIT_DIR = $GIT_DIR" TEMP_DIR=$(mktemp --dir) TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz -CMP_FILE=$PWD/composer-${VERSION}.json +CMP_FILE=$PWD/composer.json pushd $TEMP_DIR print "Cloning git repo..." diff --git a/php-scssphp-pre-0-1-0-compat.patch b/php-scssphp-pre-0-1-0-compat.patch deleted file mode 100644 index 69375aa..0000000 --- a/php-scssphp-pre-0-1-0-compat.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/classmap.php b/classmap.php -index 2d8a52b..749e01b 100644 ---- a/classmap.php -+++ b/classmap.php -@@ -11,6 +11,8 @@ - * @link http://leafo.github.io/scssphp - */ - -+require_once dirname(__DIR__) . '/Leafo/ScssPhp/autoload.php'; -+ - // @codingStandardsIgnoreStart - /** - * @deprecated since 0.1.0 diff --git a/php-scssphp.spec b/php-scssphp.spec index 815755f..affdd67 100644 --- a/php-scssphp.spec +++ b/php-scssphp.spec @@ -13,17 +13,17 @@ %global github_owner leafo %global github_name scssphp -%global github_version 0.4.0 -%global github_commit 78a6f27aa4eaf70bb3ff4d13b639bab71fdaf47a +%global github_version 0.6.5 +%global github_commit 0649d38dfef6808be1a89040a3312e8bda0b3aed %global composer_vendor leafo %global composer_project scssphp -# "php": ">=5.3.0" -%global php_min_ver 5.3.0 +# "php": ">=5.4.0" +%global php_min_ver 5.4.0 # Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +%global with_tests 0%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} @@ -41,9 +41,6 @@ URL: http://leafo.github.io/scssphp Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh -# Pre-0.1.0 compat -Patch0: %{name}-pre-0-1-0-compat.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Library version check @@ -53,11 +50,12 @@ BuildRequires: php-cli ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -## phpcompatinfo (computed from version 0.4.0) +## phpcompatinfo (computed from version 0.6.5) BuildRequires: php-ctype BuildRequires: php-date BuildRequires: php-mbstring BuildRequires: php-pcre +BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(symfony/class-loader) %endif @@ -65,11 +63,12 @@ BuildRequires: php-composer(symfony/class-loader) Requires: php-cli # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 0.4.0) +# phpcompatinfo (computed from version 0.6.5) Requires: php-ctype Requires: php-date Requires: php-mbstring Requires: php-pcre +Requires: php-spl # Autoloader Requires: php-composer(symfony/class-loader) @@ -95,9 +94,6 @@ syntax. %prep %setup -qn %{github_name}-%{github_commit} -: Lib pre-0.1.0 compat -%patch0 -p1 - : Bin sed "/scss.inc.php/s#.*#require_once '%{phpdir}/Leafo/ScssPhp/autoload.php';#" \ -i bin/pscss @@ -138,28 +134,36 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir}/Leafo/ScssPhp cp -pr src/* %{buildroot}%{phpdir}/Leafo/ScssPhp/ -: 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 -p %{buildroot}%{_bindir} install -pm 0755 bin/pscss %{buildroot}%{_bindir}/ %check -: Library version check -%{_bindir}/php -r 'require_once "%{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php"; - exit(version_compare("%{version}", ltrim(\Leafo\ScssPhp\Version::VERSION, "v"), "=") ? 0 : 1);' +: Library version value and autoloader check +%{_bindir}/php -r ' + require_once "%{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php"; + $version = ltrim(\Leafo\ScssPhp\Version::VERSION, "v"); + echo "Version $version (expected %{version})\n"; + exit(version_compare("%{version}", "$version", "=") ? 0 : 1); +' %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 - -if which php70; then - php70 %{_bindir}/phpunit --verbose \ - --bootstrap %{buildroot}%{phpdir}/Leafo/ScssPhp/autoload.php fi +exit $ret %else : Tests skipped %endif @@ -173,14 +177,17 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE.md -%doc README.md %doc composer.json -%{phpdir}/%{github_name}/scss.inc.php +%doc README.md %{phpdir}/Leafo/ScssPhp %{_bindir}/pscss %changelog +* Sat Jul 23 2016 Shawn Iwinski - 0.6.5-1 +- Updated to 0.6.5 (RHBZ #1347068) +- Dropped pre-0.1.0 compat + * Wed Jan 20 2016 Shawn Iwinski - 0.4.0-1 - Updated to 0.4.0 (RHBZ #1274939) - Removed php-json dependency -- cgit