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: aa9bd5a04546873714da2adbaaa9f283
16 URL: https://github.com/storaged-project/libbytesize
17 BuildRequires: autoconf >= 2.50
18 BuildRequires: automake
19 BuildRequires: gettext-tools
20 BuildRequires: gmp-devel
21 BuildRequires: gtk-doc
22 BuildRequires: libtool >= 2:2
23 BuildRequires: mpfr-devel
24 BuildRequires: pcre-devel >= 8.32
25 BuildRequires: pkgconfig
26 %{?with_python2:BuildRequires: python-devel >= 2}
27 %{?with_python3:BuildRequires: python3-devel >= 1:3.2}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 The libbytesize is a C library that facilitates work with sizes in
32 bytes. Be it parsing the input from users or producing a nice human
33 readable representation of a size in bytes this library takes
34 localization into account. It also provides support for sizes bigger
37 %description -l pl.UTF-8
38 libbytesize to biblioteka C ułatwiająca pracę z rozmiarami w bajtach -
39 np. analizy wejścia od użytkowników czy tworzenia ładnej, czytelnej
40 dla człowieka reprezentacji rozmiaru w bajtach z uwzględnieniem
41 lokalizacji. Zapewnia także obsługę rozmiarów większych niż MAXUINT64.
44 Summary: Header files for libbytesize library
45 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libbytesize
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
50 Header files for libbytesize library.
52 %description devel -l pl.UTF-8
53 Pliki nagłówkowe biblioteki libbytesize.
56 Summary: libbytesize library API documentation
57 Summary(pl.UTF-8): Dokumentacja API biblioteki libbytesize
59 Requires: gtk-doc-common
62 API documentation for libbytesize library.
64 %description apidocs -l pl.UTF-8
65 Dokumentacja API biblioteki libbytesize.
67 %package -n python-bytesize
68 Summary: Python 2 bindings for libbytesize
69 Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libbytesize.
70 Group: Libraries/Python
71 Requires: %{name} = %{version}-%{release}
74 %description -n python-bytesize
75 This package contains Python 2 bindings for libbytesize.
77 %description -n python-bytesize -l pl.UTF-8
78 Ten pakiet zawiera wiązania Pythona 2 do libbytesize.
80 %package -n python3-bytesize
81 Summary: Python 3 bindings for libbytesize
82 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libbytesize.
83 Group: Libraries/Python
84 Requires: %{name} = %{version}-%{release}
87 %description -n python3-bytesize
88 This package contains Python 3 bindings for libbytesize.
90 %description -n python3-bytesize -l pl.UTF-8
91 Ten pakiet zawiera wiązania Pythona 3 do libbytesize.
102 %{!?with_python2:--without-python2} \
103 %{!?with_python3:--without-python3}
107 rm -rf $RPM_BUILD_ROOT
108 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
111 DESTDIR=$RPM_BUILD_ROOT
113 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
114 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
117 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
118 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
120 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
122 # no configure option to specify location
123 %{__mv} $RPM_BUILD_ROOT{%{_datadir}/gtk-doc/html/libbytesize,%{_gtkdocdir}}
128 rm -rf $RPM_BUILD_ROOT
130 %post -p /sbin/ldconfig
131 %postun -p /sbin/ldconfig
133 %files -f %{name}.lang
134 %defattr(644,root,root,755)
136 %attr(755,root,root) %{_libdir}/libbytesize.so.*.*.*
137 %attr(755,root,root) %ghost %{_libdir}/libbytesize.so.1
140 %defattr(644,root,root,755)
141 %attr(755,root,root) %{_libdir}/libbytesize.so
142 %{_includedir}/bytesize
143 %{_pkgconfigdir}/bytesize.pc
146 %defattr(644,root,root,755)
147 %{_gtkdocdir}/libbytesize
150 %files -n python-bytesize
151 %defattr(644,root,root,755)
152 %dir %{py_sitedir}/bytesize
153 %{py_sitedir}/bytesize/*.py[co]
157 %files -n python3-bytesize
158 %defattr(644,root,root,755)
159 %dir %{py3_sitedir}/bytesize
160 %{py3_sitedir}/bytesize/__pycache__
161 %{py3_sitedir}/bytesize/*.py