]> git.pld-linux.org Git - packages/libbytesize.git/blob - libbytesize.spec
3d25844ac30742db603171201dbf7b7e91eb2944
[packages/libbytesize.git] / libbytesize.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 Summary:        A library for working with sizes in bytes
7 Summary(pl.UTF-8):      Biblioteka do pracy z rozmiarami w bajtach
8 Name:           libbytesize
9 Version:        2.5
10 Release:        2
11 License:        LGPL v2+
12 Group:          Libraries
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)
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
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
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}
49 Requires:       gmp-devel
50 Requires:       mpfr-devel
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
72 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki libbytesize.
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
80 %description -n python-bytesize -l pl.UTF-8
81 Ten pakiet zawiera wiązania Pythona 2 do libbytesize.
82
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}
88 Requires:       python3-six
89
90 %description -n python3-bytesize
91 This package contains Python 3 bindings for libbytesize.
92
93 %description -n python3-bytesize -l pl.UTF-8
94 Ten pakiet zawiera wiązania Pythona 3 do libbytesize.
95
96 %prep
97 %setup -q
98 %patch0 -p1
99
100 %build
101 %{__libtoolize}
102 %{__aclocal} -I m4
103 %{__autoconf}
104 %{__automake}
105 %configure \
106         %{!?with_python2:--without-python2} \
107         %{!?with_python3:--without-python3}
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
117 %if %{with python2}
118 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
119 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
120 %py_postclean
121 %endif
122
123 %if %{with python3}
124 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
125 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
126 %endif
127
128 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
129
130 # no configure option to specify location
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
157 %if %{with python2}
158 %files -n python-bytesize
159 %defattr(644,root,root,755)
160 %dir %{py_sitedir}/bytesize
161 %{py_sitedir}/bytesize/*.py[co]
162 %endif
163
164 %if %{with python3}
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*
172 %endif
This page took 0.058743 seconds and 2 git commands to generate.