Accepting request 495465 from home:benoit_monin:branches:devel:languages:python
- convert the package to singlespec - call fdupes to fix duplicated files - fix encoding of the single file with CR/LF: avoid python-bytecode-inconsistent-mtime in every other files This time with %python_subpackages above %description. OBS-URL: https://build.opensuse.org/request/show/495465 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Markdown?expand=0&rev=37
This commit is contained in:
parent
3091530f95
commit
a7beaf5a5c
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun May 7 13:22:13 UTC 2017 - benoit.monin@gmx.fr
|
||||||
|
|
||||||
|
- convert the package to singlespec
|
||||||
|
- call fdupes to fix duplicated files
|
||||||
|
- fix encoding of the single file with CR/LF:
|
||||||
|
avoid python-bytecode-inconsistent-mtime in every other files
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jan 26 20:11:27 UTC 2017 - benoit.monin@gmx.fr
|
Thu Jan 26 20:11:27 UTC 2017 - benoit.monin@gmx.fr
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
|
%define oldpython python
|
||||||
Name: python-Markdown
|
Name: python-Markdown
|
||||||
Version: 2.6.8
|
Version: 2.6.8
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -24,22 +26,25 @@ License: BSD-3-Clause
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
Url: http://packages.python.org/Markdown/
|
Url: http://packages.python.org/Markdown/
|
||||||
Source: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
|
||||||
BuildRequires: python-PyYAML
|
BuildRequires: %{python_module PyYAML}
|
||||||
BuildRequires: python-devel
|
BuildRequires: %{python_module devel}
|
||||||
BuildRequires: python-nose
|
BuildRequires: %{python_module nose}
|
||||||
BuildRequires: python-xml
|
BuildRequires: %{python_module xml}
|
||||||
|
BuildRequires: fdupes
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-xml
|
Requires: python-xml
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun): update-alternatives
|
Requires(postun): update-alternatives
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Provides: python-markdown = %{version}
|
|
||||||
Obsoletes: python-markdown < %{version}
|
|
||||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
||||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
||||||
%else
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
%ifpython2
|
||||||
|
# older python2 version provided the package in lowercase
|
||||||
|
Provides: %{oldpython}-markdown = %{version}
|
||||||
|
Obsoletes: %{oldpython}-markdown < %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This is a Python implementation of John Gruber's [Markdown][].
|
This is a Python implementation of John Gruber's [Markdown][].
|
||||||
It is almost completely compliant with the reference implementation,
|
It is almost completely compliant with the reference implementation,
|
||||||
@ -50,41 +55,31 @@ supported by the [Available Extensions][].
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n Markdown-%{version}
|
%setup -q -n Markdown-%{version}
|
||||||
# Fix encoding
|
# Fix encoding
|
||||||
find . -type f -not -name py.png -print0 | xargs -0 sed -i "s|\r$||"
|
sed -i "s|\r$||" docs/release-2.2.0.txt
|
||||||
|
|
||||||
%build
|
%build
|
||||||
python setup.py build
|
%python_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
%python_install
|
||||||
|
%fdupes %{buildroot}%{_prefix}
|
||||||
|
|
||||||
# update-alternatives
|
%python_clone -a %{buildroot}%{_bindir}/markdown_py
|
||||||
mv %{buildroot}%{_bindir}/markdown_py %{buildroot}%{_bindir}/markdown_py-%{py_ver}
|
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
||||||
touch %{buildroot}%{_sysconfdir}/alternatives/markdown_py
|
|
||||||
ln -sf %{_sysconfdir}/alternatives/markdown_py %{buildroot}%{_bindir}/markdown_py
|
|
||||||
|
|
||||||
%if 0%{?suse_version} && 0%{?suse_version} > 1110
|
|
||||||
%check
|
%check
|
||||||
python run-tests.py
|
%python_exec run-tests.py
|
||||||
%endif
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
update-alternatives \
|
%python_install_alternative markdown_py
|
||||||
--install %{_bindir}/markdown_py markdown_py %{_bindir}/markdown_py-%{py_ver} 20
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ $1 -eq 0 ] ; then
|
%python_uninstall_alternative markdown_py
|
||||||
update-alternatives --remove markdown_py %{_bindir}/markdown_py-%{py_ver}
|
|
||||||
fi
|
|
||||||
|
|
||||||
%files
|
%files %{python_files}
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE.md README.md docs/*
|
%doc LICENSE.md README.md docs/*
|
||||||
%ghost %{_sysconfdir}/alternatives/markdown_py
|
%python_alternative %{_bindir}/markdown_py
|
||||||
%{_bindir}/markdown_py
|
%{python_sitelib}/Markdown-%{version}-py%{python_version}.egg-info
|
||||||
%{_bindir}/markdown_py-%{py_ver}
|
|
||||||
%{python_sitelib}/Markdown-%{version}-py%{py_ver}.egg-info
|
|
||||||
%{python_sitelib}/markdown
|
%{python_sitelib}/markdown
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user