]>
Commit | Line | Data |
---|---|---|
b3591a76 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # do not build and package API docs | |
4 | # | |
5 | Summary: Library for downloading Linux repository metadata and packages | |
6 | Summary(pl.UTF-8): Biblioteka do pobierania metadanych repozytoriów roaz pakietów dla Linuksa | |
7 | Name: librepo | |
8 | Version: 1.5.0 | |
9 | %define snap 20131221 | |
10 | Release: 0.%{snap}.1 | |
11 | License: GPL v2+ | |
12 | Group: Libraries | |
13 | #Source0: https://github.com/Tojaj/librepo/archive/%{version}/%{name}-%{version}.tar.gz | |
14 | # argh, the latest tagged version is 1.0.0, while current is 1.5.0 | |
15 | Source0: %{name}.tar.xz | |
16 | # Source0-md5: 8a2df0be32cdbd2d7cb6124f673c780f | |
17 | Patch0: %{name}-link.patch | |
18 | URL: http://tojaj.github.io/librepo/ | |
19 | BuildRequires: attr-devel | |
20 | BuildRequires: check-devel | |
21 | BuildRequires: cmake >= 2.6 | |
22 | BuildRequires: curl-devel | |
23 | %{?with_apidocs:BuildRequires: doxygen} | |
24 | BuildRequires: glib2-devel >= 2.0 | |
25 | BuildRequires: gpgme-devel | |
26 | BuildRequires: expat-devel >= 1.95 | |
27 | BuildRequires: openssl-devel | |
28 | BuildRequires: python-devel >= 2 | |
29 | BuildRequires: rpmbuild(macros) >= 1.605 | |
30 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
31 | BuildRequires: tar >= 1:1.22 | |
32 | BuildRequires: xz | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | A library providing C and Python (libcURL like) API for downloading | |
37 | Linux repository metadata and packages. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Biblioteka udostępniająca API C i Pythona (podobne do libcURL) służące | |
41 | do pobierania metadanych repozytoriów oraz pakietów dla Linuksa. | |
42 | ||
43 | %package devel | |
44 | Summary: Header files for librepo library | |
45 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki librepo | |
46 | Group: Development/Libraries | |
47 | Requires: %{name} = %{version}-%{release} | |
48 | Requires: curl-devel | |
49 | Requires: expat-devel >= 1.95 | |
50 | Requires: glib2-devel >= 2.0 | |
51 | Requires: gpgme-devel | |
52 | Requires: openssl-devel | |
53 | ||
54 | %description devel | |
55 | Header files for librepo library. | |
56 | ||
57 | %description devel -l pl.UTF-8 | |
58 | Pliki nagłówkowe biblioteki librepo. | |
59 | ||
60 | %package apidocs | |
61 | Summary: API documentation for librepo library | |
62 | Summary(pl.UTF-8): Dokumentacja API biblioteki librepo | |
63 | Group: Documentation | |
64 | ||
65 | %description apidocs | |
66 | API documentation for librepo library. | |
67 | ||
68 | %description apidocs -l pl.UTF-8 | |
69 | Dokumentacja API biblioteki librepo. | |
70 | ||
71 | %package -n python-librepo | |
72 | Summary: Python binding for librepo library | |
73 | Summary(pl.UTF-8): Wiązanie Pythona do biblioteki librepo | |
74 | Group: Libraries/Python | |
75 | Requires: %{name} = %{version}-%{release} | |
76 | ||
77 | %description -n python-librepo | |
78 | Python binding for librepo library. | |
79 | ||
80 | %description -n python-librepo -l pl.UTF-8 | |
81 | Wiązanie Pythona do biblioteki librepo. | |
82 | ||
83 | %prep | |
84 | %setup -q -n %{name} | |
85 | %patch0 -p1 | |
86 | ||
87 | %build | |
88 | install -d build | |
89 | cd build | |
90 | %cmake .. | |
91 | ||
92 | %{__make} | |
93 | ||
94 | %if %{with apidocs} | |
95 | %{__make} doc | |
96 | %endif | |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %{__make} -C build install \ | |
102 | DESTDIR=$RPM_BUILD_ROOT | |
103 | ||
104 | %py_comp $RPM_BUILD_ROOT%{py_sitedir}/librepo | |
105 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/librepo | |
106 | %py_postclean | |
107 | ||
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %post -p /sbin/ldconfig | |
112 | %postun -p /sbin/ldconfig | |
113 | ||
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %doc README.md | |
117 | %attr(755,root,root) %{_libdir}/librepo.so.0 | |
118 | ||
119 | %files devel | |
120 | %defattr(644,root,root,755) | |
121 | %attr(755,root,root) %{_libdir}/librepo.so | |
122 | %{_includedir}/librepo | |
123 | %{_pkgconfigdir}/librepo.pc | |
124 | ||
125 | %if %{with apidocs} | |
126 | %files apidocs | |
127 | %defattr(644,root,root,755) | |
128 | %doc build/doc/c/html/* | |
129 | %endif | |
130 | ||
131 | %files -n python-librepo | |
132 | %defattr(644,root,root,755) | |
133 | %if %{with apidocs} | |
134 | %doc build/doc/python/{*.html,_sources,_static} | |
135 | %endif | |
136 | %dir %{py_sitedir}/librepo | |
137 | %attr(755,root,root) %{py_sitedir}/librepo/_librepomodule.so | |
138 | %{py_sitedir}/librepo/__init__.py[co] |