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