forked from pool/python-blockdiag
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user