diff --git a/0001-add-version-to-setup.cfg.patch b/0001-add-version-to-setup.cfg.patch new file mode 100644 index 0000000..0cac6ab --- /dev/null +++ b/0001-add-version-to-setup.cfg.patch @@ -0,0 +1,23 @@ +From 808e6eea0818aabca60c8093c914f711686830bc Mon Sep 17 00:00:00 2001 +From: liqiuyu123 +Date: Wed, 9 Nov 2022 17:38:08 +0800 +Subject: [PATCH] add version to setup.cfg + +--- + setup.cfg | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.cfg b/setup.cfg +index 54cbbc6..bed650f 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,5 +1,6 @@ + [metadata] + name = humanize ++version = 4.4.0 + description = Python humanize utilities + long_description = file: README.md + long_description_content_type = text/markdown +-- +2.37.1.windows.1 + diff --git a/humanize-4.1.0.tar.gz b/humanize-4.1.0.tar.gz deleted file mode 100644 index 36ba658..0000000 Binary files a/humanize-4.1.0.tar.gz and /dev/null differ diff --git a/humanize-4.4.0.tar.gz b/humanize-4.4.0.tar.gz new file mode 100644 index 0000000..5349e2a Binary files /dev/null and b/humanize-4.4.0.tar.gz differ diff --git a/python-humanize.spec b/python-humanize.spec index f450547..aa622cb 100644 --- a/python-humanize.spec +++ b/python-humanize.spec @@ -1,42 +1,70 @@ +%global _empty_manifest_terminate_build 0 Name: python-humanize -Version: 4.1.0 -Release: 2 -Summary: python humanize module +Version: 4.4.0 +Release: 1 +Summary: Python humanize utilities License: MIT -URL: https://github.com/jmoiron/humanize -Source0: https://pypi.python.org/packages/source/h/humanize/humanize-%{version}.tar.gz +URL: https://github.com/python-humanize/humanize +Source0: https://files.pythonhosted.org/packages/51/19/3e1adf0e7a8c8361496b085edcab2ddcd85410735a2b6fdd044247fc5b75/humanize-4.4.0.tar.gz +Patch0: 0001-add-version-to-setup.cfg.patch BuildArch: noarch -BuildRequires: python3-devel python3-setuptools python3-tools + +Requires: python3-importlib-metadata %description Python module that includes various common humanization utilities. %package -n python3-humanize -Summary: python3 humanize module -%{?python_provide:%python_provide python3-humanize} - +Summary: Python humanize utilities +Provides: python-humanize = 4.4.0 +BuildRequires: python3-devel +BuildRequires: python3-freezegun +BuildRequires: python3-pytest +BuildRequires: python3-pytest-cov +BuildRequires: python3-setuptools %description -n python3-humanize -Python3 module that includes various common humanization utilities. +Python module that includes various common humanization utilities. + +%package help +Summary: Development documents and examples for humanize +Provides: python3-humanize-doc +%description help +Python module that includes various common humanization utilities. %prep -%autosetup -p1 -n humanize-%{version} -for lib in humanize/time.py humanize/filesize.py humanize/number.py; do - sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && - touch -r $lib $lib.new && mv $lib.new $lib -done -rm -rf %{py3dir} -cp -a . %{py3dir} +%setup -n humanize-4.4.0 +%patch0 -p1 %build -pushd %{py3dir} -LANG=en_US.UTF-8 /usr/bin/python3 setup.py build -popd +%py3_build %install -pushd %{py3dir} -LANG=en_US.UTF-8 /usr/bin/python3 setup.py install --skip-build --root %{buildroot} -%find_lang humanize +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . %check %if %{?_with_check:1}%{!?_with_check:0} @@ -45,15 +73,16 @@ LANG=en_US.UTF-8 /usr/bin/python3 setup.py test popd %endif -%files -n python3-humanize -f %{py3dir}/humanize.lang -%doc LICENCE +%files -n python3-humanize -f filelist.lst %dir %{python3_sitelib}/* -%{python3_sitelib}/humanize/*.py -%{python3_sitelib}/humanize/__pycache__ -%{python3_sitelib}/humanize-0.0.0-py3.10.egg-info/* -%exclude %{_usr}/lib/python*/site-packages/humanize/locale/*/LC_MESSAGES/*.po + +%files help -f doclist.lst +%{_docdir}/* %changelog +* Mon Oct 24 2022 liqiuyu - 4.4.0-1 +- Upgrade to version 4.4.0 + * Tue Aug 02 2022 liqiuyu - 4.1.0-2 - Generate pythonX.Ydist(CANONICAL_NAME) tag diff --git a/python-humanize.yaml b/python-humanize.yaml index f51bcf2..4fff8cc 100644 --- a/python-humanize.yaml +++ b/python-humanize.yaml @@ -1,4 +1,4 @@ version_control: github -src_repo: jmoiron/humanize +src_repo: python-humanize/humanize tag_prefix: ^ -seperator: . +separator: .