File ayatana-webmail.spec of Package ayatana-webmail

#
# spec file for package ayatana-webmail
#
# Copyright (c) 2022-2023 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 http://bugs.opensuse.org/
#

# Compatibility with *SuSE 15.
%if 0%{suse_version} && 0%{suse_version} < 1550
%define python_compileall \
%{python_expand for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do \
  if [ -d $d ]; then \
    find $d -name '*.pyc' -delete; \
    $python -m compileall $d; \
    $python -O -m compileall $d; \
  fi; \
done \
} \
%{nil}
%endif

%define skip_python2  1

Name:             ayatana-webmail
Version:          23.10.13
Release:          0
Summary:          Webmail notifications and actions for any desktop
License:          GPL-3.0-only
Group:            System/GUI/Other
URL:              https://github.com/AyatanaIndicators/ayatana-webmail
Source0:          https://github.com/AyatanaIndicators/ayatana-webmail/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildArch:        noarch
BuildRequires:    python-rpm-macros
BuildRequires:    fdupes
# For directory owning.
BuildRequires:    hicolor-icon-theme
BuildRequires:    pkgconfig
BuildRequires:    pkgconfig(glib-2.0)
BuildRequires:    ayatana-indicator-messages
BuildRequires:    %{python_module setuptools}
BuildRequires:    %{python_module polib}
# For testing. Disabled, since tests are not yet provided.
# If re-enabling, remember to remove the percent escape.
#BuildRequires:   %%{python_module pytest}
Requires:         python-psutil
Requires:         ayatana-webmail-common
Requires:         ayatana-indicator-messages
Requires(post):   update-alternatives
Requires(postun): update-alternatives
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Provides:         ayatana-webmail = %{version}-%{release}
Obsoletes:        ayatana-webmail < %{version}-%{release}
%endif
Recommends:       ayatana-webmail-lang
%glib2_gsettings_schema_requires

%python_subpackages

%description
Ayatana Webmail is an application that integrates your webmail
into MATE, Xfce, LXDE and other environments.

It displays notifications about incoming mail, shows the number
of unread messages and displays subjects in the Messaging Menu.

The Launcher item also has a quicklist that provides quick access
to your mail folders. It also allows you to quickly compose a new
message.

Ayatana Webmail starts automatically, all you have to do is to
enter your accounts settings in a configuration dialog.

%package -n ayatana-webmail-common
Summary:          Common files for %{name}

%description -n ayatana-webmail-common
Ayatana Webmail is an application that integrates your webmail
into MATE, Xfce, LXDE and other environments.

It displays notifications about incoming mail, shows the number
of unread messages and displays subjects in the Messaging Menu.

The Launcher item also has a quicklist that provides quick access
to your mail folders. It also allows you to quickly compose a new
message.

Ayatana Webmail starts automatically, all you have to do is to
enter your accounts settings in a configuration dialog.

This package contains common files for ayatana-webmail.

%lang_package -n ayatana-webmail

%prep
%setup -q

# Remove hashbangs on scripts installed into sitelib.
find 'ayatanawebmail' -type 'f' -iname '*.py' -exec sed -i -e '0,/^\s*#!\s*\/.*$/d' '{}' '+'

# Also remove executable flags.
find 'ayatanawebmail' -type 'f' -iname '*.py' -exec chmod -x '{}' '+'
chmod -x 'COPYING' 'README.md'
for base in 'etc' 'usr/share'; do
  find "data/${base}" -type 'f' -exec chmod -x '{}' '+'
done

%build
%python_build

%install
%python_install
%python_compileall
%python_clone -a %{buildroot}%{_bindir}/ayatana-webmail
%python_clone -a %{buildroot}%{_bindir}/ayatana-webmail-clear
%python_clone -a %{buildroot}%{_bindir}/ayatana-webmail-reset
%python_clone -a %{buildroot}%{_bindir}/ayatana-webmail-settings
%python_clone -a %{buildroot}%{_bindir}/ayatana-webmail-url
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%find_lang ayatanawebmail

# Disabled, package does not provide tests yet.
#%%check
#%%pytest_arch

%post
%{python_install_alternative ayatana-webmail ayatana-webmail-clear ayatana-webmail-reset ayatana-webmail-settings ayatana-webmail-url }

%postun
%{python_uninstall_alternative ayatana-webmail }

%files %{python_files}
%license COPYING
%python_alternative %{_bindir}/ayatana-webmail
%python_alternative %{_bindir}/ayatana-webmail-clear
%python_alternative %{_bindir}/ayatana-webmail-reset
%python_alternative %{_bindir}/ayatana-webmail-settings
%python_alternative %{_bindir}/ayatana-webmail-url
%{python_sitelib}/ayatanawebmail
%{python_sitelib}/ayatanawebmail-%{version}*-info

%files -n ayatana-webmail-common
%license COPYING
%doc AUTHORS NEWS README.md
%config %{_sysconfdir}/xdg/autostart/%{name}-autostart.desktop
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/glib-2.0/schemas/org.ayatana.webmail.gschema.xml
%{_datadir}/applications/ayatana-webmail.desktop

%files -n ayatana-webmail-lang -f ayatanawebmail.lang

%changelog
openSUSE Build Service is sponsored by