summaryrefslogtreecommitdiffstats
path: root/SPECS/python-ghp-import.spec
blob: 33e928d4bf1dc98410e60b8b4550211c1b09ebe9 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%global gitname ghp-import
%global with_python3 1 
Name:           python-%{gitname}
Version:        0.4.1
Release:        2%{?dist}
Summary:        Copies docs directly to the gh-pages branch of a GitHub repo

License:        Tumbolia Public License
URL:            https://github.com/davisp/%{gitname}
Source0:        https://pypi.python.org/packages/source/g/%{gitname}/%{gitname}-%{version}.tar.gz
Patch0:         0001-make-file-open-py2-and-py3-friendly.patch
BuildArch:      noarch
BuildRequires:  python-devel
Requires:       git
%description
ghp-import manages content in the gh-pages branch of your GitHub repo. 
Use it to publish documentation or other content that requires sources 
in your main branch.

%if 0%{?with_python3}
%package -n python3-ghp-import
Summary:        Copies docs directly to the gh-pages branch of a GitHub repo
BuildRequires:  python3-devel
Requires:       git
%description -n python3-ghp-import
ghp-import manages content in the gh-pages branch of your GitHub repo. 
Use it to publish documentation or other content that requires sources 
in your main branch.
%endif

%prep
%setup -q -n %{gitname}-%{version}
%patch0 -p1
%build
export LANG=C
export LC_ALL=C
%{__python} setup.py build
mv build build2

%if 0%{?with_python3}
%{__python3} setup.py build
mv build build3
%endif


%install
mv build2 build
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv %{buildroot}/%{_bindir}/ghp-import %{buildroot}/%{_bindir}/ghp-import.%{python2_version}

%if 0%{?with_python3}
rm -rf build
mv build3 build
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv %{buildroot}/%{_bindir}/ghp-import %{buildroot}/%{_bindir}/ghp-import.%{python3_version}
%endif 

ln -s %{_bindir}/ghp-import.%{python2_version} %{buildroot}/%{_bindir}/ghp-import

%files
%doc README.md
%license LICENSE
%{_bindir}/ghp-import
%{_bindir}/ghp-import.%{python2_version}
%{python2_sitelib}/ghp_import-%{version}-py%{python2_version}.egg-info

%if 0%{?with_python3}
%files -n python3-ghp-import
%doc README.md
%license LICENSE
%{_bindir}/ghp-import.%{python3_version}
%{python3_sitelib}/ghp_import-%{version}-py%{python3_version}.egg-info
%endif
%changelog
* Tue Jan 20 2015 Pete Travis <immanetize@fedoraproject.org> 0.4.1-2
- Fix setup.py so python3 subpackage builds.
* Sun Jan 18 2015 Pete Travis <immanetize@fedoraproject.org> 0.4.1-1
- Initial build.