3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 Summary: A library for working with sizes in bytes
7 Summary(pl.UTF-8): Biblioteka do pracy z rozmiarami w bajtach
13 #Source0Download: https://github.com/storaged-project/libbytesize/releases
14 Source0: https://github.com/storaged-project/libbytesize/releases/download/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: ab94377166b97d662a2434cf79380fd0
16 Patch0: %{name}-python2.patch
17 URL: https://github.com/storaged-project/libbytesize
18 BuildRequires: autoconf >= 2.50
19 BuildRequires: automake
20 BuildRequires: gettext-tools
21 BuildRequires: gmp-devel
22 BuildRequires: gtk-doc
23 BuildRequires: libtool >= 2:2
24 BuildRequires: mpfr-devel
25 BuildRequires: pcre2-8-devel
26 BuildRequires: pkgconfig
27 %{?with_python2:BuildRequires: python-devel >= 2}
28 %{?with_python3:BuildRequires: python3-devel >= 1:3.2}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 The libbytesize is a C library that facilitates work with sizes in
33 bytes. Be it parsing the input from users or producing a nice human
34 readable representation of a size in bytes this library takes
35 localization into account. It also provides support for sizes bigger
38 %description -l pl.UTF-8
39 libbytesize to biblioteka C ułatwiająca pracę z rozmiarami w bajtach -
40 np. analizy wejścia od użytkowników czy tworzenia ładnej, czytelnej
41 dla człowieka reprezentacji rozmiaru w bajtach z uwzględnieniem
42 lokalizacji. Zapewnia także obsługę rozmiarów większych niż MAXUINT64.
45 Summary: Header files for libbytesize library
46 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libbytesize
47 Group: Development/Libraries
48 Requires: %{name} = %{version}-%{release}
53 Header files for libbytesize library.
55 %description devel -l pl.UTF-8
56 Pliki nagłówkowe biblioteki libbytesize.
59 Summary: libbytesize library API documentation
60 Summary(pl.UTF-8): Dokumentacja API biblioteki libbytesize
62 Requires: gtk-doc-common
65 API documentation for libbytesize library.
67 %description apidocs -l pl.UTF-8
68 Dokumentacja API biblioteki libbytesize.
70 %package -n python-bytesize
71 Summary: Python 2 bindings for libbytesize
72 Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libbytesize.
73 Group: Libraries/Python
74 Requires: %{name} = %{version}-%{release}
77 %description -n python-bytesize
78 This package contains Python 2 bindings for libbytesize.
80 %description -n python-bytesize -l pl.UTF-8
81 Ten pakiet zawiera wiązania Pythona 2 do libbytesize.
83 %package -n python3-bytesize
84 Summary: Python 3 bindings for libbytesize
85 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libbytesize.
86 Group: Libraries/Python
87 Requires: %{name} = %{version}-%{release}
90 %description -n python3-bytesize
91 This package contains Python 3 bindings for libbytesize.
93 %description -n python3-bytesize -l pl.UTF-8
94 Ten pakiet zawiera wiązania Pythona 3 do libbytesize.
106 %{!?with_python2:--without-python2} \
107 %{!?with_python3:--without-python3}
111 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
115 DESTDIR=$RPM_BUILD_ROOT
118 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
119 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
124 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
125 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
128 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
130 # no configure option to specify location
131 %{__mv} $RPM_BUILD_ROOT{%{_datadir}/gtk-doc/html/libbytesize,%{_gtkdocdir}}
136 rm -rf $RPM_BUILD_ROOT
138 %post -p /sbin/ldconfig
139 %postun -p /sbin/ldconfig
141 %files -f %{name}.lang
142 %defattr(644,root,root,755)
144 %attr(755,root,root) %{_libdir}/libbytesize.so.*.*.*
145 %attr(755,root,root) %ghost %{_libdir}/libbytesize.so.1
148 %defattr(644,root,root,755)
149 %attr(755,root,root) %{_libdir}/libbytesize.so
150 %{_includedir}/bytesize
151 %{_pkgconfigdir}/bytesize.pc
154 %defattr(644,root,root,755)
155 %{_gtkdocdir}/libbytesize
158 %files -n python-bytesize
159 %defattr(644,root,root,755)
160 %dir %{py_sitedir}/bytesize
161 %{py_sitedir}/bytesize/*.py[co]
165 %files -n python3-bytesize
166 %defattr(644,root,root,755)
167 %attr(755,root,root) %{_bindir}/bscalc
168 %dir %{py3_sitedir}/bytesize
169 %{py3_sitedir}/bytesize/__pycache__
170 %{py3_sitedir}/bytesize/*.py
171 %{_mandir}/man1/bscalc.1*