summaryrefslogtreecommitdiff
path: root/httpie.spec
blob: 17fb9a8b4dd7afbc50bed4f79baf2599b6ce3356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Summary:	A Curl-like tool for humans
Name:		httpie
Version:	0.7.2
Release:	2
License:	BSD
Group:		Applications/Networking
Source0:	http://pypi.python.org/packages/source/h/httpie/%{name}-%{version}.tar.gz
# Source0-md5:	09218336048596da757c4f0cf19642fd
URL:		http://httpie.org/
BuildRequires:	python-distribute
BuildRequires:	rpm-pythonprov
BuildRequires:	sed >= 4.0
# Needed so we can build the manpage with help2man without fataling.
BuildRequires:	help2man
BuildRequires:	python-pygments
BuildRequires:	python-requests
Requires:	python-pygments
Requires:	python-requests
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
HTTPie is a CLI HTTP utility built out of frustration with existing
tools. The goal is to make CLI interaction with HTTP-based services as
human-friendly as possible.

HTTPie does so by providing an http command that allows for issuing
arbitrary HTTP requests using a simple and natural syntax and
displaying colorized responses.

%prep
%setup -q

sed -i '/#!\%{_prefix}\/bin\/env/d' %{name}/__main__.py

# Fedora currently only ships with Pygments 1.4 but httpie wants 1.5.
# Also, RHEL currently only ships with Pygments 1.1.
# However, it seems to work just fine with lower versions.
sed -i 's/Pygments>=1.5/Pygments>=1.1/' setup.py
sed -i 's/requests>=2.0.0/requests>=1.1.0/' setup.py

%build
%py_build

%install
rm -rf $RPM_BUILD_ROOT
%py_install
%py_postclean

export PYTHONPATH=$RPM_BUILD_ROOT%{py_sitescriptdir}
install -d $RPM_BUILD_ROOT%{_mandir}/man1
help2man --no-discard-stderr $RPM_BUILD_ROOT%{_bindir}/http > $RPM_BUILD_ROOT%{_mandir}/man1/http.1

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc LICENSE README.rst
%attr(755,root,root) %{_bindir}/http
%{_mandir}/man1/http.1*
%{py_sitescriptdir}/httpie
%{py_sitescriptdir}/httpie-%{version}-py*.egg-info