2019-04-03 08:07:29 +00:00
|
|
|
#
|
2022-07-15 07:05:59 +00:00
|
|
|
# spec file
|
2019-04-03 08:07:29 +00:00
|
|
|
#
|
2024-01-17 07:19:57 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
|
|
|
# Copyright (c) 2019-2024 Dr. Axel Braun <DocB@opensuse.org>
|
2019-04-03 08:07:29 +00: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 https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-01-17 07:19:57 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
|
|
|
|
2019-04-03 08:07:29 +00:00
|
|
|
%define base_name python-barcode
|
|
|
|
Name: python-%{base_name}
|
2023-09-21 08:46:08 +00:00
|
|
|
Version: 0.15.1
|
2019-04-03 08:09:08 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Library to create Barcodes with Python
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/WhyNotHugo/python-barcode
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/%{base_name}/%{base_name}-%{version}.tar.gz
|
2019-04-03 08:07:29 +00:00
|
|
|
BuildRequires: %{python_module Pillow}
|
2020-03-20 14:02:55 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2019-04-03 08:07:29 +00:00
|
|
|
BuildRequires: %{python_module setuptools_scm}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-04-08 08:33:54 +00:00
|
|
|
BuildRequires: dejavu-fonts
|
2019-04-03 08:07:29 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-04-08 08:33:54 +00:00
|
|
|
Requires: dejavu-fonts
|
2020-05-20 11:33:59 +00:00
|
|
|
Requires(post): update-alternatives
|
2022-07-15 07:05:59 +00:00
|
|
|
Requires(postun):update-alternatives
|
|
|
|
Provides: python-pyBarcode = %{version}-%{release}
|
|
|
|
Obsoletes: python-pyBarcode < %{version}-%{release}
|
2019-04-03 08:07:29 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Library to create standard barcodes with Python. No external modules needed (optional PIL support included).
|
2019-04-03 08:09:08 +00:00
|
|
|
|
2019-04-03 08:07:29 +00:00
|
|
|
%prep
|
|
|
|
%setup -q -n %{base_name}-%{version}
|
2019-04-08 08:33:54 +00:00
|
|
|
# Fix rpmlint warning about too many +x perms when these files get installed later.
|
|
|
|
find . -type f -exec chmod a-x {} +
|
2019-05-25 09:03:47 +00:00
|
|
|
# doc buildscripts we don't wanna ship
|
2020-03-20 14:02:55 +00:00
|
|
|
rm docs/Makefile
|
2019-04-03 08:07:29 +00:00
|
|
|
|
|
|
|
%build
|
2019-04-03 08:09:08 +00:00
|
|
|
%python_build
|
2019-04-03 08:07:29 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2020-05-20 11:33:59 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/python-barcode
|
2019-04-03 08:07:29 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2020-05-20 11:33:59 +00:00
|
|
|
find %{buildroot} -type f -name "*.ttf" | while read i; do
|
2019-04-08 08:33:54 +00:00
|
|
|
ln -fs "%{_datadir}/fonts/truetype/${i##*/}" "$i"
|
|
|
|
done
|
2022-07-15 07:05:59 +00:00
|
|
|
%{python_expand # copy docs for deduplication
|
|
|
|
mkdir -p %{buildroot}%{_docdir}
|
|
|
|
cp -r docs %{buildroot}%{_docdir}/$python-python-barcode
|
|
|
|
%fdupes %{buildroot}%{_docdir}/$python-python-barcode
|
|
|
|
}
|
2019-04-03 08:07:29 +00:00
|
|
|
|
|
|
|
%check
|
2020-03-20 14:02:55 +00:00
|
|
|
sed -i '/cov/d' setup.cfg
|
|
|
|
%pytest
|
2019-04-03 08:07:29 +00:00
|
|
|
|
2020-05-20 11:33:59 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative python-barcode
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative python-barcode
|
|
|
|
|
2019-04-03 08:07:29 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENCE
|
2022-07-15 07:05:59 +00:00
|
|
|
%doc %{_docdir}/%{python_flavor}-python-barcode
|
|
|
|
%{python_sitelib}/barcode
|
|
|
|
%{python_sitelib}/python_barcode-%{version}*-info
|
2020-05-20 11:33:59 +00:00
|
|
|
%python_alternative %{_bindir}/python-barcode
|
2019-04-03 08:07:29 +00:00
|
|
|
|
|
|
|
%changelog
|