Fix broken python-docutils provides (bug #1399655)
Use %license, python build macro Spec cleanup
This commit is contained in:
parent
909612be3e
commit
b03192047c
@ -1,8 +1,3 @@
|
||||
# Just a reminder to remove this when these conditions can no longer occur.
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 5
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora}
|
||||
%global with_python3 0%{!?_without_python3:1}
|
||||
%endif
|
||||
@ -11,7 +6,7 @@
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 0.13.1
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: System for processing plaintext documentation
|
||||
|
||||
Group: Development/Languages
|
||||
@ -26,11 +21,10 @@ URL: http://docutils.sourceforge.net
|
||||
# The tarball is in dist/docutils-VERSION.tar.gz
|
||||
Source0: %{srcname}-%{version}.tar.gz
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: python-setuptools
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python-tools
|
||||
@ -67,7 +61,7 @@ Python inline documentation modules and packages.
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-%{srcname}
|
||||
Summary: System for processing plaintext documentation for python3
|
||||
%{?python_provide:%python_provide python2-%{srcname}}
|
||||
%{?python_provide:%python_provide python3-%{srcname}}
|
||||
Group: Development/Languages
|
||||
|
||||
%description -n python3-%{srcname}
|
||||
@ -101,25 +95,22 @@ cp -a . %{py3dir}
|
||||
%endif
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||
%py2_build
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
||||
%py3_build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
# Must do the python3 install first because the scripts in /usr/bin are
|
||||
# overwritten by setup.py install (and we want the python2 version to be the
|
||||
# default for now).
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
%py3_install
|
||||
|
||||
# docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib.
|
||||
rm -rf %{buildroot}%{python3_sitelib}/test
|
||||
@ -131,7 +122,7 @@ popd
|
||||
rm -rf %{buildroot}%{_bindir}/*
|
||||
%endif # with_python3
|
||||
|
||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
||||
%py2_install
|
||||
|
||||
for file in %{buildroot}/%{_bindir}/*.py; do
|
||||
mv $file `dirname $file`/`basename $file .py`
|
||||
@ -156,23 +147,27 @@ rm docs/user/rst/images/biohazard.swf
|
||||
popd
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files -n python2-%{srcname}
|
||||
%license COPYING.txt licenses/*
|
||||
%doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
|
||||
%doc THANKS.txt licenses docs tools/editors
|
||||
%doc THANKS.txt docs tools/editors
|
||||
%{_bindir}/*
|
||||
%{python_sitelib}/*
|
||||
%{python2_sitelib}/*
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-%{srcname}
|
||||
%doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
|
||||
%doc THANKS.txt licenses docs tools/editors
|
||||
%license COPYING.txt licenses/*
|
||||
%doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
|
||||
%doc THANKS.txt docs tools/editors
|
||||
%{python3_sitelib}/*
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jan 30 2017 Orion Poplawski <orion@cora.nwra.com> - 0.13.1-3
|
||||
- Fix broken python-docutils provides (bug #1399655)
|
||||
- Use %%license, python build macro
|
||||
- Spec cleanup
|
||||
|
||||
* Sun Jan 29 2017 Kevin Fenzi <kevin@scrye.com> - 0.13.1-2
|
||||
- Rework packaging to make a python2 package and fix provides
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user