]>
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 |
713581f4 AG |
9 | Version: 1.4 |
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 |
713581f4 | 15 | # Source0-md5: aa9bd5a04546873714da2adbaaa9f283 |
a0b490d4 | 16 | URL: https://github.com/storaged-project/libbytesize |
f47aec23 | 17 | BuildRequires: autoconf >= 2.50 |
a0b490d4 | 18 | BuildRequires: automake |
f47aec23 | 19 | BuildRequires: gettext-tools |
a0b490d4 MB |
20 | BuildRequires: gmp-devel |
21 | BuildRequires: gtk-doc | |
f47aec23 | 22 | BuildRequires: libtool >= 2:2 |
a0b490d4 MB |
23 | BuildRequires: mpfr-devel |
24 | BuildRequires: pcre-devel >= 8.32 | |
25 | BuildRequires: pkgconfig | |
f47aec23 JB |
26 | %{?with_python2:BuildRequires: python-devel >= 2} |
27 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
a0b490d4 MB |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
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 | |
35 | than MAXUINT64. | |
36 | ||
f47aec23 JB |
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. | |
42 | ||
a0b490d4 MB |
43 | %package devel |
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} | |
48 | ||
49 | %description devel | |
50 | Header files for libbytesize library. | |
51 | ||
52 | %description devel -l pl.UTF-8 | |
53 | Pliki nagłówkowe biblioteki libbytesize. | |
54 | ||
55 | %package apidocs | |
56 | Summary: libbytesize library API documentation | |
57 | Summary(pl.UTF-8): Dokumentacja API biblioteki libbytesize | |
58 | Group: Documentation | |
59 | Requires: gtk-doc-common | |
60 | ||
61 | %description apidocs | |
62 | API documentation for libbytesize library. | |
63 | ||
64 | %description apidocs -l pl.UTF-8 | |
65 | Dokumentacja API biblioteki libbytesize. | |
66 | ||
67 | %package -n python-bytesize | |
68 | Summary: Python 2 bindings for libbytesize | |
f47aec23 | 69 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libbytesize. |
a0b490d4 MB |
70 | Group: Libraries/Python |
71 | Requires: %{name} = %{version}-%{release} | |
72 | Requires: python-six | |
73 | ||
74 | %description -n python-bytesize | |
75 | This package contains Python 2 bindings for libbytesize. | |
76 | ||
f47aec23 JB |
77 | %description -n python-bytesize -l pl.UTF-8 |
78 | Ten pakiet zawiera wiązania Pythona 2 do libbytesize. | |
79 | ||
a0b490d4 MB |
80 | %package -n python3-bytesize |
81 | Summary: Python 3 bindings for libbytesize | |
f47aec23 | 82 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libbytesize. |
a0b490d4 MB |
83 | Group: Libraries/Python |
84 | Requires: %{name} = %{version}-%{release} | |
85 | Requires: python3-six | |
86 | ||
87 | %description -n python3-bytesize | |
88 | This package contains Python 3 bindings for libbytesize. | |
89 | ||
f47aec23 JB |
90 | %description -n python3-bytesize -l pl.UTF-8 |
91 | Ten pakiet zawiera wiązania Pythona 3 do libbytesize. | |
92 | ||
a0b490d4 MB |
93 | %prep |
94 | %setup -q | |
95 | ||
96 | %build | |
97 | %{__libtoolize} | |
98 | %{__aclocal} -I m4 | |
99 | %{__autoconf} | |
100 | %{__automake} | |
f47aec23 JB |
101 | %configure \ |
102 | %{!?with_python2:--without-python2} \ | |
103 | %{!?with_python3:--without-python3} | |
a0b490d4 MB |
104 | %{__make} |
105 | ||
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | install -d $RPM_BUILD_ROOT%{_gtkdocdir} | |
109 | ||
110 | %{__make} install \ | |
111 | DESTDIR=$RPM_BUILD_ROOT | |
112 | ||
113 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
114 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
115 | %py_postclean | |
116 | ||
117 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
118 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
119 | ||
120 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la | |
121 | ||
f47aec23 | 122 | # no configure option to specify location |
a0b490d4 MB |
123 | %{__mv} $RPM_BUILD_ROOT{%{_datadir}/gtk-doc/html/libbytesize,%{_gtkdocdir}} |
124 | ||
125 | %find_lang %{name} | |
126 | ||
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
130 | %post -p /sbin/ldconfig | |
131 | %postun -p /sbin/ldconfig | |
132 | ||
133 | %files -f %{name}.lang | |
134 | %defattr(644,root,root,755) | |
135 | %doc README.md | |
136 | %attr(755,root,root) %{_libdir}/libbytesize.so.*.*.* | |
137 | %attr(755,root,root) %ghost %{_libdir}/libbytesize.so.1 | |
138 | ||
139 | %files devel | |
140 | %defattr(644,root,root,755) | |
141 | %attr(755,root,root) %{_libdir}/libbytesize.so | |
142 | %{_includedir}/bytesize | |
143 | %{_pkgconfigdir}/bytesize.pc | |
144 | ||
145 | %files apidocs | |
146 | %defattr(644,root,root,755) | |
147 | %{_gtkdocdir}/libbytesize | |
148 | ||
f47aec23 | 149 | %if %{with python2} |
a0b490d4 MB |
150 | %files -n python-bytesize |
151 | %defattr(644,root,root,755) | |
152 | %dir %{py_sitedir}/bytesize | |
153 | %{py_sitedir}/bytesize/*.py[co] | |
f47aec23 | 154 | %endif |
a0b490d4 | 155 | |
f47aec23 | 156 | %if %{with python3} |
a0b490d4 MB |
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 | |
f47aec23 | 162 | %endif |