%{?nodejs_find_provides_and_requires} %global enable_tests 1 Name: nodejs-colors0 Version: 0.6.2 Release: 1%{?dist} Summary: Get colors in your Node.js console License: MIT Group: System Environment/Libraries URL: https://github.com/Marak/colors.js Source0: http://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 Obsoletes: nodejs-colors < 1 %description Get colors in your Node.js console. This is the older 0.6 compatiblity release of nodejs-colors, please consider using the newer nodejs-colors 1.x release. %prep %setup -q -n package %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/colors@0 cp -pr package.json colors.js themes/ \ %{buildroot}%{nodejs_sitelib}/colors@0 # Compat symlink. Link to old version on released Fedoras %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 21) ln -sf colors@0 %{buildroot}%{nodejs_sitelib}/colors %endif %nodejs_symlink_deps %if 0%{?enable_tests} %check %__nodejs test.js %endif %files %doc MIT-LICENSE.txt ReadMe.md example.html example.js %{nodejs_sitelib}/colors@0 %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 - 0.6.2-1 - Initial package based on the nodejs-colors-0.6.2-2 package