Blame SPECS/libbytesize.spec

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