[packages/php-yui-css-compressor] package data files, use absolute path for include

glen glen at pld-linux.org
Wed Apr 26 12:27:27 CEST 2017


commit cc875250a0a9ef3135c52f1c63cc3a1b6490ad83
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Apr 26 12:24:58 2017 +0300

    package data files, use absolute path for include

 abspath.patch               | 20 ++++++++++++++++++++
 php-yui-css-compressor.spec | 12 ++++++++----
 2 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/php-yui-css-compressor.spec b/php-yui-css-compressor.spec
index 6179ace..93193b6 100644
--- a/php-yui-css-compressor.spec
+++ b/php-yui-css-compressor.spec
@@ -7,11 +7,12 @@
 Summary:	A PHP port of the YUI CSS compressor
 Name:		php-yui-css-compressor
 Version:	%{ver}.%{subver}
-Release:	1
+Release:	2
 License:	BSD
 Group:		Development/Languages/PHP
 Source0:	https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/archive/v%{ver}-p%{subver}/%{name}-%{version}.tar.gz
 # Source0-md5:	5013d0b1448cce1a001241d778c7c5f4
+Patch0:		abspath.patch
 URL:		https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.553
@@ -28,12 +29,14 @@ compressor.
 
 %prep
 %setup -q -n YUI-CSS-compressor-PHP-port-%{ver}-p%{subver}
+%patch0 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{php_data_dir}
-cp -p cssmin.php $RPM_BUILD_ROOT%{php_data_dir}
-ln -s cssmin.php $RPM_BUILD_ROOT%{php_data_dir}/CSSmin.php
+install -d $RPM_BUILD_ROOT%{php_data_dir}/cssmin
+ln -s cssmin/CSSmin.php $RPM_BUILD_ROOT%{php_data_dir}/cssmin.php
+ln -s cssmin/CSSmin.php $RPM_BUILD_ROOT%{php_data_dir}/CSSmin.php
+cp -a cssmin.php data $RPM_BUILD_ROOT%{php_data_dir}/cssmin
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -42,3 +45,4 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{php_data_dir}/cssmin.php
 %{php_data_dir}/CSSmin.php
+%{php_data_dir}/cssmin
diff --git a/abspath.patch b/abspath.patch
new file mode 100644
index 0000000..d2d8bbf
--- /dev/null
+++ b/abspath.patch
@@ -0,0 +1,20 @@
+--- YUI-CSS-compressor-PHP-port-2.4.8-p10/./cssmin.php~	2017-04-04 17:38:03.000000000 +0300
++++ YUI-CSS-compressor-PHP-port-2.4.8-p10/./cssmin.php	2017-04-26 12:23:21.253149342 +0300
+@@ -703,7 +703,7 @@
+     {
+         $patterns = array();
+         $replacements = array();
+-        $longNamedColors = include 'data/named-to-hex-color-map.php';
++        $longNamedColors = include __DIR__ '/data/named-to-hex-color-map.php';
+         $propertiesWithColors = array(
+             'color',
+             'background(?:-color)?',
+@@ -750,7 +750,7 @@
+         $pattern =
+             '/(=\s*?["\']?)?#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])(\}|[^0-9a-f{][^{]*?\})/iS';
+         $_index = $index = $lastIndex = $offset = 0;
+-        $longHexColors = include 'data/hex-to-named-color-map.php';
++        $longHexColors = include __DIR__ . '/data/hex-to-named-color-map.php';
+         $sb = array();
+ 
+         while (preg_match($pattern, $css, $m, 0, $offset)) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-yui-css-compressor.git/commitdiff/cc875250a0a9ef3135c52f1c63cc3a1b6490ad83



More information about the pld-cvs-commit mailing list