]> git.pld-linux.org Git - packages/librepo.git/blob - librepo.spec
- unconditional noarch subpackages
[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:        5
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 BuildArch:      noarch
72
73 %description apidocs
74 API documentation for librepo library.
75
76 %description apidocs -l pl.UTF-8
77 Dokumentacja API biblioteki librepo.
78
79 %package -n python-librepo
80 Summary:        Python 2 binding for librepo library
81 Summary(pl.UTF-8):      Wiązanie Pythona 2 do biblioteki librepo
82 Group:          Libraries/Python
83 Requires:       %{name} = %{version}-%{release}
84
85 %description -n python-librepo
86 Python 2 binding for librepo library.
87
88 %description -n python-librepo -l pl.UTF-8
89 Wiązanie Pythona 2 do biblioteki librepo.
90
91 %package -n python3-librepo
92 Summary:        Python 3 binding for librepo library
93 Summary(pl.UTF-8):      Wiązanie Pythona 3 do biblioteki librepo
94 Group:          Libraries/Python
95 Requires:       %{name} = %{version}-%{release}
96
97 %description -n python3-librepo
98 Python 3 binding for librepo library.
99
100 %description -n python3-librepo -l pl.UTF-8
101 Wiązanie Pythona 3 do biblioteki librepo.
102
103 %prep
104 %setup -q
105 %patch0 -p1
106 %patch1 -p1
107 %patch2 -p1
108
109 %build
110 install -d build
111 cd build
112 %cmake .. \
113 %if %{with python2}
114         -DPYTHON_DESIRED=2 \
115         -DPYTHON_INSTALL_DIR="%{py_sitedir}" \
116         -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-2
117 %endif
118
119 %{__make}
120
121 %if %{with apidocs}
122 %{__make} doc
123 %endif
124 cd ..
125
126 %if %{with python3}
127 install -d build-py3
128 cd build-py3
129 %cmake .. \
130         -DPYTHON_DESIRED=3 \
131         -DPYTHON_INSTALL_DIR="%{py3_sitedir}" \
132         -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3
133
134 %{__make}
135
136 %if %{with apidocs}
137 %{__make} doc
138 %endif
139 cd ..
140 %endif
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144
145 %{__make} -C build install \
146         DESTDIR=$RPM_BUILD_ROOT
147
148 %if %{with python3}
149 %{__make} -C build-py3 install \
150         DESTDIR=$RPM_BUILD_ROOT
151 %endif
152
153 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/librepo
154 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/librepo
155 %py_postclean
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post   -p /sbin/ldconfig
161 %postun -p /sbin/ldconfig
162
163 %files
164 %defattr(644,root,root,755)
165 %doc README.md
166 %attr(755,root,root) %{_libdir}/librepo.so.0
167
168 %files devel
169 %defattr(644,root,root,755)
170 %attr(755,root,root) %{_libdir}/librepo.so
171 %{_includedir}/librepo
172 %{_pkgconfigdir}/librepo.pc
173
174 %if %{with apidocs}
175 %files apidocs
176 %defattr(644,root,root,755)
177 %doc build/doc/c/html/*
178 %endif
179
180 %if %{with python2}
181 %files -n python-librepo
182 %defattr(644,root,root,755)
183 %if %{with apidocs}
184 %doc build/doc/python/{*.html,_sources,_static}
185 %endif
186 %dir %{py_sitedir}/librepo
187 %attr(755,root,root) %{py_sitedir}/librepo/_librepomodule.so
188 %{py_sitedir}/librepo/__init__.py[co]
189 %endif
190
191 %if %{with python3}
192 %files -n python3-librepo
193 %defattr(644,root,root,755)
194 %if %{with apidocs}
195 %doc build-py3/doc/python/{*.html,_sources,_static}
196 %endif
197 %dir %{py3_sitedir}/librepo
198 %attr(755,root,root) %{py3_sitedir}/librepo/_librepo.so
199 %{py3_sitedir}/librepo/__init__.py
200 %endif
This page took 0.731034 seconds and 3 git commands to generate.