libbytesize-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. %define realname bytesize
  2. %define with_python2 0
  3. %define with_python3 1
  4. %define with_gtk_doc 1
  5. %if %{with_python3} == 0
  6. %define python3_opts --without-python3
  7. %endif
  8. %if %{with_python2} == 0
  9. %define python2_opts --without-python2
  10. %endif
  11. %define configure_opts %{?python3_opts} %{?python2_opts}
  12. Name: libbytesize
  13. Version: 2.2
  14. Release: 1%{?_dist_release}
  15. Summary: A library for working with sizes in bytes
  16. License: LGPLv2+
  17. URL: https://github.com/storaged-project/libbytesize
  18. Vendor: Project Vine
  19. Distribution: Vine Linux
  20. Source0: https://github.com/storaged-project/libbytesize/releases/download/%{version}/%{name}-%{version}.tar.gz
  21. BuildRequires: gcc
  22. BuildRequires: gmp-devel
  23. BuildRequires: mpfr-devel
  24. BuildRequires: pcre2-devel
  25. BuildRequires: gettext-devel
  26. %if %{with_python2}
  27. BuildRequires: python-devel
  28. BuildRequires: python-rpm-macros
  29. %endif
  30. %if %{with_python3}
  31. BuildRequires: python3-devel
  32. BuildRequires: python3-rpm-macros
  33. %endif
  34. %if %{with_gtk_doc}
  35. BuildRequires: gtk-doc
  36. %endif
  37. %description
  38. The libbytesize is a C library that facilitates work with sizes in
  39. bytes. Be it parsing the input from users or producing a nice human readable
  40. representation of a size in bytes this library takes localization into
  41. account. It also provides support for sizes bigger than MAXUINT64.
  42. %package devel
  43. Summary: Development files for libbytesize
  44. Requires: %{name}%{?_isa} = %{version}-%{release}
  45. %description devel
  46. This package contains header files and pkg-config files needed for development
  47. with the libbytesize library.
  48. %if %{with_python2}
  49. %package -n python-%{realname}
  50. Summary: Python 2 bindings for libbytesize
  51. %{?python_provide:%python_provide python2-%{realname}}
  52. %{?python_provide:%python_provide python2-libbytesize}
  53. Requires: %{name}%{?_isa} = %{version}-%{release}
  54. Requires: python-six
  55. %description -n python-%{realname}
  56. This package contains Python 2 bindings for libbytesize making the use of
  57. the library from Python 2 easier and more convenient.
  58. %endif
  59. %if %{with_python3}
  60. %package -n python3-%{realname}
  61. Summary: Python 3 bindings for libbytesize
  62. Requires: %{name}%{?_isa} = %{version}-%{release}
  63. Requires: python3-six
  64. %description -n python3-%{realname}
  65. This package contains Python 3 bindings for libbytesize making the use of
  66. the library from Python 3 easier and more convenient.
  67. %endif
  68. %prep
  69. %setup -q -n %{name}-%{version}
  70. %build
  71. %configure %{?configure_opts}
  72. %{__make} %{?_smp_mflags}
  73. %install
  74. %{make_install}
  75. find %{buildroot} -type f -name "*.la" | xargs %{__rm}
  76. %find_lang %{name}
  77. %post
  78. /sbin/ldconfig
  79. %postun
  80. /sbin/ldconfig
  81. %files -f %{name}.lang
  82. %doc README.md
  83. %{!?_licensedir:%global license %%doc}
  84. %license LICENSE
  85. %{_bindir}/*
  86. %{_libdir}/libbytesize.so.*
  87. %{_mandir}/man1/*
  88. %files devel
  89. %{_libdir}/libbytesize.so
  90. %dir %{_includedir}/bytesize
  91. %{_includedir}/bytesize/bs_size.h
  92. %{_libdir}/pkgconfig/bytesize.pc
  93. %if %{with_gtk_doc}
  94. %{_datadir}/gtk-doc/html/libbytesize
  95. %endif
  96. %if %{with_python2}
  97. %files -n python-%{realname}
  98. %dir %{python_sitearch}/bytesize
  99. %{python_sitearch}/bytesize/*
  100. %endif
  101. %if %{with_python3}
  102. %files -n python3-%{realname}
  103. %dir %{python3_sitearch}/bytesize
  104. %{python3_sitearch}/bytesize/*
  105. #%{python3_sitearch}/bytesize/__pycache__/*
  106. %endif
  107. %changelog
  108. * Wed Mar 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.2-1
  109. - new upstream release.
  110. * Mon Dec 17 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.4-2
  111. - initial build for Vine Linux.
  112. * Thu Aug 02 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.4-1
  113. - Squashed 'translation-canary/' changes from 840c2d6..fccbb1b (vtrefny)
  114. - Make sure the test script fails if one of the test runs fail (vtrefny)
  115. - Do not try to run python2 tests without python2 support (vtrefny)
  116. - Fix licence header for "gettext.h" (vtrefny)
  117. - Do not use rpm to check for Zanata client (vtrefny)
  118. - Use new ldconfig_scriptlets macro in spec (vtrefny)
  119. * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-5
  120. - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
  121. * Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3-4
  122. - Rebuilt for Python 3.7
  123. * Fri Jun 29 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.3-3
  124. - Use new ldconfig_scriptlets macro in spec
  125. * Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3-2
  126. - Rebuilt for Python 3.7
  127. * Thu Apr 19 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.3-1
  128. - Allow building libbytesize without Python 2 support (vtrefny)
  129. - Sync spec with downstream (vtrefny)
  130. - Add gcc to BuildRequires (vtrefny)
  131. - Fix links for documentation and GH project (vtrefny)
  132. - Add a HACKING.rst file (vpodzime)
  133. - Do not segfault when trying to bs_size_free NULL (vtrefny)
  134. * Wed Feb 21 2018 Vojtech Trefny <vtrefny@redhat.com> - 1.2-4
  135. - Add gcc to BuildRequires (vtrefny)
  136. * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-3
  137. - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
  138. * Fri Jan 05 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.2-2
  139. - Update Python 2 dependency declarations to new packaging standards
  140. (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
  141. * Fri Sep 29 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.2-1
  142. - Use only version as a tag of the last release (vpodzime)
  143. - Do not require the glib-2.0 pkgconfig package (vpodzime)
  144. - Do not lie about tag creation (vpodzime)
  145. * Thu Sep 28 2017 Troy Dawson <tdawson@redhat.com> - 1.1-2
  146. - Cleanup spec file conditionals
  147. * Thu Sep 21 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.1-1
  148. - Add NEWS.rst file (vtrefny)
  149. - Fix source and url in spec file (vtrefny)
  150. - Use only one git tag for new releases (vtrefny)
  151. - Actually translate the units when expected (vpodzime)
  152. - Add two temporary test files to .gitignore (vpodzime)
  153. * Thu Sep 14 2017 Vratislav Podzimek <vpodzime@redhat.com> - 1.0-1
  154. - Make more space for CI status image (vtrefny)
  155. - Include limits.h to make sure ULONG_MAX is defined (vpodzime)
  156. - Remove extra 'is' in two docstrings (vpodzime)
  157. - Properly support 64bit operands (vpodzime)
  158. * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.11-4
  159. - Python 2 binary package renamed to python2-libbytesize
  160. See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
  161. * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-3
  162. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
  163. * Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-2
  164. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
  165. * Wed Jun 14 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.11-1
  166. - Fix README file name (vtrefny)
  167. - Add a build status image to the README.md (vpodzime)
  168. - Remove "glibc-all-langpacks" from test dependencies (vtrefny)
  169. - Check for requires in generated spec file, not in the template (vtrefny)
  170. - Fix checking for available locales (vtrefny)
  171. - Fix library name in acinclude.m4 (vtrefny)
  172. - Do not try to run translation tests on CentOS/RHEL 7 (vtrefny)
  173. - Skip tests if they require unavailable locales (vpodzime)
  174. * Wed Apr 19 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.10-1
  175. - Fix installation without specifying --exec-prefix (martin)
  176. - Sync the spec file with downstream (vpodzime)
  177. * Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-2
  178. - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
  179. * Wed Jan 11 2017 Vratislav Podzimek <vpodzime@redhat.com> - 0.9-1
  180. - Allow the Size python class to be easily imported (vpodzime)
  181. - Make sure pyexecdir is defined (vpodzime)
  182. - Do not run Python 3 tests without python3 (vpodzime)
  183. - Disable python3 on RHEL (vpodzime)
  184. - Reflect the configuration in the spec file template (vpodzime)
  185. - Make documentation generation conditional (vpodzime)
  186. - Make python3 support conditional (vpodzime)
  187. - Require lower version of libpcre (vpodzime)
  188. - Sync the spec file with downstream (vpodzime)
  189. * Wed Dec 21 2016 Adam Williamson <awilliam@redhat.com> - 0.8-2
  190. - Rebuild for Python 3.6, again
  191. * Fri Dec 16 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.8-1
  192. - Add a docstring to python bindings (vpodzime)
  193. - Neutralize None as an operand for math operations (vpodzime)
  194. - Add targets for checking and installing test requirements (vpodzime)
  195. - Fix 'make local' (vtrefny)
  196. - Make the python packages own their package directories (vpodzime)
  197. - Don't compare translated and untranslated representations (vpodzime)
  198. - replace_char_with_str: Fix the character count. (dshea)
  199. - Ditch autopoint. (dshea)
  200. * Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.7-4
  201. - Rebuild for Python 3.6
  202. * Tue Sep 20 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.7-3
  203. - Prevent ignored exceptions in __del__ from happening (vpodzime)
  204. * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-2
  205. - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
  206. * Tue May 17 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.7-1
  207. - Re-run autogen.sh and configure before updating the .pot file (vpodzime)
  208. - Change where tests on translated strings are run. (dshea)
  209. - Squashed 'translation-canary/' changes from d6c0708..840c2d6 (dshea)
  210. - Make sure we get the tests result report in 'make ci' (vpodzime)
  211. - Add a new generic error code/enum for failures (vpodzime)
  212. - Do not ignore the return value from asprintf() (vpodzime)
  213. - Beware of the radix char when converting to Decimal (#1325705) (vpodzime)
  214. * Fri May 6 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.6-2
  215. - Beware of unsigned long int on 32bit arches (#1333149) (vpodzime)
  216. * Tue May 03 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.6-1
  217. - Add support for the ROUND_HALF_UP rounding mode (vpodzime)
  218. - Make sure we return the right radix char in human_readable() (vpodzime)
  219. - Allocate enough memory for char->str replacements (vpodzime)
  220. * Tue Apr 26 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.5-1
  221. - Create both libbytesize-$version and $version tags (vpodzime)
  222. - Update the .pot file with the new version (vpodzime)
  223. - Improve how we create changelog (vpodzime)
  224. - Try harder when getting OverflowError in division (#1326897) (vpodzime)
  225. - Neutralize the radix char before passing string to MPFR (#1326108) (vpodzime)
  226. - Run tests with en_US and fr_FR locales (vpodzime)
  227. - Run the tests with both python2 and python3 again (vpodzime)
  228. - Do not run the same tests 3 times as part of the 'ci' target (vpodzime)
  229. - Don't fail if just the best-effort cleanup fails (vpodzime)
  230. - Throw away the new .pot file when just running tests (vpodzime)
  231. - Make sure we return one of -1, 0, 1 from cmp functions (#1326113) (vpodzime)
  232. - Use cmp_bytes(size, bytes) when comparing to 0 (vpodzime)
  233. - Ignore all .po~ files (vpodzime)
  234. - Add translator comments (dshea)
  235. - Integrate translation-canary into the build. (dshea)
  236. - Run the translation-canary tests from make check. (dshea)
  237. - Squashed 'translation-canary/' content from commit d6c0708 (dshea)
  238. - Make 'make check' work. (dshea)
  239. - Remove files from po/ we don't need to track (vpodzime)
  240. - Ignore the compiled translation files (vpodzime)
  241. - Distribute and package the translations (vpodzime)
  242. - Add the necessary pieces for getting translations (vpodzime)
  243. * Thu Apr 14 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-3
  244. - Only require -lgmp and -lmpfr for static linking (vpodzime)
  245. * Fri Mar 11 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-2
  246. - Do not try to delete the C struct twice (vpodzime)
  247. * Wed Mar 09 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.4-1
  248. - Add the __init__.py file to provide a proper package (vpodzime)
  249. - Merge pull request #7 from vpodzime/master-decimal_locale (vpodzime)
  250. - Make sure we pass a locale-agnostic string to Decimal() (vpodzime)
  251. - Adapt the package description to no longer using GI (vpodzime)
  252. - Make Size instances hashable (vpodzime)
  253. - Sync the spec file with downstream (vpodzime)
  254. * Wed Mar 9 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-3
  255. - Make sure we pass a locale-agnostic string to Decimal() (vpodzime)
  256. * Mon Mar 7 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-2
  257. - Make Size instances hashable (vpodzime)
  258. * Fri Feb 26 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.3-1
  259. - Packaging changes related to getting rid of GLib/GObject (vpodzime)
  260. - Adapt the python bindings and tests (vpodzime)
  261. - Get rid of GObject and GLib (vpodzime)
  262. - Define the __divmod__ method even for not dividing by Size (vpodzime)
  263. * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-3
  264. - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
  265. * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
  266. - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
  267. * Fri Oct 23 2015 Vratislav Podzimek <vpodzime@redhat.com> - 0.2-1
  268. - Distribute the tests for overrides (vpodzime)
  269. - Fix the rpmlog target (vpodzime)
  270. - Respect the signs when doing division (vpodzime)
  271. - Add two more internal methods that may be required (vpodzime)
  272. - Do not pass negative numbers as guint64 when comparing with negative ints (vpodzime)
  273. - Round toward zero when converting bytes from float to int (vpodzime)
  274. - Make sure we return Size if doing operations with big integers (vpodzime)
  275. - Implement the __divmod__() method (vpodzime)
  276. - Do not try to convert negative int to an unsigned int when multiplying (vpodzime)
  277. - Fix and test the __deepcopy__ method (vpodzime)
  278. - Implement the evaluation of Size instance as a bool value (vpodzime)
  279. - Fix some issues in comparison functions and add tests (vpodzime)
  280. - Add a function for getting string representation of a unit (vpodzime)
  281. - Hook the overrides tests to the 'test' target (vpodzime)
  282. - Merge pull request #4 from japokorn/master-tests_03_python_override (vpodzime)
  283. - Added tests for Python override (japokorn)
  284. - Make sure our tests don't get broken by installed overrides (vpodzime)
  285. * Wed Oct 07 2015 Vratislav Podzimek <vpodzime@redhat.com> - 0.1-1
  286. - Initial release