2019-09-30 11:15:37 -04:00
|
|
|
%bcond_without python2
|
|
|
|
|
%bcond_without python3
|
|
|
|
|
|
|
|
|
|
Name: python-systemd
|
|
|
|
|
Version: 234
|
2019-11-06 19:50:37 +08:00
|
|
|
Release: 9
|
2019-09-30 11:15:37 -04:00
|
|
|
Summary: Python module for native access to the systemd facilities.
|
|
|
|
|
License: LGPLv2+
|
|
|
|
|
URL: https://github.com/systemd/%{name}
|
|
|
|
|
Source0: https://github.com/systemd/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
|
|
|
|
2019-11-06 19:50:37 +08:00
|
|
|
BuildRequires: gcc pytest systemd-devel
|
2019-09-30 11:15:37 -04:00
|
|
|
%if %{with python2}
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
BuildRequires: python3-devel python3-sphinx python3-pytest
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Python module wrapping systemd functionality, includes sending of structured
|
|
|
|
|
messages to the journal and reading journal files, querying machine and boot
|
|
|
|
|
identifiers and a lists of message identifiers provided by systemd. Other
|
|
|
|
|
functionality provided by libsystemd is also wrapped.
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%package -n python2-systemd
|
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
|
|
%{?python_provide:%python_provide python2-systemd}
|
|
|
|
|
Provides: systemd-python = %{version}-%{release}
|
|
|
|
|
Provides: systemd-python%{?_isa} = %{version}-%{release}
|
|
|
|
|
Obsoletes: systemd-python < 230
|
|
|
|
|
Recommends: %{name}-help
|
|
|
|
|
|
|
|
|
|
%description -n python2-systemd
|
|
|
|
|
Systemed functionality for Python2 Packages.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%package -n python3-systemd
|
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
|
|
%{?python_provide:%python_provide python3-systemd}
|
|
|
|
|
Provides: systemd-python3 = %{version}-%{release}
|
|
|
|
|
Provides: systemd-python3%{?_isa} = %{version}-%{release}
|
|
|
|
|
Obsoletes: systemd-python3 < 230
|
|
|
|
|
Recommends: %{name}-help
|
|
|
|
|
|
|
|
|
|
%description -n python3-systemd
|
|
|
|
|
Systemed functionality for Python3 Packages.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%package help
|
|
|
|
|
Summary: Help files for %{name}
|
|
|
|
|
Requires: js-jquery
|
|
|
|
|
Provides: python-systemd-doc
|
|
|
|
|
Obsoletes: python-systemd-doc
|
|
|
|
|
|
|
|
|
|
%description help
|
|
|
|
|
Help files for %{name}
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
sed -i 's/py\.test/pytest/' Makefile
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%make_build PYTHON=%{__python2}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%make_build PYTHON=%{__python3}
|
|
|
|
|
%make_build PYTHON=%{__python3} SPHINX_BUILD=sphinx-build-3 sphinx-html
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
rm -rf build/html/.buildinfo build/html/.doctrees
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%make_install PYTHON=%{__python2}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%make_install PYTHON=%{__python3}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
mkdir %{buildroot}%{_pkgdocdir} -p
|
|
|
|
|
cp README.md NEWS %{buildroot}%{_pkgdocdir}/ -p
|
|
|
|
|
cp build/html %{buildroot}%{_pkgdocdir}/ -vr
|
|
|
|
|
ln -vsf %{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{_pkgdocdir}/html/_static/jquery.js
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
test -f /run/systemd/journal/stdout || sed -i 's/--doctest[^ ]*//g' pytest.ini
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
make check PYTHON=%{__python2}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
make check PYTHON=%{__python3}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%files -n python2-systemd
|
|
|
|
|
%license LICENSE.*
|
|
|
|
|
%doc %{_pkgdocdir}
|
|
|
|
|
%{python2_sitearch}/systemd/*
|
|
|
|
|
%{python2_sitearch}/systemd*.egg-info
|
|
|
|
|
%exclude %{_pkgdocdir}/html
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%files -n python3-systemd
|
|
|
|
|
%license LICENSE.*
|
|
|
|
|
%doc %{_pkgdocdir}
|
|
|
|
|
%{python3_sitearch}/systemd/*
|
|
|
|
|
%{python3_sitearch}/systemd*.egg-info
|
|
|
|
|
%exclude %{_pkgdocdir}/html
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files help
|
|
|
|
|
%doc %{_pkgdocdir}/html
|
|
|
|
|
|
|
|
|
|
%changelog
|
2019-11-06 19:50:37 +08:00
|
|
|
* Sat Oct 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 234-9
|
|
|
|
|
- optimize spec file.
|
|
|
|
|
|
2019-09-30 11:15:37 -04:00
|
|
|
* Wed Sep 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 234-8
|
|
|
|
|
- Package Init
|