%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %global _short_name bitmath %global _short_release 1 Name: python-bitmath Summary: Aids representing and manipulating sizes in various prefix notations Version: 1.0.3 Release: %{_short_release}%{?dist} Group: Development/Libraries License: BSD Source0: https://github.com/tbielawa/bitmath/archive/%{version}-%{_short_release}.tar.gz Url: https://github.com/tbielawa/bitmath BuildArch: noarch BuildRequires: python2-devel %description bitmath simplifies many facets of interacting with file sizes in various units. Examples include: converting between SI and NIST prefix units (GiB to kB), converting between units of the same type (SI to SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB from 50GiB), and rich comparison operations (1024 Bytes == 1KiB). 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. %check %{__python2} -m unittest discover %prep %setup -n bitmath-%{version}-%{_short_release} -q %build %{__python2} setup.py build %install %{__python2} setup.py install -O1 --root=$RPM_BUILD_ROOT --record=python-bitmath-files.txt %files -f python-bitmath-files.txt %dir %{python2_sitelib}/%{_short_name} %doc README.md LICENSE %changelog * Mon Mar 17 2014 Tim Bielawa - 1.0.3-1 - Big issue converting NIST to SI - Also, retroactively remove unexpanded macros from changelog * Thu Mar 13 2014 Tim Bielawa - 1.0.2-3 - Bump release for new archive format * Thu Mar 13 2014 Tim Bielawa - 1.0.2-2 - Bump spec for proper Source0 versioning * Thu Mar 13 2014 Tim Bielawa - 1.0.2-1 - First real solid release with full functionality and documentation * Tue Mar 11 2014 Tim Bielawa - 1.0.0-1 - First release