From aca00b7281763e8dbcc6819cae04095d36dd9a9d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 22 2016 14:11:08 +0000 Subject: import nodejs010-nodejs-supports-color-3.1.1-3.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee1a450 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/supports-color-3.1.1.tgz diff --git a/.nodejs010-nodejs-supports-color.metadata b/.nodejs010-nodejs-supports-color.metadata new file mode 100644 index 0000000..c123f19 --- /dev/null +++ b/.nodejs010-nodejs-supports-color.metadata @@ -0,0 +1 @@ +10b730ea2c36e9f3790a035f71b007259260ec4b SOURCES/supports-color-3.1.1.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/test.js b/SOURCES/test.js new file mode 100644 index 0000000..d2af353 --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,27 @@ +/*global describe */ +'use strict'; +var assert = require('assert'); +var ansi = require('./ansi-styles'); + +// generates the screenshot +Object.keys(ansi).forEach(function (el) { + var style = ansi[el].open; + + if (el === 'reset') { + return; + } + + if (/^bg[^B]/.test(el)) { + style = ansi.black.open + style; + } + + process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' '); +}); + +describe('ansiStyles()', function () { + it('should return ANSI escape codes', function () { + assert.equal(ansi.green.open, '\x1b[32m'); + assert.equal(ansi.bgGreen.open, '\x1b[42m'); + assert.equal(ansi.green.close, '\x1b[39m'); + }); +}); diff --git a/SPECS/nodejs-supports-color.spec b/SPECS/nodejs-supports-color.spec new file mode 100644 index 0000000..47d83b8 --- /dev/null +++ b/SPECS/nodejs-supports-color.spec @@ -0,0 +1,87 @@ +%{?scl:%scl_package nodejs-supports-color} +%{!?scl:%global pkg_name %{name}} + +# This macro is needed at the start for building on EL6 +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +%global barename supports-color + +Name: %{?scl_prefix}nodejs-supports-color +Version: 3.1.1 +Release: 3%{?dist} +Summary: Detect whether a terminal supports color + +Group: Development/Libraries +License: MIT +URL: https://www.npmjs.org/package/supports-color +Source0: http://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz +#Source2: https://raw.githubusercontent.com/sindresorhus/supports-color/master/test.js +Source2: test.js + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: nodejs010-runtime + +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(require-uncached) +BuildRequires: %{?scl_prefix}npm(mocha) +%endif + +%description +Detect whether a terminal supports color + +%prep +%setup -q -n package +cp %{SOURCE2} . + +# Remove bundled node_modules if there are any.. +rm -rf node_modules/ + +#%%nodejs_fixdep --caret + +%build +# This causes warnings when running the tests +#%nodejs_symlink_deps --build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/supports-color +cp -pr browser.js index.js package.json \ + %{buildroot}%{nodejs_sitelib}/supports-color + +%nodejs_symlink_deps + +%check +%if 0%{?enable_tests} +%nodejs_symlink_deps --check +mocha +%endif + +%files +%{!?_licensedir:%global license %doc} +%license license +%doc readme.md +%{nodejs_sitelib}/supports-color/ + +%changelog +* Thu Jan 07 2016 Tomas Hrcka - 3.1.1-2 +- Enable scl macros + +* Mon Sep 14 2015 Troy Dawson - 3.1.1-1 +- Update to 3.1.1 (no longer has a binary) +- Remove tests until all dependencies are built + +* Tue Feb 10 2015 Ralph Bean - 1.2.0-2 +- Include license from github. +- Enable tests. +- Make cli.js into a symlink. +- Comment out nodejs_symlink_deps --build, as per review. + +* Tue Dec 02 2014 Ralph Bean - 1.2.0-1 +- Initial packaging for Fedora.