# This macro is needed at the start for building on EL6 %{?nodejs_find_provides_and_requires} %global enable_tests 0 %global barename pac-proxy-agent Name: nodejs-pac-proxy-agent Version: 2.0.0 Release: 1%{?dist} Summary: A PAC file proxy `http.Agent` implementation for HTTP License: MIT URL: https://www.npmjs.org/package/pac-proxy-agent Source0: https://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz # This patch is now obsolete, but I'm leaving it here as a comment for # historical reasons #Patch0: 0001-update-stream-to-buffer-to-raw-body-stream-to-buffer.patch 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(socksv5) BuildRequires: npm(proxy) %endif %description This module provides an `http.Agent` implementation that retrieves the specified PAC proxy file and uses it to resolve which HTTP, HTTPS, or SOCKS proxy, or if a direct connection should be used to connect to the HTTP endpoint. %prep %setup -q -n package # stream-to-buffer module is deprecated, patch to use raw-body module #%%patch0 -p1 # Remove bundled node_modules if there are any.. rm -rf node_modules/ %nodejs_fixdep --caret %nodejs_fixdep agent-base %nodejs_fixdep stream-to-array ~x %nodejs_fixdep extend %nodejs_fixdep debug %nodejs_fixdep raw-body %nodejs_fixdep http-proxy-agent ^2.0.0 %nodejs_fixdep https-proxy-agent ^2.1.0 %build # Nothing to build. %install mkdir -p %{buildroot}%{nodejs_sitelib}/pac-proxy-agent cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/pac-proxy-agent %nodejs_symlink_deps %check %if 0%{?enable_tests} %nodejs_symlink_deps --check mocha --reporter spec %endif %files %doc README.md %{nodejs_sitelib}/pac-proxy-agent/ %changelog * Mon Sep 18 2017 Jared Smith - 2.0.0-1 - Update to upstream 2.0.0 release * Thu Jul 27 2017 Fedora Release Engineering - 1.0.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 1.0.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Thu Feb 04 2016 Fedora Release Engineering - 1.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Aug 31 2015 Piotr Popieluch - 1.0.0-3 - patch out stream-to-buffer * Mon Aug 31 2015 Piotr Popieluch - 1.0.0-2 - add fixdep npm(debug) and widen npm(extend) * Sun Aug 30 2015 Piotr Popieluch - 1.0.0-1 - Update to new version * Sat Jul 25 2015 Parag Nemade - 0.1.2-3 - fixdep npm(extend) * Wed Jun 17 2015 Fedora Release Engineering - 0.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Tue Jul 22 2014 Ralph Bean - 0.1.2-1 - Initial packaging for Fedora.