libbytesize-vl.spec 14 KB

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