Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-url2
Version:    1.0.0
Release:    1%{?dist}
Summary:    The Node.js URL module plus relative paths
License:    MIT
Group:      System Environment/Libraries
URL:        https://github.com/kriskowal/url2
Source0:    http://registry.npmjs.org/url2/-/url2-%{version}.tgz

BuildArch:  noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(jasmine-node)
%endif

%description
This module builds upon the existing URL module in Node.js, but adds
relative(source, target) which returns the shortest relative path between
any two equally qualified URLs. If the paths are not equally qualified,
it returns the target.

In addition, this package augments the URL object definition as returned
by parse and consumed by format.


%prep
%setup -q -n package


%build
#nothing to do


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/url2
cp -pr package.json url2.js \
    %{buildroot}%{nodejs_sitelib}/url2

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/jasmine-node/bin/jasmine-node test
%endif


%files
%doc LICENSE.md README.md
%{nodejs_sitelib}/url2


%changelog
* Tue Jul 30 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.0.0-1
- update to upstream release 1.0.0
- restrict to compatible arches

* Thu Jun 20 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.0-2
- enable tests

* Wed Feb 13 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.0-1
- initial package