2015-02-03 00:38:00 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-python-magic
|
|
|
|
#
|
2017-09-07 22:47:23 +02:00
|
|
|
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2015-02-03 00:38:00 +01:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-09-07 22:47:23 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
%bcond_with test
|
2015-02-03 00:38:00 +01:00
|
|
|
Name: python-python-magic
|
2017-09-07 22:47:23 +02:00
|
|
|
Version: 0.4.13
|
2015-02-03 00:38:00 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: File type identification using libmagic
|
|
|
|
License: Python-2.0
|
|
|
|
Group: Development/Languages/Python
|
2017-09-07 22:47:23 +02:00
|
|
|
Url: https://github.com/ahupp/python-magic
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/python-magic/python-magic-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2015-02-03 20:13:13 +01:00
|
|
|
BuildRequires: file
|
|
|
|
Requires: file
|
2017-09-07 22:49:16 +02:00
|
|
|
# python-python-magic and python-magic use the same namespace (ie. filename)
|
|
|
|
# and have a very similar functionality but are incompatible to each other.
|
|
|
|
# Upstream discussions:
|
|
|
|
# https://github.com/ahupp/python-magic/issues/21
|
|
|
|
# https://github.com/ahupp/python-magic/issues/33
|
|
|
|
# https://github.com/ahupp/python-magic/issues/57
|
2017-09-07 22:48:53 +02:00
|
|
|
Conflicts: python-magic
|
2015-02-03 00:38:00 +01:00
|
|
|
BuildArch: noarch
|
2017-09-07 22:47:23 +02:00
|
|
|
|
|
|
|
%python_subpackages
|
2015-02-03 00:38:00 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
This module uses ctypes to access the libmagic file type
|
|
|
|
identification library. It makes use of the local magic database and
|
|
|
|
supports both textual and MIME-type output.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n python-magic-%{version}
|
|
|
|
|
|
|
|
%build
|
2017-09-07 22:47:23 +02:00
|
|
|
%python_build
|
2015-02-03 00:38:00 +01:00
|
|
|
|
|
|
|
%install
|
2017-09-07 22:47:23 +02:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%if %{with test}
|
|
|
|
%check
|
|
|
|
pushd test
|
|
|
|
export PYTHONPATH='..'
|
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
%python_exec test.py
|
|
|
|
popd
|
|
|
|
%endif
|
2015-02-03 00:38:00 +01:00
|
|
|
|
2017-09-07 22:47:23 +02:00
|
|
|
%files %{python_files}
|
2015-02-03 00:38:00 +01:00
|
|
|
%defattr(-,root,root,-)
|
2017-09-07 22:47:23 +02:00
|
|
|
%doc LICENSE
|
|
|
|
%{python_sitelib}/magic.py*
|
|
|
|
%pycache_only %{python_sitelib}/__pycache__/magic*.py*
|
|
|
|
%{python_sitelib}/python_magic-%{version}-py*.egg-info
|
2015-02-03 00:38:00 +01:00
|
|
|
|
|
|
|
%changelog
|