]> git.pld-linux.org Git - packages/librepo.git/blob - librepo.spec
up to 1.16.0
[packages/librepo.git] / librepo.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # doxygen/sphinx API documentation
4 %bcond_without  python3 # CPython 3.x module
5
6 Summary:        Library for downloading Linux repository metadata and packages
7 Summary(pl.UTF-8):      Biblioteka do pobierania metadanych repozytoriów oraz pakietów dla Linuksa
8 Name:           librepo
9 Version:        1.16.0
10 Release:        1
11 License:        GPL v2+
12 Group:          Libraries
13 #Source0Download: https://github.com/rpm-software-management/librepo/releases
14 Source0:        https://github.com/rpm-software-management/librepo/archive/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5:  96162be49af5fb8bface13e273cbde4c
16 Patch0:         %{name}-link.patch
17 Patch1:         %{name}-gpgme-pkgconfig.patch
18 Patch2:         sphinx_executable.patch
19 URL:            http://rpm-software-management.github.io/librepo/
20 BuildRequires:  check-devel
21 BuildRequires:  cmake >= 2.8.5
22 BuildRequires:  curl-devel >= 7.52
23 %{?with_apidocs:BuildRequires:  doxygen}
24 BuildRequires:  glib2-devel >= 1:2.66
25 BuildRequires:  gpgme-devel
26 BuildRequires:  libxml2-devel >= 2.0
27 BuildRequires:  openssl-devel
28 BuildRequires:  pkgconfig
29 BuildRequires:  rpm-build >= 4.6
30 BuildRequires:  rpmbuild(macros) >= 1.742
31 %if %{with python3}
32 BuildRequires:  python3-devel >= 1:3
33 BuildRequires:  python3-modules >= 1:3
34 %{?with_apidocs:BuildRequires:  sphinx-pdg-3}
35 %endif
36 BuildRequires:  tar >= 1:1.22
37 BuildRequires:  zchunk-devel >= 0.9.11
38 BuildRequires:  xz
39 Requires:       curl-libs >= 7.52
40 Requires:       glib2 >= 1:2.66
41 Requires:       zchunk-libs >= 0.9.11
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 >= 7.52
58 Requires:       glib2-devel >= 1:2.66
59 Requires:       gpgme-devel
60 Requires:       libxml2-devel >= 2.0
61 Requires:       openssl-devel
62 Requires:       zchunk-devel >= 0.9.11
63
64 %description devel
65 Header files for librepo library.
66
67 %description devel -l pl.UTF-8
68 Pliki nagłówkowe biblioteki librepo.
69
70 %package apidocs
71 Summary:        API documentation for librepo library
72 Summary(pl.UTF-8):      Dokumentacja API biblioteki librepo
73 Group:          Documentation
74 BuildArch:      noarch
75
76 %description apidocs
77 API documentation for librepo library.
78
79 %description apidocs -l pl.UTF-8
80 Dokumentacja API biblioteki librepo.
81
82 %package -n python3-librepo
83 Summary:        Python 3 binding for librepo library
84 Summary(pl.UTF-8):      Wiązanie Pythona 3 do biblioteki librepo
85 Group:          Libraries/Python
86 Requires:       %{name} = %{version}-%{release}
87
88 %description -n python3-librepo
89 Python 3 binding for librepo library.
90
91 %description -n python3-librepo -l pl.UTF-8
92 Wiązanie Pythona 3 do biblioteki librepo.
93
94 %package -n python3-librepo-apidocs
95 Summary:        API documentation for Python librepo binding
96 Summary(pl.UTF-8):      Dokumentacja API do wiązań Pythona do librepo
97 Group:          Documentation
98 BuildArch:      noarch
99
100 %description -n python3-librepo-apidocs
101 API documentation for Python librepo binding.
102
103 %description -n python3-librepo-apidocs -l pl.UTF-8
104 Dokumentacja API do wiązań Pythona do librepo.
105
106 %prep
107 %setup -q
108 %patch0 -p1
109 %patch1 -p1
110 %patch2 -p1
111
112 %build
113 install -d build
114 cd build
115 %cmake .. \
116         %{cmake_on_off apidocs ENABLE_DOCS} \
117 %if %{with python3}
118         -DPYTHON_DESIRED=3 \
119         -DPYTHON_INSTALL_DIR="%{py3_sitedir}" \
120         -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3
121 %endif
122
123 %{__make}
124
125 %if %{with apidocs}
126 %{__make} doc
127 %endif
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131
132 %{__make} -C build install \
133         DESTDIR=$RPM_BUILD_ROOT
134
135 %if %{with python3}
136 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
137 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
138 %endif
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %post   -p /sbin/ldconfig
144 %postun -p /sbin/ldconfig
145
146 %files
147 %defattr(644,root,root,755)
148 %doc README.md
149 %attr(755,root,root) %{_libdir}/librepo.so.0
150
151 %files devel
152 %defattr(644,root,root,755)
153 %attr(755,root,root) %{_libdir}/librepo.so
154 %{_includedir}/librepo
155 %{_pkgconfigdir}/librepo.pc
156
157 %if %{with apidocs}
158 %files apidocs
159 %defattr(644,root,root,755)
160 %doc build/doc/c/html/*
161 %endif
162
163 %if %{with python3}
164 %files -n python3-librepo
165 %defattr(644,root,root,755)
166 %dir %{py3_sitedir}/librepo
167 %attr(755,root,root) %{py3_sitedir}/librepo/_librepo.so
168 %{py3_sitedir}/librepo/__init__.py
169 %{py3_sitedir}/librepo/__pycache__
170
171 %if %{with apidocs}
172 %files -n python3-librepo-apidocs
173 %defattr(644,root,root,755)
174 %doc build/doc/python/{_static,*.html,*.js}
175 %endif
176 %endif
This page took 0.082516 seconds and 3 git commands to generate.