python-pyxdg/python-pyxdg.spec
Tomáš Chvátal 17e8901053 Accepting request 780590 from home:mookmoz:branches:devel:languages:python
- Fix Menu.py using attributes that no longer exist
  Patch from https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/2

Upstream has had a merge request open since Nov 2018 for some obvious errors; this appears to have came from the Fedora package ( https://src.fedoraproject.org/rpms/pyxdg/blob/master/f/pyxdg-0.26-getType-fix.patch ): the author seems to be the Fedora maintainer.

I'm still new-ish to the OBS process; please let me know if you'd like changes. Not entirely happy with the patch name, but I have not found a good way to get a patch URL out of a GitLab merge request either.

Thanks!

OBS-URL: https://build.opensuse.org/request/show/780590
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyxdg?expand=0&rev=20
2020-03-02 08:24:33 +00:00

83 lines
2.7 KiB
RPMSpec

#
# spec file for package python-pyxdg
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-pyxdg
Version: 0.26
Release: 0
Summary: Implementations of freedesktop.org standards in python
License: LGPL-2.1-only
Group: Development/Languages/Python
URL: http://freedesktop.org/wiki/Software/pyxdg
Source: https://files.pythonhosted.org/packages/source/p/pyxdg/pyxdg-%{version}.tar.gz
Patch0: resource_leak.patch
Patch1: https://gitlab.freedesktop.org/tcallawa/pyxdg/-/commit/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff
BuildRequires: %{python_module nose}
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python-rpm-macros
BuildRequires: shared-mime-info
Requires: hicolor-icon-theme
Requires: shared-mime-info
Provides: python-xdg = %{version}
Obsoletes: python-xdg < %{version}
BuildArch: noarch
%ifpython2
Obsoletes: %{oldpython}-xdg < %{version}
Provides: %{oldpython}-xdg = %{version}
%endif
%python_subpackages
%description
PyXDG is a python library to access freedesktop.org standards. Currently supported are:
* Base Directory Specification Version 0.6
* Menu Specification Version 1.0
* Desktop Entry Specification Version 1.0
* Icon Theme Specification Version 0.8
* Recent File Spec 0.2
* Shared-MIME-Database Specification 0.13
%prep
%setup -q -n pyxdg-%{version}
%patch0 -p1
%patch1 -p1
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{python_sitelib}
%check
# https://gitlab.freedesktop.org/xdg/pyxdg/issues/15
# test_get_type{,2} both fail but come from s-m-i package for data
# https://gitlab.freedesktop.org/xdg/pyxdg/merge_requests/4
%{python_expand sed -i "s/Exec=python.*$/Exec=$python/" test/resources.py
nosetests-%{$python_bin_suffix} -e test_get_type*
}
%files %{python_files}
%license COPYING
%doc README AUTHORS ChangeLog
%{python_sitelib}/xdg
%{python_sitelib}/pyxdg-%{version}-py*.egg-info
%changelog