File shyaml.spec of Package shyaml
#
# spec file for package shyaml
#
# Copyright (c) 2015 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/
#
Name: shyaml
Version: 0.4.1
Release: 0
Summary: Shell YAML parser
License: MIT
Group: Development/Languages/Python
Url: https://github.com/0k/shyaml
Source: https://pypi.python.org/pypi/shyaml/%{version}/shyaml-%{version}.tar.gz
%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
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-d2to1
Requires: python3-PyYAML
%define py_sitelib %{python3_sitelib}
%define pyth python3
%else
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-d2to1
%define py_sitelib %{python_sitelib}
# Packages below are only needed for documentation build
%if 0%{?suse_version}
Requires: python-PyYAML
%else
Requires: PyYAML
%endif
%define pyth python
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Simple scripts that allow read access to YAML files through command line.
This can be handy, if you want to get access to YAML data in your shell scripts.
This scripts supports only read access and it might not support all the
subtilties of YAML specification. But it should support some handy basic query
of YAML file.
%prep
%setup -q
%build
%pyth setup.py build
%install
%pyth setup.py install --prefix=%{_prefix} --root=%{buildroot} --install-data=%{py_sitelib}
chmod +x %{buildroot}/%{_bindir}/shyaml
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{_bindir}/shyaml
%{py_sitelib}/%{name}-*.egg-info
%changelog