diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4e33c6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/unique-filename-1.1.0.tgz diff --git a/.rh-nodejs6-nodejs-unique-filename.metadata b/.rh-nodejs6-nodejs-unique-filename.metadata new file mode 100644 index 0000000..b19c5d0 --- /dev/null +++ b/.rh-nodejs6-nodejs-unique-filename.metadata @@ -0,0 +1 @@ +d05f2fe4032560871f30e93cbe735eea201514f3 SOURCES/unique-filename-1.1.0.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/LICENSE-ISC.txt b/SOURCES/LICENSE-ISC.txt new file mode 100644 index 0000000..8351a30 --- /dev/null +++ b/SOURCES/LICENSE-ISC.txt @@ -0,0 +1,11 @@ +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/SOURCES/nodejs-unique-filename_fix-tests.patch b/SOURCES/nodejs-unique-filename_fix-tests.patch new file mode 100644 index 0000000..e65f3ba --- /dev/null +++ b/SOURCES/nodejs-unique-filename_fix-tests.patch @@ -0,0 +1,45 @@ +diff --git a/test/index.js b/test/index.js +index 105b4e5..39e1dab 100644 +--- a/test/index.js ++++ b/test/index.js +@@ -1,23 +1,25 @@ +-'sue strict' +-var t = require('tap') ++'use strict' ++var test = require('tap').test + var uniqueFilename = require('../index.js') + +-t.plan(6) ++test("test all the things", function (t) { ++ t.plan(6) + +-var randomTmpfile = uniqueFilename('tmp') +-t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file') ++ var randomTmpfile = uniqueFilename('tmp') ++ t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file') + +-var randomAgain = uniqueFilename('tmp') +-t.notEqual(randomAgain, randomTmpfile, 'random tmp files are not the same') ++ var randomAgain = uniqueFilename('tmp') ++ t.notEqual(randomAgain, randomTmpfile, 'random tmp files are not the same') + +-var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test') +-t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file') ++ var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test') ++ t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file') + +-var randomPrefixedAgain = uniqueFilename('tmp', 'my-test') +-t.notEqual(randomPrefixedAgain, randomPrefixedTmpfile, 'random prefixed tmp files are not the same') ++ var randomPrefixedAgain = uniqueFilename('tmp', 'my-test') ++ t.notEqual(randomPrefixedAgain, randomPrefixedTmpfile, 'random prefixed tmp files are not the same') + +-var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +-t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename') ++ var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') ++ t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename') + +-var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +-t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename') ++ var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') ++ t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename') ++}) diff --git a/SPECS/nodejs-unique-filename.spec b/SPECS/nodejs-unique-filename.spec new file mode 100644 index 0000000..bf284ae --- /dev/null +++ b/SPECS/nodejs-unique-filename.spec @@ -0,0 +1,80 @@ +%{?scl:%scl_package nodejs-unique-filename} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global packagename unique-filename +%global enable_tests 0 + +Name: %{?scl_prefix}nodejs-unique-filename +Version: 1.1.0 +Release: 3%{?dist} +Summary: Generate a unique filename for use in temporary directories or caches + +License: ISC +URL: https://github.com/iarna/unique-filename.git +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +Source1: LICENSE-ISC.txt +# Upstream does not have a license file + +Patch0: nodejs-unique-filename_fix-tests.patch +# the version of npm(tap) in Fedora is *very* old, so we have to patch the +# syntax to fit the old version of tap. If tap gets updated, we can remove +# this patch. + + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: %{?scl_prefix}nodejs-devel +BuildRequires: %{?scl_prefix}npm(unique-slug) +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(tap) +%endif + +%description +Generate a unique filename for use in temporary directories or caches. + +%prep +%setup -q -n package +%patch0 -p1 +cp -p %{SOURCE1} . + +%build +# nothing to do! + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json *.js \ + %{buildroot}%{nodejs_sitelib}/%{packagename} + +%nodejs_symlink_deps + +#%check +#%nodejs_symlink_deps --check +#%{__nodejs} -e 'require("./")' +#%if 0%{?enable_tests} +#%{_bindir}/tap test +#%else +#%{_bindir}/echo "Tests disabled..." +#%endif + +%files +%{!?_licensedir:%global license %doc} +%doc *.md +%license LICENSE-ISC.txt +%{nodejs_sitelib}/%{packagename} + +%changelog +* Thu Sep 15 2016 Zuzana Svetlikova - 1.1.0-3 +- Built for RHSCL + +* Thu Feb 04 2016 Fedora Release Engineering - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Dec 18 2015 Jared Smith - 1.1.0-1 +- Initial packaging