Blob Blame History Raw
# This macro is needed at the start for building on EL6
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

%global barename pac-resolver

Name:               nodejs-pac-resolver
Version:            1.2.6
Release:            1%{?dist}
Summary:            Generates an asynchronous resolver function from a PAC file

License:            MIT
URL:                https://www.npmjs.org/package/pac-resolver
Source0:            https://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz
BuildArch:          noarch
%if 0%{?fedora} >= 19
ExclusiveArch:      %{nodejs_arches} noarch
%else
ExclusiveArch:      %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:      nodejs-packaging >= 6

%if 0%{?enable_tests}
BuildRequires:      npm(mocha)
BuildRequires:      npm(netmask)
BuildRequires:      npm(co)
BuildRequires:      npm(thunkify)
BuildRequires:      npm(degenerator)
BuildRequires:      npm(regenerator)
%endif


%description
This module accepts a JavaScript String of code, which is meant to be a
PAC proxy file, and returns a generated asynchronous `FindProxyForURL()`
function.

%prep
%setup -q -n package

# Remove bundled node_modules if there are any..
rm -rf node_modules/

%nodejs_fixdep --caret
%nodejs_fixdep co ~4.x

%build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/pac-resolver
cp -pr package.json shExpMatch.js dateRange.js dnsResolve.js isResolvable.js \
    timeRange.js weekdayRange.js localHostOrDomainIs.js dnsDomainIs.js \
    myIpAddress.js dnsDomainLevels.js isPlainHostName.js isInNet.js index.js \
    %{buildroot}%{nodejs_sitelib}/pac-resolver

%nodejs_symlink_deps


%check
%if 0%{?enable_tests}
%nodejs_symlink_deps --check
mocha --reporter spec
%endif


%files
%doc README.md
%{nodejs_sitelib}/pac-resolver/

%changelog
* Sat Sep 05 2015 Piotr Popieluch <piotr1212@gmail.com> - 1.2.6-1
- update to 1.2.6

* Sat Jul 25 2015 Parag Nemade <pnemade AT fedoraproject DOT org> - 1.2.4-3
- fixdep npm(co)

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 1.2.4-1
- new version

* Tue Jul 22 2014 Ralph Bean <rbean@redhat.com> - 1.2.2-1
- Initial packaging for Fedora.