]> git.pld-linux.org Git - packages/librepo.git/blame - librepo.spec
noarch apidocs
[packages/librepo.git] / librepo.spec
CommitLineData
b3591a76
JB
1#
2# Conditional build:
3%bcond_without apidocs # do not build and package API docs
3a50a18e
JK
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
f8d47da0 6
b3591a76
JB
7Summary: Library for downloading Linux repository metadata and packages
8Summary(pl.UTF-8): Biblioteka do pobierania metadanych repozytoriów roaz pakietów dla Linuksa
9Name: librepo
5ebce502 10Version: 1.7.17
5b7272ed 11Release: 2
b3591a76
JB
12License: GPL v2+
13Group: Libraries
5ebce502
JB
14#Source0Download: https://github.com/rpm-software-management/librepo/releases
15Source0: https://github.com/rpm-software-management/librepo/archive/%{name}-%{version}.tar.gz
16# Source0-md5: 8e3b23e44aab8cd516d2b05d62f6f559
73a14cac 17#Source0: http://pkgs.fedoraproject.org/repo/pkgs/librepo/%{name}-%{gitrev}.tar.xz/904628ef27b512e7aed07a6d41613c87/librepo-%{gitrev}.tar.xz
b3591a76 18Patch0: %{name}-link.patch
3a50a18e
JK
19Patch1: python-install-dir.patch
20Patch2: sphinx_executable.patch
5ebce502 21URL: http://rpm-software-management.github.io/librepo/
b3591a76
JB
22BuildRequires: attr-devel
23BuildRequires: check-devel
24BuildRequires: cmake >= 2.6
25BuildRequires: curl-devel
26%{?with_apidocs:BuildRequires: doxygen}
f8d47da0 27BuildRequires: expat-devel >= 1.95
b3591a76
JB
28BuildRequires: glib2-devel >= 2.0
29BuildRequires: gpgme-devel
b3591a76 30BuildRequires: openssl-devel
b3591a76 31BuildRequires: rpmbuild(macros) >= 1.605
3a50a18e
JK
32%if %{with python2}
33BuildRequires: python-devel >= 1:2
34%{?with_apidocs:BuildRequires: sphinx-pdg-2}
35%endif
36%if %{with python3}
37BuildRequires: python3-devel >= 1:3
38%{?with_apidocs:BuildRequires: sphinx-pdg-3}
39%endif
b3591a76
JB
40BuildRequires: tar >= 1:1.22
41BuildRequires: xz
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45A library providing C and Python (libcURL like) API for downloading
46Linux repository metadata and packages.
47
48%description -l pl.UTF-8
49Biblioteka udostępniająca API C i Pythona (podobne do libcURL) służące
50do pobierania metadanych repozytoriów oraz pakietów dla Linuksa.
51
52%package devel
53Summary: Header files for librepo library
54Summary(pl.UTF-8): Pliki nagłówkowe biblioteki librepo
55Group: Development/Libraries
56Requires: %{name} = %{version}-%{release}
57Requires: curl-devel
58Requires: expat-devel >= 1.95
59Requires: glib2-devel >= 2.0
60Requires: gpgme-devel
61Requires: openssl-devel
62
63%description devel
64Header files for librepo library.
65
66%description devel -l pl.UTF-8
67Pliki nagłówkowe biblioteki librepo.
68
69%package apidocs
70Summary: API documentation for librepo library
71Summary(pl.UTF-8): Dokumentacja API biblioteki librepo
72Group: Documentation
5b7272ed
ER
73%if "%{_rpmversion}" >= "5"
74BuildArch: noarch
75%endif
b3591a76
JB
76
77%description apidocs
78API documentation for librepo library.
79
80%description apidocs -l pl.UTF-8
81Dokumentacja API biblioteki librepo.
82
83%package -n python-librepo
4aef9171
JB
84Summary: Python 2 binding for librepo library
85Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki librepo
b3591a76
JB
86Group: Libraries/Python
87Requires: %{name} = %{version}-%{release}
88
89%description -n python-librepo
4aef9171 90Python 2 binding for librepo library.
b3591a76
JB
91
92%description -n python-librepo -l pl.UTF-8
4aef9171 93Wiązanie Pythona 2 do biblioteki librepo.
b3591a76 94
3a50a18e 95%package -n python3-librepo
4aef9171
JB
96Summary: Python 3 binding for librepo library
97Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki librepo
3a50a18e
JK
98Group: Libraries/Python
99Requires: %{name} = %{version}-%{release}
100
101%description -n python3-librepo
4aef9171 102Python 3 binding for librepo library.
3a50a18e
JK
103
104%description -n python3-librepo -l pl.UTF-8
4aef9171 105Wiązanie Pythona 3 do biblioteki librepo.
3a50a18e 106
b3591a76 107%prep
73a14cac 108%setup -q -n %{name}-%{name}-%{version}
b3591a76 109%patch0 -p1
3a50a18e
JK
110%patch1 -p1
111%patch2 -p1
b3591a76
JB
112
113%build
114install -d build
115cd build
3a50a18e
JK
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
b3591a76
JB
122
123%{__make}
124
125%if %{with apidocs}
126%{__make} doc
127%endif
3a50a18e
JK
128cd ..
129
130%if %{with python3}
131install -d build-py3
132cd 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
143cd ..
144%endif
b3591a76
JB
145
146%install
147rm -rf $RPM_BUILD_ROOT
148
149%{__make} -C build install \
150 DESTDIR=$RPM_BUILD_ROOT
151
3a50a18e
JK
152%if %{with python3}
153%{__make} -C build-py3 install \
154 DESTDIR=$RPM_BUILD_ROOT
155%endif
156
b3591a76
JB
157%py_comp $RPM_BUILD_ROOT%{py_sitedir}/librepo
158%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/librepo
159%py_postclean
160
161%clean
162rm -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
3a50a18e 184%if %{with python2}
b3591a76
JB
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]
3a50a18e
JK
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.317414 seconds and 4 git commands to generate.