diff --git a/nodejs-underscore-dot-string-2.3.1-Ensure-correct-encoding.patch b/nodejs-underscore-dot-string-2.3.1-Ensure-correct-encoding.patch new file mode 100644 index 0000000..9ff6497 --- /dev/null +++ b/nodejs-underscore-dot-string-2.3.1-Ensure-correct-encoding.patch @@ -0,0 +1,32 @@ +From ed512e2f221362f8af932321c58c5b4c0b0bcf1d Mon Sep 17 00:00:00 2001 +From: Jamie Nguyen +Date: Sat, 22 Jun 2013 17:39:12 +0100 +Subject: [PATCH] Ensure correct encoding is used for 'rake build' + +--- + Rakefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Rakefile b/Rakefile +index 587c81b..2cd9eed 100644 +--- a/Rakefile ++++ b/Rakefile +@@ -4,7 +4,7 @@ task default: :test + desc 'Use UglifyJS to compress Underscore.string' + task :build do + require 'uglifier' +- source = File.read('lib/underscore.string.js') ++ source = File.read('lib/underscore.string.js', :encoding => 'utf-8') + compressed = Uglifier.compile(source, copyright: false) + File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } + compression_rate = compressed.length.to_f/source.length +@@ -20,4 +20,4 @@ task :test do + result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} + + exit(result1 && result2 ? 0 : 1) +-end +\ No newline at end of file ++end +-- +1.8.2.1 + diff --git a/nodejs-underscore-dot-string.spec b/nodejs-underscore-dot-string.spec new file mode 100644 index 0000000..3662e7e --- /dev/null +++ b/nodejs-underscore-dot-string.spec @@ -0,0 +1,57 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 +%global enable_minify 1 +Name: nodejs-underscore-dot-string +Version: 2.3.1 +Release: 1 +Summary: String manipulation extensions for the Underscore.js JavaScript library +License: MIT +URL: https://github.com/esamattis/underscore.string +Source0: http://registry.npmjs.org/underscore.string/-/underscore.string-%{version}.tgz +BuildArch: noarch +Patch0: %{name}-2.3.1-Ensure-correct-encoding.patch +BuildRequires: nodejs-devel +%if 0%{?enable_minify} +BuildRequires: rubygem-rake +BuildRequires: rubygem-uglifier +BuildRequires: rubygem-json +%endif +%if 0%{?enable_tests} +BuildRequires: npm(qunit) phantomjs +%endif +%description +%{summary}. + +%prep +%setup -q -n package +%patch0 -p1 +rm -f dist/* + +%build +%if 0%{?enable_minify} +/usr/bin/rake build +%endif + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/underscore.string +cp -pr package.json lib/ \ + %{buildroot}%{nodejs_sitelib}/underscore.string +%if 0%{?enable_minify} +cp -pr dist/ \ + %{buildroot}%{nodejs_sitelib}/underscore.string +%endif +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +ln -sf %{nodejs_sitelib} . +%endif + +%files +%doc README.markdown +%{nodejs_sitelib}/underscore.string + +%changelog +* Tue Aug 11 2020 zhanghua - 2.3.1-1 +- package init diff --git a/nodejs-underscore-dot-string.yaml b/nodejs-underscore-dot-string.yaml new file mode 100644 index 0000000..6fc8fb0 --- /dev/null +++ b/nodejs-underscore-dot-string.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: esamattis/underscore.string +tag_pattern: "^v" +seperator: "." diff --git a/underscore.string-2.3.1.tgz b/underscore.string-2.3.1.tgz new file mode 100644 index 0000000..af9a3e1 Binary files /dev/null and b/underscore.string-2.3.1.tgz differ