File magnus.spec of Package magnus
#
# spec file for package magnus
#
# Copyright (c) 2022 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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
%define _name Magnus
Name: magnus
Version: 1.0.3
Release: 0
Summary: Very simple screen magnifier
License: MIT
Group: System/GUI/Other
URL: https://github.com/stuartlangridge/magnus
Source0: https://github.com/stuartlangridge/magnus/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}-rpmlintrc
BuildArch: noarch
BuildRequires: python-rpm-macros
BuildRequires: fdupes
BuildRequires: mate-icon-theme
BuildRequires: pkgconfig
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(keybinder-3.0)
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module distutils-extra}
Requires: girepository-1_0
Requires: mate-icon-theme
Requires: python-gobject
Requires: python-setproctitle
Requires: typelib(GdkPixbuf) = 2.0
Requires: typelib(Gtk) = 3.0
Requires: typelib(Keybinder) = 3.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Provides: magnus = %{version}-%{release}
Obsoletes: magnus < %{version}-%{release}
%endif
# No translations yet.
#Recommends: magnus-lang
%python_subpackages
%description
Magnus is a simple screen magnifying glass. It nicely integrates
with X11 desktops like MATE or Xfce (probably with others not
named here, too).
Visually impaired users may find this tool helpful for zooming
into certain screen areas in order to improve
readability/visibility of fonts, icons and other data.
%package -n magnus-common
Summary: Common files for %{name}
%description -n magnus-common
Magnus is a simple screen magnifying glass. It nicely integrates
with X11 desktops like MATE or Xfce (probably with others not
named here, too).
Visually impaired users may find this tool helpful for zooming
into certain screen areas in order to improve
readability/visibility of fonts, icons and other data.
This package contains common files for magnus.
# No translations provided currently.
#%%lang_package -n magnus
%prep
%setup -q
%build
%python_build
%install
%python_install
# Don't package the setup.py (or anything related).
%python_expand rm -f %{buildroot}/%{$python_sitelib}/setup.py
%python_compileall
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/magnus
%python_clone -a %{buildroot}%{_mandir}/man1/magnus.1
# No translations yet.
#%%find_lang magnus
# Disabled, package does not provide tests yet.
#%%check
#%%pytest_arch
%post
%{python_install_alternative magnus magnus.1%{ext_man} }
%postun
%{python_uninstall_alternative magnus}
%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/magnus
%python_alternative %{_mandir}/man1/magnus.1%{ext_man}
%{python_sitelib}/%{_name}-%{version}*-info
%files -n magnus-common
%license LICENSE
%doc README.md
%config %{_sysconfdir}/xdg/autostart/%{name}-autostart.desktop
%{_datadir}/applications/%{name}.desktop
# No translations yet.
#%%files -n magnus-lang -f magnus.lang
%changelog