[packages/ruby-sass] inline VERSION and VERSION_NAME contents
glen
glen at pld-linux.org
Mon Dec 8 13:54:39 CET 2014
commit 749fb515b27b73748de5cde3959b3e184f782df3
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Dec 8 14:52:22 2014 +0200
inline VERSION and VERSION_NAME contents
ruby-sass.spec | 11 +++++++++--
version.patch | 15 +++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/ruby-sass.spec b/ruby-sass.spec
index 5cbdeea..e0f7b00 100644
--- a/ruby-sass.spec
+++ b/ruby-sass.spec
@@ -2,14 +2,16 @@
Summary: A powerful but elegant CSS compiler that makes CSS fun again
Name: ruby-%{pkgname}
Version: 3.4.2
-Release: 2
+Release: 3
License: MIT
Group: Development/Languages
Source0: http://rubygems.org/gems/%{pkgname}-%{version}.gem
# Source0-md5: 51f92be34834e250f4f55d93dbd2024a
+Patch0: version.patch
URL: http://github.com/rtomayko/sass
BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.665
+BuildRequires: sed >= 4.0
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -45,14 +47,19 @@ Dokumentacji w formacie ri dla %{pkgname}.
%prep
%setup -q -n %{pkgname}-%{version}
+%patch0 -p1
%build
+s=$(ruby -e "puts File.read('VERSION').strip.split('.').map {|n| n =~ /^[0-9]+$/ ? n.to_i : n}.inspect")
+%{__sed} -i -e "s#__VERSION__#$s#" lib/sass/version.rb
+s=$(ruby -e "puts File.read('VERSION_NAME').strip.inspect")
+%{__sed} -i -e "s#__VERSION_NAME__#$s#" lib/sass/version.rb
+
# write .gemspec
%__gem_helper spec
rdoc --ri --op ri lib
rdoc --op rdoc lib
-# rm -r ri/NOT_THIS_MODULE_RELATED_DIRS
rm ri/created.rid
%install
diff --git a/version.patch b/version.patch
new file mode 100644
index 0000000..23445f1
--- /dev/null
+++ b/version.patch
@@ -0,0 +1,15 @@
+--- sass-3.4.2/lib/sass/version.rb~ 2014-12-08 14:43:28.000000000 +0200
++++ sass-3.4.2/lib/sass/version.rb 2014-12-08 14:49:08.606534909 +0200
+@@ -47,9 +47,9 @@
+ def version
+ return @@version if defined?(@@version)
+
+- numbers = File.read(Sass::Util.scope('VERSION')).strip.split('.').
+- map {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
+- name = File.read(Sass::Util.scope('VERSION_NAME')).strip
++ numbers = __VERSION__
++ name = __VERSION_NAME__
++
+ @@version = {
+ :major => numbers[0],
+ :minor => numbers[1],
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-sass.git/commitdiff/e0e8467f1335c2893f328868a6483442f5e78c20
More information about the pld-cvs-commit
mailing list