python-qrcode/python-qrcode.spec
2023-07-28 17:03:21 +08:00

75 lines
2.3 KiB
RPMSpec

Name: python-qrcode
Version: 7.4.2
Release: 1
Summary: Python QR Code image generator
License: BSD
URL: https://github.com/lincolnloop/python-qrcode
Source0: https://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
Patch0: Make-pypng-an-extra-dependency.patch
BuildArch: noarch
BuildRequires: python3-devel python3-setuptools python3-imaging python3-six
BuildRequires: python3-typing-extensions
%description
Python module for generating QR Codes.
%package -n python3-qrcode
Summary: Python QR Code image generator
Requires: python3-imaging python3-setuptools
Requires: python3-qrcode-core = %{version}-%{release}
%description -n python3-qrcode
Python module for generating QR Codes. Python 3 version.
%package -n python3-qrcode-core
Requires: python3-six
Summary: Python 3 QR Code image generator (core library)
%description -n python3-qrcode-core
Core Python 3 module for QR code generation. Does not contain image rendering.
%prep
%autosetup -n qrcode-%{version} -p1
rm qrcode/image/pure.py*
sed -i '1d' qrcode/console_scripts.py
%build
%py3_build
%install
%py3_install
ln -s qr %{buildroot}%{_bindir}/qrcode
%check
modules=$(find qrcode -name '*.py' \
| grep -v __init__ \
| sort \
| sed -e 's|/|.|g' \
| sed -e 's|.py$||g');
for m in $modules;
do
%{__python3} -c "import $m"
done
%files -n python3-qrcode
%{_bindir}/{qr,qrcode}
%{_mandir}/man1/qr.1*
%{python3_sitelib}/qrcode/image/{svg.py*,pil.py*,styledpil.py*}
%{python3_sitelib}/qrcode/image/__pycache__/{svg.*,pil.*,styledpil.*}
%{python3_sitelib}/qrcode/compat/*
%files -n python3-qrcode-core
%doc README.rst CHANGES.rst LICENSE
%{python3_sitelib}/qrcode*.egg-info
%{python3_sitelib}/qrcode/{*.py*,__pycache__}
%{python3_sitelib}/qrcode/image/{__init__.py*,base.py*,styles/}
%{python3_sitelib}/qrcode/image/__pycache__/{__init__.*,base.*}
%exclude %{python3_sitelib}/qrcode/tests
%changelog
* Fri Jul 28 2023 yaoxin <yao_xin001@hoperun.com> - 7.4.2-1
- Update to 7.4.2
* Wed May 18 2022 houyingchao <houyingchao@h-partners.com> - 7.3.1-1
- Upgrade to 7.3.1
* Thu May 14 2020 yanan li <liyanan032@huawei.com> - 6.1-2
- Package init