%{?nodejs_find_provides_and_requires} %global enable_tests 1 Name: nodejs-colors Version: 1.0.3 Release: 1%{?dist} Summary: Get colors in your Node.js console License: MIT URL: https://github.com/Marak/colors.js Source0: https://registry.npmjs.org/colors/-/colors-%{version}.tgz BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging %description Get colors in your Node.js console. This is the newer 1.x release. See nodejs-colors0 for the older 0.6 compatibility version. %prep %setup -q -n package %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/colors@1 cp -pr package.json safe.js themes/ lib/ \ %{buildroot}%{nodejs_sitelib}/colors@1 # Compat symlink. Link to old version on released Fedoras %if (0%{?rhel} && 0%{?rhel} > 7) || (0%{?fedora} && 0%{?fedora} > 21) ln -sf colors@1 %{buildroot}%{nodejs_sitelib}/colors %endif %nodejs_symlink_deps %if 0%{?enable_tests} %check %__nodejs tests/basic-test.js && %__nodejs tests/safe-test.js %endif %files %doc ReadMe.md examples/ %license MIT-LICENSE.txt %{nodejs_sitelib}/colors@1 %if (0%{?rhel} && 0%{?rhel} > 7) || (0%{?fedora} && 0%{?fedora} > 21) %{nodejs_sitelib}/colors %endif %pretrans -p -- Define the path to directory being replaced below. -- DO NOT add a trailing slash at the end. path = "%{nodejs_sitelib}/colors" st = posix.stat(path) if st and st.type == "directory" then status = os.rename(path, path .. ".rpmmoved") if not status then suffix = 0 while not status do suffix = suffix + 1 status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) end os.rename(path, path .. ".rpmmoved") end end %changelog * Sun Feb 22 2015 Piotr Popieluch - 1.0.3-1 - updated to support multiple versions of nodejs-colors - update to upstream release 1.0.3 * Sat Jun 07 2014 Fedora Release Engineering - 0.6.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue Sep 03 2013 Jamie Nguyen - 0.6.2-1 - update to upstream release 0.6.2 * Sat Aug 03 2013 Fedora Release Engineering - 0.6.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Jul 06 2013 Jamie Nguyen - 0.6.0-3 - fix compatible arches for f18/el6 * Wed Jun 19 2013 T.C. Hollingsworth - 0.6.0-2 - rebuild for missing npm(colors) provides on EL6 - restrict to compatible arches * Wed Feb 13 2013 Jamie Nguyen - 0.6.0-1 - initial package