]>
Commit | Line | Data |
---|---|---|
f47aec23 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
a0b490d4 | 6 | Summary: A library for working with sizes in bytes |
f47aec23 | 7 | Summary(pl.UTF-8): Biblioteka do pracy z rozmiarami w bajtach |
a0b490d4 | 8 | Name: libbytesize |
0feacbd9 | 9 | Version: 2.3 |
9f63bfa3 | 10 | Release: 1 |
a0b490d4 MB |
11 | License: LGPL v2+ |
12 | Group: Libraries | |
f47aec23 | 13 | #Source0Download: https://github.com/storaged-project/libbytesize/releases |
a0b490d4 | 14 | Source0: https://github.com/storaged-project/libbytesize/releases/download/%{version}/%{name}-%{version}.tar.gz |
0feacbd9 | 15 | # Source0-md5: c161c1d3891a4ed27e6efd180b139c65 |
55d28a71 | 16 | Patch0: %{name}-python2.patch |
a0b490d4 | 17 | URL: https://github.com/storaged-project/libbytesize |
f47aec23 | 18 | BuildRequires: autoconf >= 2.50 |
a0b490d4 | 19 | BuildRequires: automake |
f47aec23 | 20 | BuildRequires: gettext-tools |
a0b490d4 MB |
21 | BuildRequires: gmp-devel |
22 | BuildRequires: gtk-doc | |
f47aec23 | 23 | BuildRequires: libtool >= 2:2 |
a0b490d4 | 24 | BuildRequires: mpfr-devel |
55d28a71 | 25 | BuildRequires: pcre2-8-devel |
a0b490d4 | 26 | BuildRequires: pkgconfig |
f47aec23 JB |
27 | %{?with_python2:BuildRequires: python-devel >= 2} |
28 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
a0b490d4 MB |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
30 | ||
31 | %description | |
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 | |
36 | than MAXUINT64. | |
37 | ||
f47aec23 JB |
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. | |
43 | ||
a0b490d4 MB |
44 | %package devel |
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} | |
c30b93b8 JB |
49 | Requires: gmp-devel |
50 | Requires: mpfr-devel | |
a0b490d4 MB |
51 | |
52 | %description devel | |
53 | Header files for libbytesize library. | |
54 | ||
55 | %description devel -l pl.UTF-8 | |
56 | Pliki nagłówkowe biblioteki libbytesize. | |
57 | ||
58 | %package apidocs | |
59 | Summary: libbytesize library API documentation | |
60 | Summary(pl.UTF-8): Dokumentacja API biblioteki libbytesize | |
61 | Group: Documentation | |
62 | Requires: gtk-doc-common | |
63 | ||
64 | %description apidocs | |
65 | API documentation for libbytesize library. | |
66 | ||
67 | %description apidocs -l pl.UTF-8 | |
68 | Dokumentacja API biblioteki libbytesize. | |
69 | ||
70 | %package -n python-bytesize | |
71 | Summary: Python 2 bindings for libbytesize | |
f47aec23 | 72 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libbytesize. |
a0b490d4 MB |
73 | Group: Libraries/Python |
74 | Requires: %{name} = %{version}-%{release} | |
75 | Requires: python-six | |
76 | ||
77 | %description -n python-bytesize | |
78 | This package contains Python 2 bindings for libbytesize. | |
79 | ||
f47aec23 JB |
80 | %description -n python-bytesize -l pl.UTF-8 |
81 | Ten pakiet zawiera wiązania Pythona 2 do libbytesize. | |
82 | ||
a0b490d4 MB |
83 | %package -n python3-bytesize |
84 | Summary: Python 3 bindings for libbytesize | |
f47aec23 | 85 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libbytesize. |
a0b490d4 MB |
86 | Group: Libraries/Python |
87 | Requires: %{name} = %{version}-%{release} | |
88 | Requires: python3-six | |
89 | ||
90 | %description -n python3-bytesize | |
91 | This package contains Python 3 bindings for libbytesize. | |
92 | ||
f47aec23 JB |
93 | %description -n python3-bytesize -l pl.UTF-8 |
94 | Ten pakiet zawiera wiązania Pythona 3 do libbytesize. | |
95 | ||
a0b490d4 MB |
96 | %prep |
97 | %setup -q | |
55d28a71 | 98 | %patch0 -p1 |
a0b490d4 MB |
99 | |
100 | %build | |
101 | %{__libtoolize} | |
102 | %{__aclocal} -I m4 | |
103 | %{__autoconf} | |
104 | %{__automake} | |
f47aec23 JB |
105 | %configure \ |
106 | %{!?with_python2:--without-python2} \ | |
107 | %{!?with_python3:--without-python3} | |
a0b490d4 MB |
108 | %{__make} |
109 | ||
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | install -d $RPM_BUILD_ROOT%{_gtkdocdir} | |
113 | ||
114 | %{__make} install \ | |
115 | DESTDIR=$RPM_BUILD_ROOT | |
116 | ||
55d28a71 | 117 | %if %{with python2} |
a0b490d4 MB |
118 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
119 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
120 | %py_postclean | |
55d28a71 | 121 | %endif |
a0b490d4 | 122 | |
55d28a71 | 123 | %if %{with python3} |
a0b490d4 MB |
124 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} |
125 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
55d28a71 | 126 | %endif |
a0b490d4 MB |
127 | |
128 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la | |
129 | ||
f47aec23 | 130 | # no configure option to specify location |
a0b490d4 MB |
131 | %{__mv} $RPM_BUILD_ROOT{%{_datadir}/gtk-doc/html/libbytesize,%{_gtkdocdir}} |
132 | ||
133 | %find_lang %{name} | |
134 | ||
135 | %clean | |
136 | rm -rf $RPM_BUILD_ROOT | |
137 | ||
138 | %post -p /sbin/ldconfig | |
139 | %postun -p /sbin/ldconfig | |
140 | ||
141 | %files -f %{name}.lang | |
142 | %defattr(644,root,root,755) | |
143 | %doc README.md | |
144 | %attr(755,root,root) %{_libdir}/libbytesize.so.*.*.* | |
145 | %attr(755,root,root) %ghost %{_libdir}/libbytesize.so.1 | |
146 | ||
147 | %files devel | |
148 | %defattr(644,root,root,755) | |
149 | %attr(755,root,root) %{_libdir}/libbytesize.so | |
150 | %{_includedir}/bytesize | |
151 | %{_pkgconfigdir}/bytesize.pc | |
152 | ||
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %{_gtkdocdir}/libbytesize | |
156 | ||
f47aec23 | 157 | %if %{with python2} |
a0b490d4 MB |
158 | %files -n python-bytesize |
159 | %defattr(644,root,root,755) | |
160 | %dir %{py_sitedir}/bytesize | |
161 | %{py_sitedir}/bytesize/*.py[co] | |
f47aec23 | 162 | %endif |
a0b490d4 | 163 | |
f47aec23 | 164 | %if %{with python3} |
a0b490d4 MB |
165 | %files -n python3-bytesize |
166 | %defattr(644,root,root,755) | |
55d28a71 | 167 | %attr(755,root,root) %{_bindir}/bscalc |
a0b490d4 MB |
168 | %dir %{py3_sitedir}/bytesize |
169 | %{py3_sitedir}/bytesize/__pycache__ | |
170 | %{py3_sitedir}/bytesize/*.py | |
55d28a71 | 171 | %{_mandir}/man1/bscalc.1* |
f47aec23 | 172 | %endif |