Blob Blame History Raw
# Generated by go2rpm
%bcond_without check

# https://github.com/google/martian
%global goipath         github.com/google/martian
Version:                3.1.0

%global goaltipaths     github.com/google/martian/v3

%gometa

%global common_description %{expand:
Martian Proxy is a programmable HTTP proxy designed to be used for testing.

Martian is a great tool to use if you want to:

 - Verify that all (or some subset) of requests are secure
 - Mock external services at the network layer
 - Inject headers, modify cookies or perform other mutations of HTTP requests
   and responses
 - Verify that pingbacks happen when you think they should
 - Unwrap encrypted traffic (requires install of CA certificate in browser)

By taking advantage of Go cross-compilation, Martian can be deployed anywhere
that Go can target.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Release:        5%{?dist}
Summary:        Library for building custom HTTP/S proxies

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}
# https://github.com/google/martian/issues/309
Patch0:         0001-Bypass-flag.Parse-in-init.patch

BuildRequires:  golang(golang.org/x/net/websocket)

%description
%{common_description}

%gopkg

%prep
%goprep
%patch0 -p1

%build
for cmd in cmd/* ; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
# https://github.com/google/martian/issues/271
# cmd/proxy: needs network
%gocheck -t marbl -t static -d body -d cmd/proxy -d trafficshape
%endif

%files
%license %{golicenses}
%doc %{godocs}
%{_bindir}/*

%gopkgfiles

%changelog
* Sat Dec 19 01:27:35 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 3.1.0-1
- Update to 3.1.0
- Close: rhbz#1889552

* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jul 22 17:58:38 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 3.0.0-4
- Add alternate goipath

* Fri Jan 31 16:35:28 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 3.0.0-3
- Fix FTBFS with Go 1.13+

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Wed Jul 24 22:59:12 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 3.0.0-1
- Release 3.0.0

* Tue Apr 23 10:11:39 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 2.1.0-3
- Update to new packaging

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Oct 05 2018 Robert-André Mauchin <zebob.m@gmail.com> - 2.1.0-1
- First package for Fedora