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 http-proxy-agent

Name:               nodejs-http-proxy-agent
Version:            0.2.6
Release:            1%{?dist}
Summary:            An HTTP(s) proxy http.Agent implementation for HTTP

Group:              Development/Libraries
License:            MIT
URL:                https://www.npmjs.org/package/http-proxy-agent
Source0:            http://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

BuildRequires:      npm(debug)
BuildRequires:      npm(agent-base)
BuildRequires:      npm(extend)

Requires:           npm(debug)
Requires:           npm(agent-base)
Requires:           npm(extend)

%if 0%{?enable_tests}
BuildRequires:      npm(proxy)
BuildRequires:      npm(mocha)
%endif

%description
This module provides an `http.Agent` implementation that connects to a
specified HTTP or HTTPS proxy server, and can be used with the built-in
`http` module.

%prep
%setup -q -n package

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

%nodejs_fixdep --caret
%nodejs_fixdep debug ~x

%build
%nodejs_symlink_deps --build

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

%nodejs_symlink_deps

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

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

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