zypp-plugin/zypp-plugin.spec
ZYpp Developers caaabff5dc Update to last successful build
f41363a8dd45f0da9a961e8477459d08db95797c Merge pull request #2 from scarabeusiv/master
ae8eae774429e3a0b8bc201357b4cd41711b2544 Tweak bit more the spec to allow seamless migration from py2 to py3

OBS-URL: https://build.opensuse.org/package/show/zypp:Head/zypp-plugin?expand=0&rev=21
2018-01-16 18:30:12 +00:00

69 lines
2.1 KiB
RPMSpec

#
# spec file for package zypp-plugin
#
# Copyright (c) 2018 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-%{**}}
%define oldpython python
Name: zypp-plugin
Version: 0.6.3
Release: 0
Summary: Helper that makes writing ZYpp plugins easier
License: GPL-2.0
Group: System/Packages
Url: https://github.com/openSUSE/zypp-plugin
Source0: %{name}-%{version}.tar.bz2
BuildRequires: %{python_module devel}
BuildRequires: python-rpm-macros
Requires: python-base
BuildArch: noarch
# provide old names for py2 package
%ifpython2
Obsoletes: %{oldpython}-zypp-plugin < %{version}
Provides: %{oldpython}-zypp-plugin = %{version}
Obsoletes: zypp-plugin-python < %{version}
Provides: zypp-plugin-python = %{version}
%endif
%python_subpackages
%description
This API allows writing ZYpp plugins by just subclassing from a python class
and implementing the commands you want to respond to as python methods.
%prep
%setup -q -n zypp-plugin
%build
:
%install
%if 0%{?have_python2}
mkdir -p %{buildroot}%{python_sitelib}
install python/zypp_plugin.py %{buildroot}%{python_sitelib}/zypp_plugin.py
%py_compile -O %{buildroot}/%{python_sitelib}
%endif
%if 0%{?have_python3}
mkdir -p %{buildroot}%{python3_sitelib}
install python/zypp_plugin.py %{buildroot}%{python3_sitelib}/zypp_plugin.py
%py3_compile -O %{buildroot}/%{python3_sitelib}
%endif
%files %{python_files}
%doc COPYING
%{python_sitelib}/*
%changelog