Add package
This commit is contained in:
parent
59262fbc88
commit
b7334b5ff9
BIN
docutils-0.14.tar.gz
Normal file
BIN
docutils-0.14.tar.gz
Normal file
Binary file not shown.
116
python-docutils.spec
Normal file
116
python-docutils.spec
Normal file
@ -0,0 +1,116 @@
|
||||
%global modname docutils
|
||||
%global flashfilename biohazard.swf
|
||||
%global flashfilepath docs/user/rst/images/
|
||||
|
||||
Name: python-%{modname}
|
||||
Version: 0.14
|
||||
Release: 6
|
||||
Summary: Documentation Utilities Written in Python, for General- and Special-Purpose Use
|
||||
License: Public Domain and BSD and Python and GPLv3+
|
||||
URL: http://docutils.sourceforge.net
|
||||
Source0: %{modname}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python2-devel python2-setuptools
|
||||
BuildRequires: python3-devel python2-tools
|
||||
|
||||
%global _description \
|
||||
Docutils is an open-source text processing system for processing plaintext\
|
||||
documentation into useful formats, such as HTML, LaTeX, man-pages,\
|
||||
open-document or XML. It includes reStructuredText, the easy to read, easy\
|
||||
to use, what-you-see-is-what-you-get plaintext markup language.
|
||||
|
||||
%description
|
||||
%{_description}
|
||||
|
||||
%package -n python2-%{modname}
|
||||
Summary: %{summary} for python2
|
||||
%{?python_provide:%python_provide python2-%{modname}}
|
||||
Provides: docutils = %{version}-%{release}
|
||||
Obsoletes: docutils < %{version}-%{release}
|
||||
|
||||
%description -n python2-%{modname}
|
||||
%{_description}
|
||||
|
||||
|
||||
%package -n python3-%{modname}
|
||||
Summary: %{summary} for python3
|
||||
%{?python_provide:%python_provide python3-%{modname}}
|
||||
|
||||
%description -n python3-%{modname}
|
||||
%{_description}
|
||||
|
||||
This package run under python3.
|
||||
|
||||
|
||||
%package_help
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version}
|
||||
|
||||
# Remove shebang from library files
|
||||
for file in {code_analyzer,punctuation_chars,error_reporting,smartquotes,math/latex2mathml,math/math2html}; do
|
||||
sed -i -e '/#! *\/usr\/bin\/.*/{1D}' docutils/utils/$file.py
|
||||
done
|
||||
sed -i -e '/#! *\/usr\/bin\/.*/{1D}' docutils/writers/xetex/__init__.py
|
||||
|
||||
iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp
|
||||
mv tmp tools/editors/emacs/IDEAS.rst
|
||||
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
|
||||
|
||||
%build
|
||||
%py2_build
|
||||
|
||||
pushd %{py3dir}
|
||||
%py3_build
|
||||
popd
|
||||
|
||||
%install
|
||||
%py2_install
|
||||
|
||||
rm -rf %{buildroot}%{python3_sitelib}/test
|
||||
mv %{flashfilepath}%{flashfilename} ./%{flashfilename}
|
||||
|
||||
rm -f %{buildroot}/%{_bindir}/*
|
||||
pushd %{py3dir}
|
||||
%py3_install
|
||||
mv %{flashfilepath}%{flashfilename} ./%{flashfilename}
|
||||
popd
|
||||
|
||||
for file in %{buildroot}/%{_bindir}/*.py; do
|
||||
mv $file `dirname $file`/`basename $file .py`
|
||||
done
|
||||
|
||||
|
||||
%check
|
||||
mv %{flashfilename} %{flashfilepath}%{flashfilename}
|
||||
python2 test/alltests.py
|
||||
rm %{flashfilepath}%{flashfilename}
|
||||
|
||||
pushd %{py3dir}
|
||||
mv %{flashfilename} %{flashfilepath}%{flashfilename}
|
||||
python3 test3/alltests.py
|
||||
rm %{flashfilepath}%{flashfilename}
|
||||
popd
|
||||
|
||||
|
||||
%files -n python2-%{modname}
|
||||
%license COPYING.txt licenses/*.txt
|
||||
%{python2_sitelib}/*
|
||||
|
||||
%files -n python3-%{modname}
|
||||
%license COPYING.txt licenses/*.txt
|
||||
%{python3_sitelib}/*
|
||||
%{_bindir}/*
|
||||
|
||||
%files help
|
||||
%doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
|
||||
%doc THANKS.txt docs tools/editors
|
||||
|
||||
%changelog
|
||||
* Tue Dec 10 2019 mengxian <mengxian@huawei.com> - 0.14-6
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user