%global modname punycode %if ! ( 0%{?fedora} || 0%{?rhel} >= 7 ) %{?nodejs_find_provides_and_requires} %global nodejs_arches %{ix86} x86_64 %{arm} %endif # tests are disabled until qunit is packaged %bcond_with tests Name: nodejs-%{modname} Version: 1.3.1 Release: 1%{?dist} Summary: Punycode conversion library for Nodejs License: MIT URL: http://mths.be/punycode Source0: http://registry.npmjs.org/%{modname}/-/%{modname}-%{version}.tgz # git archive --format=tar --prefix=tests/ v1.3.1:tests/ | bzip2 >tests-1.3.1.tar.bz2 Source1: tests-%{version}.tar.bz2 BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: web-assets-devel Requires: js-%{modname} = %{version}-%{release} %if %{with tests} BuildRequires: nodejs BuildRequires: nodejs-qunit %endif %description A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms. %package -n js-%{modname} Summary: Punycode conversion library for JavaScript Requires: web-assets-filesystem %description -n js-%{modname} A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms. %prep %setup -q -n package %setup -q -T -D -a 1 -n package %build # nothing to do %if %{with tests} %check %nodejs_symlink_deps --check node tests/tests.js %endif %install mkdir -p %{buildroot}%{_jsdir}/%{modname} cp -p punycode.js %{buildroot}%{_jsdir}/%{modname}/ mkdir -p %{buildroot}%{nodejs_sitelib}/%{modname} cp -p package.json %{buildroot}%{nodejs_sitelib}/%{modname}/ ln -s %{_jsdir}/%{modname}/punycode.js %{buildroot}%{nodejs_sitelib}/%{modname}/ %nodejs_symlink_deps %files %{nodejs_sitelib}/%{modname} %files -n js-%{modname} %doc README.md LICENSE-MIT.txt %{_jsdir}/%{modname} %changelog * Sun Oct 12 2014 Dan Callaghan - 1.3.1-1 - initial version