File python-Radicale.spec of Package python-Radicale

#
# spec file for package python-Radicale
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-Radicale
Version:        3.0.5
Release:        0
Summary:        A Simple Calendar and Contact Server
License:        GPL-3.0-only
Group:          Development/Languages/Python
URL:            https://radicale.org/
Source:         https://files.pythonhosted.org/packages/source/R/Radicale/Radicale-%{version}.tar.gz
BuildRequires:  %{python_module defusedxml}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module passlib}
BuildRequires:  %{python_module python-dateutil >= 2.7.3}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module vobject >= 0.9.6}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-defusedxml
Requires:       python-passlib
Requires:       python-python-dateutil >= 2.7.3
Requires:       python-setuptools
Requires:       python-vobject >= 0.9.6
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch
%python_subpackages

%description
The Radicale Project is a complete CalDAV (calendar) and CardDAV (contact)
server solution.

Calendars and address books are available for both local and remote access,
possibly limited through authentication policies. They can be viewed and
edited by calendar and contact clients on mobile phones or computers.

%prep
%setup -q -n Radicale-%{version}
chmod -x radicale.wsgi

# add file encoding
sed '2i# -*- coding: utf-8 -*-' setup.py > setup.py.new
touch -r setup.py setup.py.new
mv setup.py.new setup.py

%build
%python_build

%install
%python_install
%fdupes %{buildroot}%{_prefix}

%python_clone -a %{buildroot}%{_bindir}/radicale

%post
%python_install_alternative radicale

%postun
%python_uninstall_alternative radicale

%files %{python_files}
%license COPYING
%doc config DOCUMENTATION.md NEWS.md radicale.wsgi README.md rights
%{python_sitelib}/Radicale-%{version}-py%{python_version}.egg-info
%{python_sitelib}/radicale
%python_alternative %{_bindir}/radicale

%changelog
openSUSE Build Service is sponsored by