forked from pool/python-recommonmark
103 lines
3.2 KiB
RPMSpec
103 lines
3.2 KiB
RPMSpec
![]() |
#
|
||
|
# spec file for package python-recommonmark
|
||
|
#
|
||
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||
|
#
|
||
|
# All modifications and additions to the file contributed by third parties
|
||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||
|
# upon. The license for this file, and modifications and additions to the
|
||
|
# file, is the same license as for the pristine package itself (unless the
|
||
|
# license for the pristine package is not an Open Source License, in which
|
||
|
# case the license is the MIT License). An "Open Source License" is a
|
||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||
|
# published by the Open Source Initiative.
|
||
|
|
||
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||
|
#
|
||
|
|
||
|
|
||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||
|
Name: python-recommonmark
|
||
|
Version: 0.4.0
|
||
|
Release: 0
|
||
|
Summary: Python docutils-compatibility bridge to CommonMark
|
||
|
License: MIT
|
||
|
Group: Development/Languages/Python
|
||
|
Url: https://github.com/rtfd/recommonmark
|
||
|
Source0: https://files.pythonhosted.org/packages/source/r/recommonmark/recommonmark-%{version}.tar.gz
|
||
|
Source1: https://raw.githubusercontent.com/rtfd/recommonmark/master/license.md
|
||
|
Source2: https://raw.githubusercontent.com/rtfd/recommonmark/master/README.md
|
||
|
BuildRequires: fdupes
|
||
|
BuildRequires: python-rpm-macros
|
||
|
BuildRequires: %{python_module devel}
|
||
|
BuildRequires: %{python_module setuptools}
|
||
|
BuildRequires: %{python_module docutils}
|
||
|
BuildRequires: %{python_module CommonMark}
|
||
|
Requires: python-docutils
|
||
|
Requires: python-CommonMark
|
||
|
Provides: python-reCommonMark = %{version}
|
||
|
Obsoletes: python-reCommonMark < %{version}
|
||
|
Requires(post): update-alternatives
|
||
|
Requires(preun): update-alternatives
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
BuildArch: noarch
|
||
|
|
||
|
%python_subpackages
|
||
|
|
||
|
%description
|
||
|
A python docutils-compatibility bridge to CommonMark.
|
||
|
|
||
|
This allows you to write CommonMark inside of Docutils & Sphinx projects.
|
||
|
|
||
|
Documentation is available on Read the Docs:
|
||
|
http://recommonmark.readthedocs.org
|
||
|
|
||
|
|
||
|
%prep
|
||
|
%setup -q -n recommonmark-%{version}
|
||
|
# Remove upstream's egg-info
|
||
|
rm -rf %{pypi_name}.egg-info
|
||
|
#Add missing license and readme
|
||
|
cp -a %{SOURCE1} .
|
||
|
cp -a %{SOURCE2} .
|
||
|
# find and remove unneeded shebangs
|
||
|
find recommonmark -name "*.py" | xargs sed -i '1 {/^#!/ d}'
|
||
|
|
||
|
|
||
|
%build
|
||
|
%python_build
|
||
|
|
||
|
|
||
|
%install
|
||
|
%python_install
|
||
|
%fdupes %{buildroot}%{_prefix}
|
||
|
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2html
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2latex
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2man
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2pseudoxml
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2xetex
|
||
|
%python_clone -a %{buildroot}%{_bindir}/cm2xml
|
||
|
|
||
|
|
||
|
%post
|
||
|
%{python_install_alternative cm2man cm2latex cm2xetex cm2pseudoxml cm2html cm2xml}
|
||
|
|
||
|
%preun
|
||
|
%python_uninstall_alternative cm2man
|
||
|
|
||
|
|
||
|
%files %{python_files}
|
||
|
%defattr(-,root,root,-)
|
||
|
%doc README.md license.md
|
||
|
%python_alternative %{_bindir}/cm2html
|
||
|
%python_alternative %{_bindir}/cm2latex
|
||
|
%python_alternative %{_bindir}/cm2man
|
||
|
%python_alternative %{_bindir}/cm2pseudoxml
|
||
|
%python_alternative %{_bindir}/cm2xetex
|
||
|
%python_alternative %{_bindir}/cm2xml
|
||
|
%{python_sitelib}/recommonmark/
|
||
|
%{python_sitelib}/recommonmark-%{version}-py*.egg-info
|
||
|
|
||
|
%changelog
|