[packages/php-scssphp] new, version 0.6.6
glen
glen at pld-linux.org
Mon Oct 10 11:43:51 CEST 2016
commit 0d64aec8aebc8c5ec6269eb096b1d07bb244baa4
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Oct 10 12:43:20 2016 +0300
new, version 0.6.6
based on fedora package, ref: bec1d90
autoload.php | 19 ++++++++++++
php-scssphp.spec | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 109 insertions(+)
---
diff --git a/php-scssphp.spec b/php-scssphp.spec
new file mode 100644
index 0000000..e0cf80f
--- /dev/null
+++ b/php-scssphp.spec
@@ -0,0 +1,90 @@
+#
+# Conditional build:
+%bcond_with tests # build without tests
+
+%define github_commit 6fdfe19d2b13a3f12ba0792227f0718809ce4e4d
+
+%define pkgname scssphp
+%define php_min_version 5.4.0
+%include /usr/lib/rpm/macros.php
+Summary: A compiler for SCSS written in PHP
+Name: php-%{pkgname}
+Version: 0.6.6
+Release: 1
+License: MIT
+Group: Development/Libraries
+URL: http://leafo.github.io/scssphp
+# GitHub export does not include tests.
+# Run php-scssphp-get-source.sh to create full source.
+Source0: http://pkgs.fedoraproject.org/repo/pkgs/php-scssphp/php-scssphp-%{version}-%{github_commit}.tar.gz/97e6ff969551eece3a96b5cb0849ad59/php-scssphp-%{version}-%{github_commit}.tar.gz
+# Source0-md5: 97e6ff969551eece3a96b5cb0849ad59
+Source1: autoload.php
+BuildRequires: /usr/bin/php
+%if %{with tests}
+BuildRequires: php(core) >= %{php_min_version}
+BuildRequires: php(ctype)
+BuildRequires: php(date)
+BuildRequires: php(mbstring)
+BuildRequires: php(pcre)
+BuildRequires: php-symfony2-ClassLoader
+BuildRequires: phpunit
+%endif
+Requires: php(core) >= %{php_min_version}
+Requires: php(ctype)
+Requires: php(date)
+Requires: php(mbstring)
+Requires: php(pcre)
+Requires: php-cli
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+SCSS <http://sass-lang.com/> is a CSS preprocessor that adds many
+features like variables, mixins, imports, color manipulation,
+functions, and tons of other powerful features.
+
+The entire compiler comes in a single class file ready for including
+in any kind of project in addition to a command line tool for running
+the compiler from the terminal.
+
+scssphp implements SCSS. It does not implement the SASS syntax, only
+the SCSS syntax.
+
+%prep
+%setup -qn %{pkgname}-%{github_commit}
+
+: Bin
+sed "/scss.inc.php/s#.*#require_once '%{php_data_dir}/Leafo/ScssPhp/autoload.php';#" \
+ -i bin/pscss
+
+: Create autoloader
+cp -p %{SOURCE1} src/autoload.php
+
+%build
+%if %{with tests}
+: Library version value and autoloader check
+php -r '
+ require_once "src/autoload.php";
+ $version = ltrim(\Leafo\ScssPhp\Version::VERSION, "v");
+ echo "Version $version (expected %{version})\n";
+ exit(version_compare("%{version}", "$version", "=") ? 0 : 1);
+'
+phpunit --verbose \
+ --bootstrap src/autoload.php
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Leafo/ScssPhp}
+cp -a src/* $RPM_BUILD_ROOT%{php_data_dir}/Leafo/ScssPhp
+install -p bin/pscss $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.md composer.json LICENSE.md
+%attr(755,root,root) %{_bindir}/pscss
+%dir %{php_data_dir}/Leafo
+%{php_data_dir}/Leafo/ScssPhp
diff --git a/autoload.php b/autoload.php
new file mode 100644
index 0000000..769f8ba
--- /dev/null
+++ b/autoload.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Autoloader for php-scssphp and its' dependencies
+ *
+ * @return \Symfony\Component\ClassLoader\ClassLoader
+ */
+
+if (!isset($classloader) || !($classloader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
+ if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
+ require_once '/usr/share/php/Symfony/Component/ClassLoader/ClassLoader.php';
+ }
+
+ $classloader = new \Symfony\Component\ClassLoader\ClassLoader();
+ $classloader->register();
+}
+
+$classloader->addPrefix('Leafo\\ScssPhp\\', dirname(dirname(__DIR__)));
+
+return $classloader;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-scssphp.git/commitdiff/0d64aec8aebc8c5ec6269eb096b1d07bb244baa4
More information about the pld-cvs-commit
mailing list