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