]> git.pld-linux.org Git - packages/librepo.git/blob - librepo.spec
- rebuild with python 3.8
[packages/librepo.git] / librepo.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # doxygen/sphinx API documentation
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 Summary:        Library for downloading Linux repository metadata and packages
8 Summary(pl.UTF-8):      Biblioteka do pobierania metadanych repozytoriów roaz pakietów dla Linuksa
9 Name:           librepo
10 Version:        1.8.1
11 Release:        4
12 License:        GPL v2+
13 Group:          Libraries
14 #Source0Download: https://github.com/rpm-software-management/librepo/releases
15 Source0:        https://github.com/rpm-software-management/librepo/archive/%{version}/%{name}-%{version}.tar.gz
16 # Source0-md5:  01fe130eb421580d62e97e4991e94df7
17 Patch0:         %{name}-link.patch
18 Patch1:         %{name}-attr.patch
19 Patch2:         sphinx_executable.patch
20 URL:            http://rpm-software-management.github.io/librepo/
21 BuildRequires:  check-devel
22 BuildRequires:  cmake >= 2.8.5
23 BuildRequires:  curl-devel
24 %{?with_apidocs:BuildRequires:  doxygen}
25 BuildRequires:  expat-devel >= 1.95
26 BuildRequires:  glib2-devel >= 2.0
27 BuildRequires:  gpgme-devel
28 BuildRequires:  openssl-devel
29 BuildRequires:  rpmbuild(macros) >= 1.605
30 %if %{with python2}
31 BuildRequires:  python-devel >= 1:2
32 %{?with_apidocs:BuildRequires:  sphinx-pdg-2}
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-devel >= 1:3
36 %{?with_apidocs:BuildRequires:  sphinx-pdg-3}
37 %endif
38 BuildRequires:  tar >= 1:1.22
39 BuildRequires:  xz
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 A library providing C and Python (libcURL like) API for downloading
44 Linux repository metadata and packages.
45
46 %description -l pl.UTF-8
47 Biblioteka udostępniająca API C i Pythona (podobne do libcURL) służące
48 do pobierania metadanych repozytoriów oraz pakietów dla Linuksa.
49
50 %package devel
51 Summary:        Header files for librepo library
52 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki librepo
53 Group:          Development/Libraries
54 Requires:       %{name} = %{version}-%{release}
55 Requires:       curl-devel
56 Requires:       expat-devel >= 1.95
57 Requires:       glib2-devel >= 2.0
58 Requires:       gpgme-devel
59 Requires:       openssl-devel
60
61 %description devel
62 Header files for librepo library.
63
64 %description devel -l pl.UTF-8
65 Pliki nagłówkowe biblioteki librepo.
66
67 %package apidocs
68 Summary:        API documentation for librepo library
69 Summary(pl.UTF-8):      Dokumentacja API biblioteki librepo
70 Group:          Documentation
71 %if "%{_rpmversion}" >= "5"
72 BuildArch:      noarch
73 %endif
74
75 %description apidocs
76 API documentation for librepo library.
77
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API biblioteki librepo.
80
81 %package -n python-librepo
82 Summary:        Python 2 binding for librepo library
83 Summary(pl.UTF-8):      Wiązanie Pythona 2 do biblioteki librepo
84 Group:          Libraries/Python
85 Requires:       %{name} = %{version}-%{release}
86
87 %description -n python-librepo
88 Python 2 binding for librepo library.
89
90 %description -n python-librepo -l pl.UTF-8
91 Wiązanie Pythona 2 do biblioteki librepo.
92
93 %package -n python3-librepo
94 Summary:        Python 3 binding for librepo library
95 Summary(pl.UTF-8):      Wiązanie Pythona 3 do biblioteki librepo
96 Group:          Libraries/Python
97 Requires:       %{name} = %{version}-%{release}
98
99 %description -n python3-librepo
100 Python 3 binding for librepo library.
101
102 %description -n python3-librepo -l pl.UTF-8
103 Wiązanie Pythona 3 do biblioteki librepo.
104
105 %prep
106 %setup -q
107 %patch0 -p1
108 %patch1 -p1
109 %patch2 -p1
110
111 %build
112 install -d build
113 cd build
114 %cmake .. \
115 %if %{with python2}
116         -DPYTHON_DESIRED=2 \
117         -DPYTHON_INSTALL_DIR="%{py_sitedir}" \
118         -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-2
119 %endif
120
121 %{__make}
122
123 %if %{with apidocs}
124 %{__make} doc
125 %endif
126 cd ..
127
128 %if %{with python3}
129 install -d build-py3
130 cd build-py3
131 %cmake .. \
132         -DPYTHON_DESIRED=3 \
133         -DPYTHON_INSTALL_DIR="%{py3_sitedir}" \
134         -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3
135
136 %{__make}
137
138 %if %{with apidocs}
139 %{__make} doc
140 %endif
141 cd ..
142 %endif
143
144 %install
145 rm -rf $RPM_BUILD_ROOT
146
147 %{__make} -C build install \
148         DESTDIR=$RPM_BUILD_ROOT
149
150 %if %{with python3}
151 %{__make} -C build-py3 install \
152         DESTDIR=$RPM_BUILD_ROOT
153 %endif
154
155 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/librepo
156 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/librepo
157 %py_postclean
158
159 %clean
160 rm -rf $RPM_BUILD_ROOT
161
162 %post   -p /sbin/ldconfig
163 %postun -p /sbin/ldconfig
164
165 %files
166 %defattr(644,root,root,755)
167 %doc README.md
168 %attr(755,root,root) %{_libdir}/librepo.so.0
169
170 %files devel
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_libdir}/librepo.so
173 %{_includedir}/librepo
174 %{_pkgconfigdir}/librepo.pc
175
176 %if %{with apidocs}
177 %files apidocs
178 %defattr(644,root,root,755)
179 %doc build/doc/c/html/*
180 %endif
181
182 %if %{with python2}
183 %files -n python-librepo
184 %defattr(644,root,root,755)
185 %if %{with apidocs}
186 %doc build/doc/python/{*.html,_sources,_static}
187 %endif
188 %dir %{py_sitedir}/librepo
189 %attr(755,root,root) %{py_sitedir}/librepo/_librepomodule.so
190 %{py_sitedir}/librepo/__init__.py[co]
191 %endif
192
193 %if %{with python3}
194 %files -n python3-librepo
195 %defattr(644,root,root,755)
196 %if %{with apidocs}
197 %doc build-py3/doc/python/{*.html,_sources,_static}
198 %endif
199 %dir %{py3_sitedir}/librepo
200 %attr(755,root,root) %{py3_sitedir}/librepo/_librepo.so
201 %{py3_sitedir}/librepo/__init__.py
202 %endif
This page took 0.184562 seconds and 4 git commands to generate.