Blame SPECS/python-systemd.spec

020476
%if 0%{?rhel} > 7
020476
# Disable python2 build by default
020476
%bcond_with python2
020476
%else
020476
%bcond_without python2
020476
%endif
020476
020476
Name:           python-systemd
020476
Version:        234
020476
Release:        8%{?dist}
020476
Summary:        Python module wrapping systemd functionality
020476
020476
License:        LGPLv2+
020476
URL:            https://github.com/systemd/python-systemd
020476
Source0:        https://github.com/systemd/python-systemd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
020476
020476
%bcond_with docs
020476
020476
BuildRequires:  systemd-devel
020476
%if %{with python2}
020476
BuildRequires:  python2-devel
020476
BuildRequires:  python2-pytest
020476
%endif # with python2
020476
020476
BuildRequires:  python3-devel
020476
%if %{with doc}
020476
BuildRequires:  python3-sphinx
020476
%endif #{with doc}
020476
BuildRequires:  web-assets-devel
020476
BuildRequires:  python3-pytest
020476
020476
%global _description \
020476
Python module for native access to the systemd facilities.\
020476
Functionality includes sending of structured messages to the journal\
020476
and reading journal files, querying machine and boot identifiers and a\
020476
lists of message identifiers provided by systemd. Other functionality\
020476
provided by libsystemd is also wrapped.
020476
020476
%description %_description
020476
020476
%if %{with python2}
020476
%package -n python2-systemd
020476
Summary:        %{summary}
020476
020476
%{?python_provide:%python_provide python2-systemd}
020476
Provides:       systemd-python = %{version}-%{release}
020476
Provides:       systemd-python%{?_isa} = %{version}-%{release}
020476
Obsoletes:      systemd-python < 230
020476
Recommends:	%{name}-doc
020476
020476
%description -n python2-systemd %_description
020476
%endif # with python2
020476
020476
%package -n python3-systemd
020476
Summary:        %{summary}
020476
020476
%{?python_provide:%python_provide python3-systemd}
020476
Provides:       systemd-python3 = %{version}-%{release}
020476
Provides:       systemd-python3%{?_isa} = %{version}-%{release}
020476
Obsoletes:      systemd-python3 < 230
020476
Recommends:	%{name}-doc
020476
020476
%description -n python3-systemd %_description
020476
020476
%if %{with doc}
020476
%package doc
020476
Summary:        HTML documentation for %{name}
020476
Requires:       js-jquery
020476
020476
%description doc
020476
%{summary}.
020476
%endif #{with doc}
020476
020476
%prep
020476
%autosetup -p1
020476
sed -i 's/py\.test/pytest/' Makefile
020476
020476
%build
020476
%if %{with python2}
020476
make PYTHON=%{__python2} build
020476
%endif # with python2
020476
make PYTHON=%{__python3} build
020476
%if %{with doc}
020476
make PYTHON=%{__python3} SPHINX_BUILD=sphinx-build-3 sphinx-html
020476
rm -r build/html/.buildinfo build/html/.doctrees
020476
%endif #{with doc}
020476
020476
%install
020476
%if %{with python2}
020476
%make_install PYTHON=%{__python2}
020476
%endif # with python2
020476
%make_install PYTHON=%{__python3}
020476
%if %{with doc}
020476
mkdir -p %{buildroot}%{_pkgdocdir}
020476
cp -rv build/html %{buildroot}%{_pkgdocdir}/
020476
ln -vsf %{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{_pkgdocdir}/html/_static/jquery.js
020476
cp -p README.md NEWS %{buildroot}%{_pkgdocdir}/
020476
%endif #{with doc}
020476
020476
%check
020476
# if the socket is not there, skip doc tests
020476
test -f /run/systemd/journal/stdout || \
020476
     sed -i 's/--doctest[^ ]*//g' pytest.ini
020476
%if %{with python2}
020476
make PYTHON=%{__python2} check
020476
%endif # with python2
020476
make PYTHON=%{__python3} check
020476
020476
%if %{with python2}
020476
%files -n python2-systemd
020476
%license LICENSE.txt
020476
%exclude %{_pkgdocdir}/html
020476
%{python2_sitearch}/systemd/
020476
%{python2_sitearch}/systemd_python*.egg-info
020476
%endif # with python2
020476
020476
%files -n python3-systemd
020476
%license LICENSE.txt
020476
%exclude %{_pkgdocdir}/html
020476
%{python3_sitearch}/systemd/
020476
%{python3_sitearch}/systemd_python*.egg-info
020476
020476
%if %{with doc}
020476
%files doc
020476
%license LICENSE.txt
020476
%doc %{_pkgdocdir}
020476
%doc %{_pkgdocdir}/html
020476
%endif #{with doc}
020476
020476
%changelog
020476
* Mon Jul 09 2018 Charalampos Stratakis <cstratak@redhat.com> - 234-8
020476
- Conditionalize the python2 subpackage
020476
020476
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 234-7
020476
- Conditionalize the doc subpackage
020476
020476
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 234-6
020476
- Allow Python 2 for build
020476
020476
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 234-5
020476
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
020476
020476
* Wed Nov  1 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 234-4
020476
- Use separate license and documentation directories
020476
020476
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 234-3
020476
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
020476
020476
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 234-2
020476
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
020476
020476
* Sun Mar 26 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 234-1
020476
- Update to latest version
020476
020476
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 232-3
020476
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
020476
020476
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 232-2
020476
- Rebuild for Python 3.6
020476
020476
* Thu Sep 22 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 232-1
020476
- Update to latest version
020476
020476
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 231-6
020476
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
020476
020476
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 231-5
020476
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
020476
020476
* Sun Jan 24 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@bupkis> - 231-4
020476
- Bugfixes for seek_monotonic and Python 2 compat
020476
020476
* Sun Nov 15 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 231-3
020476
- Split out doc subpackage (#1242619)
020476
- Do not allow installation of python-systemd in different versions
020476
020476
* Sat Nov 07 2015 Robert Kuska <rkuska@redhat.com> - 231-2
020476
- Rebuilt for Python3.5 rebuild
020476
020476
* Tue Oct 27 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 231-1
020476
- Update to latest version
020476
020476
* Mon Jul  6 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 230-1
020476
- Initial packaging