]> git.pld-linux.org Git - packages/libbytesize.git/blob - libbytesize.spec
up to 2.9
[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.9
10 Release:        1
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:  ba30fedcc832d9e0ae6cdc7a5602efbb
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_python2:BuildRequires:  python-modules >= 2}
29 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
30 %{?with_python3:BuildRequires:  python3-modules >= 1:3.2}
31 BuildRequires:  rpm-build >= 4.6
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 The libbytesize is a C library that facilitates work with sizes in
36 bytes. Be it parsing the input from users or producing a nice human
37 readable representation of a size in bytes this library takes
38 localization into account. It also provides support for sizes bigger
39 than MAXUINT64.
40
41 %description -l pl.UTF-8
42 libbytesize to biblioteka C ułatwiająca pracę z rozmiarami w bajtach -
43 np. analizy wejścia od użytkowników czy tworzenia ładnej, czytelnej
44 dla człowieka reprezentacji rozmiaru w bajtach z uwzględnieniem
45 lokalizacji. Zapewnia także obsługę rozmiarów większych niż MAXUINT64.
46
47 %package devel
48 Summary:        Header files for libbytesize library
49 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libbytesize
50 Group:          Development/Libraries
51 Requires:       %{name} = %{version}-%{release}
52 Requires:       gmp-devel
53 Requires:       mpfr-devel
54
55 %description devel
56 Header files for libbytesize library.
57
58 %description devel -l pl.UTF-8
59 Pliki nagłówkowe biblioteki libbytesize.
60
61 %package apidocs
62 Summary:        libbytesize library API documentation
63 Summary(pl.UTF-8):      Dokumentacja API biblioteki libbytesize
64 Group:          Documentation
65 Requires:       gtk-doc-common
66 BuildArch:      noarch
67
68 %description apidocs
69 API documentation for libbytesize library.
70
71 %description apidocs -l pl.UTF-8
72 Dokumentacja API biblioteki libbytesize.
73
74 %package -n python-bytesize
75 Summary:        Python 2 bindings for libbytesize
76 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki libbytesize.
77 Group:          Libraries/Python
78 Requires:       %{name} = %{version}-%{release}
79 Requires:       python-six
80
81 %description -n python-bytesize
82 This package contains Python 2 bindings for libbytesize.
83
84 %description -n python-bytesize -l pl.UTF-8
85 Ten pakiet zawiera wiązania Pythona 2 do libbytesize.
86
87 %package -n python3-bytesize
88 Summary:        Python 3 bindings for libbytesize
89 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki libbytesize.
90 Group:          Libraries/Python
91 Requires:       %{name} = %{version}-%{release}
92 Requires:       python3-six
93
94 %description -n python3-bytesize
95 This package contains Python 3 bindings for libbytesize.
96
97 %description -n python3-bytesize -l pl.UTF-8
98 Ten pakiet zawiera wiązania Pythona 3 do libbytesize.
99
100 %prep
101 %setup -q
102 %patch0 -p1
103
104 %build
105 %{__libtoolize}
106 %{__aclocal} -I m4
107 %{__autoconf}
108 %{__automake}
109 %configure \
110         %{!?with_python2:--without-python2} \
111         %{!?with_python3:--without-python3}
112 %{__make}
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
117
118 %{__make} install \
119         DESTDIR=$RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
123 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
124 %py_postclean
125 %endif
126
127 %if %{with python3}
128 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
129 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
130 %endif
131
132 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
133
134 # no configure option to specify location
135 %{__mv} $RPM_BUILD_ROOT{%{_datadir}/gtk-doc/html/libbytesize,%{_gtkdocdir}}
136
137 %find_lang %{name}
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %post   -p /sbin/ldconfig
143 %postun -p /sbin/ldconfig
144
145 %files -f %{name}.lang
146 %defattr(644,root,root,755)
147 %doc README.md
148 %attr(755,root,root) %{_libdir}/libbytesize.so.*.*.*
149 %attr(755,root,root) %ghost %{_libdir}/libbytesize.so.1
150
151 %files devel
152 %defattr(644,root,root,755)
153 %attr(755,root,root) %{_libdir}/libbytesize.so
154 %{_includedir}/bytesize
155 %{_pkgconfigdir}/bytesize.pc
156
157 %files apidocs
158 %defattr(644,root,root,755)
159 %{_gtkdocdir}/libbytesize
160
161 %if %{with python2}
162 %files -n python-bytesize
163 %defattr(644,root,root,755)
164 %dir %{py_sitedir}/bytesize
165 %{py_sitedir}/bytesize/*.py[co]
166 %endif
167
168 %if %{with python3}
169 %files -n python3-bytesize
170 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_bindir}/bscalc
172 %dir %{py3_sitedir}/bytesize
173 %{py3_sitedir}/bytesize/__pycache__
174 %{py3_sitedir}/bytesize/*.py
175 %{_mandir}/man1/bscalc.1*
176 %endif
This page took 0.098023 seconds and 4 git commands to generate.