summaryrefslogtreecommitdiff
path: root/hawkey.spec
blob: 490050c30ba06c1e2477a2821a6b37c59c15cec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#
# Conditional build:
%bcond_without	python3		# Python 3.x bindings

Summary:	High-level API for the libsolv library
Summary(pl.UTF-8):	Wysokopoziomowe API dla biblioteki libsolv
Name:		hawkey
Version:	0.6.4
%define	gitrel	1
Release:	1
License:	LGPL v2.1+
Group:		Libraries
#Source0Download: https://github.com/rpm-software-management/hawkey/releases
Source0:	https://github.com/rpm-software-management/hawkey/archive/%{name}-%{version}-%{gitrel}.tar.gz
# Source0-md5:	abc0179de2cb162c170c1fce17ed7f50
URL:		https://github.com/rpm-software-management/hawkey
BuildRequires:	check-devel
BuildRequires:	cmake >= 2.4
BuildRequires:	expat-devel
BuildRequires:	libsolv-devel >= 0.6.5
BuildRequires:	python-devel >= 2
%{?with_python3:BuildRequires:	python3-devel >= 1:3.2}
BuildRequires:	rpm-devel
BuildRequires:	rpmbuild(macros) >= 1.612
BuildRequires:	sphinx-pdg
BuildRequires:	tar >= 1:1.22
BuildRequires:	xz
BuildRequires:	zlib-devel
Requires:	libsolv >= 0.6.5
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
Hawkey is a library providing simplified C and Python API to libsolv.

%description -l pl.UTF-8
Hawkey to biblioteka udostępniająca uproszczone API dla języków C i
Python do biblioteki libsolv.

%package devel
Summary:	Header files for hawkey library
Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki hawkey
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	libsolv-devel >= 0.6.5
Requires:	rpm-devel
Requires:	zlib-devel
Obsoletes:	hawkey-static

%description devel
Header files for hawkey library.

%description devel -l pl.UTF-8
Pliki nagłówkowe biblioteki hawkey.

%package apidocs
Summary:	API documentation for hawkey library
Summary(pl.UTF-8):	Dokumentacja API biblioteki hawkey
Group:		Documentation
%if "%{_rpmversion}" >= "5"
BuildArch:	noarch
%endif

%description apidocs
API documentation for hawkey library.

%description apidocs -l pl.UTF-8
Dokumentacja API biblioteki hawkey.

%package -n python-hawkey
Summary:	Python 2.x bindings for hawkey library
Summary(pl.UTF-8):	Wiązania Pythona 2.x do biblioteki hawkey
Group:		Libraries/Python
Requires:	%{name} = %{version}-%{release}

%description -n python-hawkey
Python 2.x bindings for hawkey library.

%description -n python-hawkey -l pl.UTF-8
Wiązania Pythona 2.x do biblioteki hawkey.

%package -n python-hawkey-test
Summary:	Test module for hawkey library
Summary(pl.UTF-8):	Moduł testowy dla biblioteki hawkey
Group:		Development/Libraries
Requires:	python-hawkey = %{version}-%{release}

%description -n python-hawkey-test
Test module for hawkey library.

%description -n python-hawkey-test -l pl.UTF-8
Moduł testowy dla biblioteki hawkey.

%package -n python3-hawkey
Summary:	Python 3.x bindings for hawkey library
Summary(pl.UTF-8):	Wiązania Pythona 3.x do biblioteki hawkey
Group:		Libraries/Python
Requires:	%{name} = %{version}-%{release}

%description -n python3-hawkey
Python 3.x bindings for hawkey library.

%description -n python3-hawkey -l pl.UTF-8
Wiązania Pythona 3.x do biblioteki hawkey.

%prep
%setup -q -n %{name}-%{name}-%{version}-%{gitrel}
: > cmake/modules/FindPythonInstDir.cmake

%build
install -d build %{?with_python3:build-py3}
cd build
%cmake .. \
	-DPYTHON_INSTALL_DIR=%{py_sitedir}

%{__make}
%{__make} doc

%if %{with python3}
cd ../build-py3
%cmake .. \
	-DPYTHON_INSTALL_DIR=%{py3_sitedir} \
	-DPYTHON_DESIRED=3

%{__make}
%endif

%install
rm -rf $RPM_BUILD_ROOT

%if %{with python3}
%{__make} -C build-py3/src/python install \
	DESTDIR=$RPM_BUILD_ROOT
%endif

%{__make} -C build install \
	DESTDIR=$RPM_BUILD_ROOT

%py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
%py_postclean
%if %{with python3}
%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc AUTHORS README.rst
%attr(755,root,root) %{_libdir}/libhawkey.so.2

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libhawkey.so
%{_includedir}/hawkey
%{_pkgconfigdir}/hawkey.pc
%{_mandir}/man3/hawkey.3*

%files apidocs
%defattr(644,root,root,755)
%doc build/doc/{*.html,*.js,_static}

%files -n python-hawkey
%defattr(644,root,root,755)
%dir %{py_sitedir}/hawkey
%attr(755,root,root) %{py_sitedir}/hawkey/_hawkeymodule.so
%{py_sitedir}/hawkey/*.py[co]

%files -n python-hawkey-test
%defattr(644,root,root,755)
%dir %{py_sitedir}/hawkey/test
%{py_sitedir}/hawkey/test/*.py[co]
%attr(755,root,root) %{py_sitedir}/hawkey/test/_hawkey_testmodule.so

%if %{with python3}
%files -n python3-hawkey
%defattr(644,root,root,755)
%dir %{py3_sitedir}/hawkey
%attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
%{py3_sitedir}/hawkey/*.py
%{py3_sitedir}/hawkey/__pycache__
%endif