14
0

Accepting request 489636 from home:TheBlackCat:branches:devel:languages:python

- Implement single-spec version.

OBS-URL: https://build.opensuse.org/request/show/489636
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-blockdiag?expand=0&rev=3
This commit is contained in:
Todd R
2017-04-20 15:16:51 +00:00
committed by Git OBS Bridge
parent b64d465d45
commit 7058aac291
2 changed files with 49 additions and 30 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 20 15:16:20 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version.
-------------------------------------------------------------------
Thu Dec 1 20:18:05 UTC 2016 - termim@gmail.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-blockdiag
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@@ -15,7 +15,10 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# tests need network connection
%bcond_with tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-blockdiag
Version: 1.5.3
Release: 0
@@ -24,52 +27,63 @@ License: Apache-2.0
Group: Development/Languages/Python
Url: http://blockdiag.com/
Source: https://files.pythonhosted.org/packages/source/b/blockdiag/blockdiag-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: fdupes
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires: python-Pillow
Requires: python-funcparserlib
Requires: python-webcolors
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module Pillow >= 2.2.1}
BuildRequires: %{python_module funcparserlib >= 0.3.6}
BuildRequires: %{python_module reportlab}
BuildRequires: %{python_module webcolors}
%if %{with tests}
BuildRequires: %{python_module docutils}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module pep8 >= 1.3}
BuildRequires: %{python_module pip >= 1.4.1}
%endif
Requires: python-Pillow >= 2.2.1
Requires: python-funcparserlib >= 0.3.6
Requires: python-webcolors
Recommends: ghostscript
Recommends: python-Wand
Recommends: python-reportlab
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
`blockdiag` generate block-diagram image file from spec-text file.
* Generate block-diagram from dot like text (basic feature).
* Multilingualization for node-label (utf-8 only).
The blockdiag package generates block-diagram image file
from a spec-text file.
%prep
%setup -q -n blockdiag-%{version}
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes %{buildroot}%{python_sitelib}
mv %{buildroot}%{_bindir}/blockdiag %{buildroot}%{_bindir}/blockdiag-%{py_ver}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/blockdiag
%post
update-alternatives \
--install %{_bindir}/blockdiag blockdiag %{_bindir}/blockdiag-%{py_ver} 50
%python_install_alternative blockdiag
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove blockdiag %{_bindir}/blockdiag-%{py_ver}
fi
%preun
%python_uninstall_alternative blockdiag
%files
%if %{with tests}
%check
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGES.rst LICENSE README.rst
%{_bindir}/blockdiag-%{py_ver}
%python_alternative %{_bindir}/blockdiag
%{python_sitelib}/*
%ghost %{_sysconfdir}/alternatives/blockdiag
%changelog