summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-bitmath.spec162
-rw-r--r--sources1
3 files changed, 164 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..5b94def 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/bitmath-1.3.3.1.tar.gz
diff --git a/python-bitmath.spec b/python-bitmath.spec
new file mode 100644
index 0000000..7c48905
--- /dev/null
+++ b/python-bitmath.spec
@@ -0,0 +1,162 @@
+%global _empty_manifest_terminate_build 0
+Name: python-bitmath
+Version: 1.3.3.1
+Release: 1
+Summary: Pythonic module for representing and manipulating file sizes with different prefix notations (file size unit conversion)
+License: MIT
+URL: https://github.com/tbielawa/bitmath
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ec/ec/808245570e00df2e1fe8252903da309f18eb58768f44fecc0215dafbc386/bitmath-1.3.3.1.tar.gz
+BuildArch: noarch
+
+
+%description
+`bitmath <http://bitmath.readthedocs.org/en/latest/>`_ simplifies many
+facets of interacting with file sizes in various units. Originally
+focusing on file size unit conversion, functionality now includes:
+* Converting between **SI** and **NIST** prefix units (``kB`` to ``GiB``)
+* Converting between units of the same type (SI to SI, or NIST to NIST)
+* Automatic human-readable prefix selection (like in `hurry.filesize <https://pypi.python.org/pypi/hurry.filesize>`_)
+* Basic arithmetic operations (subtracting 42KiB from 50GiB)
+* Rich comparison operations (``1024 Bytes == 1KiB``)
+* bitwise operations (``<<``, ``>>``, ``&``, ``|``, ``^``)
+* Reading a device's storage capacity (Linux/OS X support only)
+* `argparse <https://docs.python.org/2/library/argparse.html>`_
+ integration as a custom type
+* `progressbar <https://code.google.com/p/python-progressbar/>`_
+ integration as a better file transfer speed widget
+* String parsing
+* Sorting
+In addition to the conversion and math operations, `bitmath` provides
+human readable representations of values which are suitable for use in
+interactive shells as well as larger scripts and applications. The
+format produced for these representations is customizable via the
+functionality included in stdlibs `string.format
+<https://docs.python.org/2/library/string.html>`_.
+In discussion we will refer to the NIST units primarily. I.e., instead
+of "megabyte" we will refer to "mebibyte". The former is ``10^3 =
+1,000,000`` bytes, whereas the second is ``2^20 = 1,048,576``
+bytes. When you see file sizes or transfer rates in your web browser,
+most of the time what you're really seeing are the base-2 sizes/rates.
+**Don't Forget!** The source for bitmath `is available on GitHub
+<https://github.com/tbielawa/bitmath>`_.
+And did we mention there's almost 200 unittests? `Check them out for
+yourself <https://github.com/tbielawa/bitmath/tree/master/tests>`_.
+
+%package -n python3-bitmath
+Summary: Pythonic module for representing and manipulating file sizes with different prefix notations (file size unit conversion)
+Provides: python-bitmath
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-bitmath
+`bitmath <http://bitmath.readthedocs.org/en/latest/>`_ simplifies many
+facets of interacting with file sizes in various units. Originally
+focusing on file size unit conversion, functionality now includes:
+* Converting between **SI** and **NIST** prefix units (``kB`` to ``GiB``)
+* Converting between units of the same type (SI to SI, or NIST to NIST)
+* Automatic human-readable prefix selection (like in `hurry.filesize <https://pypi.python.org/pypi/hurry.filesize>`_)
+* Basic arithmetic operations (subtracting 42KiB from 50GiB)
+* Rich comparison operations (``1024 Bytes == 1KiB``)
+* bitwise operations (``<<``, ``>>``, ``&``, ``|``, ``^``)
+* Reading a device's storage capacity (Linux/OS X support only)
+* `argparse <https://docs.python.org/2/library/argparse.html>`_
+ integration as a custom type
+* `progressbar <https://code.google.com/p/python-progressbar/>`_
+ integration as a better file transfer speed widget
+* String parsing
+* Sorting
+In addition to the conversion and math operations, `bitmath` provides
+human readable representations of values which are suitable for use in
+interactive shells as well as larger scripts and applications. The
+format produced for these representations is customizable via the
+functionality included in stdlibs `string.format
+<https://docs.python.org/2/library/string.html>`_.
+In discussion we will refer to the NIST units primarily. I.e., instead
+of "megabyte" we will refer to "mebibyte". The former is ``10^3 =
+1,000,000`` bytes, whereas the second is ``2^20 = 1,048,576``
+bytes. When you see file sizes or transfer rates in your web browser,
+most of the time what you're really seeing are the base-2 sizes/rates.
+**Don't Forget!** The source for bitmath `is available on GitHub
+<https://github.com/tbielawa/bitmath>`_.
+And did we mention there's almost 200 unittests? `Check them out for
+yourself <https://github.com/tbielawa/bitmath/tree/master/tests>`_.
+
+%package help
+Summary: Development documents and examples for bitmath
+Provides: python3-bitmath-doc
+%description help
+`bitmath <http://bitmath.readthedocs.org/en/latest/>`_ simplifies many
+facets of interacting with file sizes in various units. Originally
+focusing on file size unit conversion, functionality now includes:
+* Converting between **SI** and **NIST** prefix units (``kB`` to ``GiB``)
+* Converting between units of the same type (SI to SI, or NIST to NIST)
+* Automatic human-readable prefix selection (like in `hurry.filesize <https://pypi.python.org/pypi/hurry.filesize>`_)
+* Basic arithmetic operations (subtracting 42KiB from 50GiB)
+* Rich comparison operations (``1024 Bytes == 1KiB``)
+* bitwise operations (``<<``, ``>>``, ``&``, ``|``, ``^``)
+* Reading a device's storage capacity (Linux/OS X support only)
+* `argparse <https://docs.python.org/2/library/argparse.html>`_
+ integration as a custom type
+* `progressbar <https://code.google.com/p/python-progressbar/>`_
+ integration as a better file transfer speed widget
+* String parsing
+* Sorting
+In addition to the conversion and math operations, `bitmath` provides
+human readable representations of values which are suitable for use in
+interactive shells as well as larger scripts and applications. The
+format produced for these representations is customizable via the
+functionality included in stdlibs `string.format
+<https://docs.python.org/2/library/string.html>`_.
+In discussion we will refer to the NIST units primarily. I.e., instead
+of "megabyte" we will refer to "mebibyte". The former is ``10^3 =
+1,000,000`` bytes, whereas the second is ``2^20 = 1,048,576``
+bytes. When you see file sizes or transfer rates in your web browser,
+most of the time what you're really seeing are the base-2 sizes/rates.
+**Don't Forget!** The source for bitmath `is available on GitHub
+<https://github.com/tbielawa/bitmath>`_.
+And did we mention there's almost 200 unittests? `Check them out for
+yourself <https://github.com/tbielawa/bitmath/tree/master/tests>`_.
+
+%prep
+%autosetup -n bitmath-1.3.3.1
+
+%build
+%py3_build
+
+%install
+%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 .
+
+%files -n python3-bitmath -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Mar 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.3.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..3479c7a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+041fb78aefe713f77dc1f9c08ea4e52b bitmath-1.3.3.1.tar.gz