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

%global enable_tests 0

%global barename proxy-agent

Name:               nodejs-proxy-agent
Version:            2.0.0
Release:            2%{?dist}
Summary:            Maps proxy protocols to http.Agent implementations

License:            MIT
URL:                https://www.npmjs.org/package/proxy-agent
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(proxy)
BuildRequires:      npm(socksv5)
BuildRequires:      npm(stream-to-buffer)
%endif


%description
This module provides a function that returns proxying `http.Agent`
instances to use based off of a given proxy URI.

%prep
%setup -q -n package

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

%nodejs_fixdep --caret
%nodejs_fixdep lru-cache ~2.x
%nodejs_fixdep extend
%nodejs_fixdep debug

%build
# %%nodejs_symlink_deps --build

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

%nodejs_symlink_deps


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


%files
%doc README.md
%{nodejs_sitelib}/proxy-agent/

%changelog
* Sat Sep 05 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.0-2
- fixdep debug

* Sun Aug 30 2015 Piotr Popieluch <piotr1212@gmail.com> - 2.0.0-1
- update to new version

* Fri Jul 10 2015 Ralph Bean <rbean@redhat.com> - 1.1.0-3
- Fixdep on socks-proxy-agent

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

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