summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Bogusz2018-05-27 18:34:25 (GMT)
committerJakub Bogusz2018-05-27 18:34:25 (GMT)
commit6b4c9d00b0147d8c7d0de44e4c4d2c3b8d54dea3 (patch)
tree94ae6d65706f1ec3f358585278b3210253d80361
parent6876cdfbf666b9afb10c9be56fc57250a0df4248 (diff)
downloadhawkey-6b4c9d00b0147d8c7d0de44e4c4d2c3b8d54dea3.zip
hawkey-6b4c9d00b0147d8c7d0de44e4c4d2c3b8d54dea3.tar.gz
- -apidocs package refer to Python modules, renamed to python-hawkey-apidocsauto/th/hawkey-0.6.4-2
- hawkey(3) man page refers to Python modules, moved to python*- packages - disable python by default, modules will be built from libdnf.spec - release 2
-rw-r--r--hawkey.spec62
1 files changed, 40 insertions, 22 deletions
diff --git a/hawkey.spec b/hawkey.spec
index 490050c..90a7fb8 100644
--- a/hawkey.spec
+++ b/hawkey.spec
@@ -1,13 +1,18 @@
+# NOTE: deprecated in favour of libdnf.spec
#
# Conditional build:
+%bcond_with python # Python bindings (any) [python*-hawkey* modules are built from libdnf.spec now]
%bcond_without python3 # Python 3.x bindings
+%if %{without python}
+%undefine with_python3
+%endif
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
+Release: 2
License: LGPL v2.1+
Group: Libraries
#Source0Download: https://github.com/rpm-software-management/hawkey/releases
@@ -18,7 +23,7 @@ BuildRequires: check-devel
BuildRequires: cmake >= 2.4
BuildRequires: expat-devel
BuildRequires: libsolv-devel >= 0.6.5
-BuildRequires: python-devel >= 2
+%{?with_python:BuildRequires: python-devel >= 2}
%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
BuildRequires: rpm-devel
BuildRequires: rpmbuild(macros) >= 1.612
@@ -29,6 +34,9 @@ BuildRequires: zlib-devel
Requires: libsolv >= 0.6.5
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# hawkey(3) man page shared between python-hawkey and python3-hawkey
+%define _duplicate_files_terminate_build 0
+
%description
Hawkey is a library providing simplified C and Python API to libsolv.
@@ -52,20 +60,6 @@ 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
@@ -102,6 +96,21 @@ Python 3.x bindings for hawkey library.
%description -n python3-hawkey -l pl.UTF-8
Wiązania Pythona 3.x do biblioteki hawkey.
+%package -n python-hawkey-apidocs
+Summary: API documentation for Python hawkey module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona hawkey
+Group: Documentation
+Obsoletes: hawkey-apidocs < 0.6.4-2
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description -n python-hawkey-apidocs
+API documentation for Python hawkey module.
+
+%description -n python-hawkey-apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona hawkey.
+
%prep
%setup -q -n %{name}-%{name}-%{version}-%{gitrel}
: > cmake/modules/FindPythonInstDir.cmake
@@ -113,7 +122,8 @@ cd build
-DPYTHON_INSTALL_DIR=%{py_sitedir}
%{__make}
-%{__make} doc
+
+%{__make} doc%{!?with_python:-man}
%if %{with python3}
cd ../build-py3
@@ -135,6 +145,7 @@ rm -rf $RPM_BUILD_ROOT
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
%py_postclean
@@ -142,6 +153,10 @@ rm -rf $RPM_BUILD_ROOT
%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
%endif
+%else
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/hawkey.3
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -159,17 +174,14 @@ rm -rf $RPM_BUILD_ROOT
%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}
+%if %{with python}
%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]
+%{_mandir}/man3/hawkey.3*
%files -n python-hawkey-test
%defattr(644,root,root,755)
@@ -184,4 +196,10 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
%{py3_sitedir}/hawkey/*.py
%{py3_sitedir}/hawkey/__pycache__
+%{_mandir}/man3/hawkey.3*
+%endif
+
+%files -n python-hawkey-apidocs
+%defattr(644,root,root,755)
+%doc build/doc/{*.html,*.js,_static}
%endif