483152
%define realname bytesize
483152
%define with_python3 1
483152
%define with_gtk_doc 1
483152
483152
%if (! 0%{?fedora} && 0%{?rhel} <= 7) || %{with_python3} == 0
483152
%define with_python3 0
483152
%define python3_opts --without-python3
483152
%endif
483152
2704ea
%define configure_opts %{?python3_opts}
483152
483152
Name:        libbytesize
483152
Version:     1.4
2704ea
Release:     3%{?dist}
483152
Summary:     A library for working with sizes in bytes
483152
License:     LGPLv2+
483152
URL:         https://github.com/storaged-project/libbytesize
483152
Source0:     https://github.com/storaged-project/libbytesize/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
2704ea
Patch0:      libbytesize-tests.patch
2704ea
Patch1:      libbytesize-potfile.patch
483152
483152
BuildRequires: gcc
2704ea
BuildRequires: autoconf
2704ea
BuildRequires: automake
2704ea
BuildRequires: libtool
483152
BuildRequires: gmp-devel
483152
BuildRequires: mpfr-devel
483152
BuildRequires: pcre-devel
483152
BuildRequires: gettext-devel
483152
%if %{with_python3}
483152
BuildRequires: python3-devel
483152
%endif
483152
%if %{with_gtk_doc}
483152
BuildRequires: gtk-doc
483152
%endif
483152
483152
%description
483152
The libbytesize is a C library that facilitates work with sizes in
483152
bytes. Be it parsing the input from users or producing a nice human readable
483152
representation of a size in bytes this library takes localization into
483152
account. It also provides support for sizes bigger than MAXUINT64.
483152
483152
%package devel
483152
Summary:  Development files for libbytesize
483152
Requires: %{name}%{?_isa} = %{version}-%{release}
483152
483152
%description devel
483152
This package contains header files and pkg-config files needed for development
483152
with the libbytesize library.
483152
483152
%if %{with_python3}
483152
%package -n python3-%{realname}
483152
Summary: Python 3 bindings for libbytesize
483152
Requires: %{name}%{?_isa} = %{version}-%{release}
483152
Requires: python3-six
483152
483152
%description -n python3-%{realname}
483152
This package contains Python 3 bindings for libbytesize making the use of
483152
the library from Python 3 easier and more convenient.
483152
%endif
483152
483152
%prep
483152
%setup -q -n %{name}-%{version}
2704ea
%patch0 -p1
2704ea
%patch1 -p1
483152
483152
%build
2704ea
autoreconf -ivf
483152
%configure %{?configure_opts}
483152
%{__make} %{?_smp_mflags}
483152
483152
%install
483152
%{make_install}
483152
find %{buildroot} -type f -name "*.la" | xargs %{__rm}
483152
%find_lang %{name}
483152
483152
483152
%ldconfig_scriptlets
483152
483152
483152
%files -f %{name}.lang
483152
%doc README.md
483152
%{!?_licensedir:%global license %%doc}
483152
%license LICENSE
483152
%{_libdir}/libbytesize.so.*
483152
483152
%files devel
483152
%{_libdir}/libbytesize.so
483152
%dir %{_includedir}/bytesize
483152
%{_includedir}/bytesize/bs_size.h
483152
%{_libdir}/pkgconfig/bytesize.pc
483152
%if %{with_gtk_doc}
483152
%{_datadir}/gtk-doc/html/libbytesize
483152
%endif
483152
483152
%if %{with_python3}
483152
%files -n python3-%{realname}
483152
%dir %{python3_sitearch}/bytesize
483152
%{python3_sitearch}/bytesize/*
483152
%{python3_sitearch}/bytesize/__pycache__/*
483152
%endif
483152
483152
%changelog
2704ea
* Wed Oct 30 2019 Vojtech Trefny <vtrefny@redhat.com> - 1.4-3
2704ea
- Add POT file to git and do not rebuild it during every build
2704ea
2704ea
* Wed Mar 20 2019 Vojtech Trefny <vtrefny@redhat.com> - 1.4-2
2704ea
- Run upstream tests suite in gating
2704ea
483152
* Thu Aug 02 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.4-1
483152
- Squashed 'translation-canary/' changes from 840c2d6..fccbb1b (vtrefny)
483152
- Make sure the test script fails if one of the test runs fail (vtrefny)
483152
- Do not try to run python2 tests without python2 support (vtrefny)
483152
- Fix licence header for "gettext.h" (vtrefny)
483152
- Do not use rpm to check for Zanata client (vtrefny)
483152
- Use new ldconfig_scriptlets macro in spec (vtrefny)
483152
483152
* Thu Apr 19 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.3-1
483152
- Allow building libbytesize without Python 2 support (vtrefny)
483152
- Sync spec with downstream (vtrefny)
483152
- Add gcc to BuildRequires (vtrefny)
483152
- Fix links for documentation and GH project (vtrefny)
483152
- Add a HACKING.rst file (vpodzime)
483152
- Do not segfault when trying to bs_size_free NULL (vtrefny)
483152
483152
* Wed Feb 21 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.2-4
483152
- Add gcc to BuildRequires (vtrefny)
483152
483152
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-3
483152
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
483152
483152
* Fri Jan 05 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.2-2
483152
- Update Python 2 dependency declarations to new packaging standards
483152
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
483152
483152
* Fri Sep 29 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.2-1
483152
- Use only version as a tag of the last release (vpodzime)
483152
- Do not require the glib-2.0 pkgconfig package (vpodzime)
483152
- Do not lie about tag creation (vpodzime)
483152
483152
* Thu Sep 28 2017 Troy Dawson <tdawson@redhat.com> - 1.1-2
483152
- Cleanup spec file conditionals
483152
483152
* Thu Sep 21 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.1-1
483152
- Add NEWS.rst file (vtrefny)
483152
- Fix source and url in spec file (vtrefny)
483152
- Use only one git tag for new releases (vtrefny)
483152
- Actually translate the units when expected (vpodzime)
483152
- Add two temporary test files to .gitignore (vpodzime)
483152
483152
* Thu Sep 14 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.0-1
483152
- Make more space for CI status image (vtrefny)
483152
- Include limits.h to make sure ULONG_MAX is defined (vpodzime)
483152
- Remove extra 'is' in two docstrings (vpodzime)
483152
- Properly support 64bit operands (vpodzime)
483152
483152
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.11-4
483152
- Python 2 binary package renamed to python2-libbytesize
483152
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
483152
483152
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-3
483152
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
483152
483152
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-2
483152
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
483152
483152
* Wed Jun 14 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.11-1
483152
- Fix README file name (vtrefny)
483152
- Add a build status image to the README.md (vpodzime)
483152
- Remove "glibc-all-langpacks" from test dependencies (vtrefny)
483152
- Check for requires in generated spec file, not in the template (vtrefny)
483152
- Fix checking for available locales (vtrefny)
483152
- Fix library name in acinclude.m4 (vtrefny)
483152
- Do not try to run translation tests on CentOS/RHEL 7 (vtrefny)
483152
- Skip tests if they require unavailable locales (vpodzime)
483152
483152
* Wed Apr 19 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.10-1
483152
- Fix installation without specifying --exec-prefix (martin)
483152
- Sync the spec file with downstream (vpodzime)
483152
483152
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-2
483152
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
483152
483152
* Wed Jan 11 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.9-1
483152
- Allow the Size python class to be easily imported (vpodzime)
483152
- Make sure pyexecdir is defined (vpodzime)
483152
- Do not run Python 3 tests without python3 (vpodzime)
483152
- Disable python3 on RHEL (vpodzime)
483152
- Reflect the configuration in the spec file template (vpodzime)
483152
- Make documentation generation conditional (vpodzime)
483152
- Make python3 support conditional (vpodzime)
483152
- Require lower version of libpcre (vpodzime)
483152
- Sync the spec file with downstream (vpodzime)
483152
483152
* Wed Dec 21 2016 Adam Williamson <awilliam@redhat.com> - 0.8-2
483152
- Rebuild for Python 3.6, again
483152
483152
* Fri Dec 16 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.8-1
483152
- Add a docstring to python bindings (vpodzime)
483152
- Neutralize None as an operand for math operations (vpodzime)
483152
- Add targets for checking and installing test requirements (vpodzime)
483152
- Fix 'make local' (vtrefny)
483152
- Make the python packages own their package directories (vpodzime)
483152
- Don't compare translated and untranslated representations (vpodzime)
483152
- replace_char_with_str: Fix the character count. (dshea)
483152
- Ditch autopoint. (dshea)
483152
483152
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.7-4
483152
- Rebuild for Python 3.6
483152
483152
* Tue Sep 20 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.7-3
483152
- Prevent ignored exceptions in __del__ from happening (vpodzime)
483152
483152
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-2
483152
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
483152
483152
* Tue May 17 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.7-1
483152
- Re-run autogen.sh and configure before updating the .pot file (vpodzime)
483152
- Change where tests on translated strings are run. (dshea)
483152
- Squashed 'translation-canary/' changes from d6c0708..840c2d6 (dshea)
483152
- Make sure we get the tests result report in 'make ci' (vpodzime)
483152
- Add a new generic error code/enum for failures (vpodzime)
483152
- Do not ignore the return value from asprintf() (vpodzime)
483152
- Beware of the radix char when converting to Decimal (#1325705) (vpodzime)
483152
483152
* Fri May  6 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.6-2
483152
- Beware of unsigned long int on 32bit arches (#1333149) (vpodzime)
483152
483152
* Tue May 03 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.6-1
483152
- Add support for the ROUND_HALF_UP rounding mode (vpodzime)
483152
- Make sure we return the right radix char in human_readable() (vpodzime)
483152
- Allocate enough memory for char->str replacements (vpodzime)
483152
483152
* Tue Apr 26 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.5-1
483152
- Create both libbytesize-$version and $version tags (vpodzime)
483152
- Update the .pot file with the new version (vpodzime)
483152
- Improve how we create changelog (vpodzime)
483152
- Try harder when getting OverflowError in division (#1326897) (vpodzime)
483152
- Neutralize the radix char before passing string to MPFR (#1326108) (vpodzime)
483152
- Run tests with en_US and fr_FR locales (vpodzime)
483152
- Run the tests with both python2 and python3 again (vpodzime)
483152
- Do not run the same tests 3 times as part of the 'ci' target (vpodzime)
483152
- Don't fail if just the best-effort cleanup fails (vpodzime)
483152
- Throw away the new .pot file when just running tests (vpodzime)
483152
- Make sure we return one of -1, 0, 1 from cmp functions (#1326113) (vpodzime)
483152
- Use cmp_bytes(size, bytes) when comparing to 0 (vpodzime)
483152
- Ignore all .po~ files (vpodzime)
483152
- Add translator comments (dshea)
483152
- Integrate translation-canary into the build. (dshea)
483152
- Run the translation-canary tests from make check. (dshea)
483152
- Squashed 'translation-canary/' content from commit d6c0708 (dshea)
483152
- Make 'make check' work. (dshea)
483152
- Remove files from po/ we don't need to track (vpodzime)
483152
- Ignore the compiled translation files (vpodzime)
483152
- Distribute and package the translations (vpodzime)
483152
- Add the necessary pieces for getting translations (vpodzime)
483152
483152
* Thu Apr 14 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-3
483152
- Only require -lgmp and -lmpfr for static linking (vpodzime)
483152
483152
* Fri Mar 11 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-2
483152
- Do not try to delete the C struct twice (vpodzime)
483152
483152
* Wed Mar 09 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-1
483152
- Add the __init__.py file to provide a proper package (vpodzime)
483152
- Merge pull request #7 from vpodzime/master-decimal_locale (vpodzime)
483152
- Make sure we pass a locale-agnostic string to Decimal() (vpodzime)
483152
- Adapt the package description to no longer using GI (vpodzime)
483152
- Make Size instances hashable (vpodzime)
483152
- Sync the spec file with downstream (vpodzime)
483152
483152
* Wed Mar  9 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-3
483152
- Make sure we pass a locale-agnostic string to Decimal() (vpodzime)
483152
483152
* Mon Mar  7 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-2
483152
- Make Size instances hashable (vpodzime)
483152
483152
* Fri Feb 26 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-1
483152
- Packaging changes related to getting rid of GLib/GObject (vpodzime)
483152
- Adapt the python bindings and tests (vpodzime)
483152
- Get rid of GObject and GLib (vpodzime)
483152
- Define the __divmod__ method even for not dividing by Size (vpodzime)
483152
483152
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-3
483152
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
483152
483152
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
483152
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
483152
483152
* Fri Oct 23 2015 Vratislav Podzimek <vpodzime@redhat.com> - 0.2-1
483152
- Distribute the tests for overrides (vpodzime)
483152
- Fix the rpmlog target (vpodzime)
483152
- Respect the signs when doing division (vpodzime)
483152
- Add two more internal methods that may be required (vpodzime)
483152
- Do not pass negative numbers as guint64 when comparing with negative ints (vpodzime)
483152
- Round toward zero when converting bytes from float to int (vpodzime)
483152
- Make sure we return Size if doing operations with big integers (vpodzime)
483152
- Implement the __divmod__() method (vpodzime)
483152
- Do not try to convert negative int to an unsigned int when multiplying (vpodzime)
483152
- Fix and test the __deepcopy__ method (vpodzime)
483152
- Implement the evaluation of Size instance as a bool value (vpodzime)
483152
- Fix some issues in comparison functions and add tests (vpodzime)
483152
- Add a function for getting string representation of a unit (vpodzime)
483152
- Hook the overrides tests to the 'test' target (vpodzime)
483152
- Merge pull request #4 from japokorn/master-tests_03_python_override (vpodzime)
483152
- Added tests for Python override (japokorn)
483152
- Make sure our tests don't get broken by installed overrides (vpodzime)
483152
483152
* Wed Oct 07 2015 Vratislav Podzimek <vpodzime@redhat.com> - 0.1-1
483152
- Initial release