File arandr.spec of Package arandr

#
# spec file for package arandr
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
# Copyright (c) 2013 B1 Systems GmbH, Vohburg, Germany <seife+obs@b1-systems.com>
#
# 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/
#


Name:           arandr
Version:        0.1.9
Release:        0
Summary:        Visual Front End for XRandR
License:        GPL-3.0
Group:          System/X11/Utilities
Url:            http://christian.amsuess.com/tools/arandr/
Source:         http://christian.amsuess.com/tools/arandr/files/arandr-%{version}.tar.gz
Patch1:         arandr-fix_desktop_icon.patch
BuildRequires:  desktop-data-openSUSE
BuildRequires:  hicolor-icon-theme
BuildRequires:  make
BuildRequires:  python-devel
BuildRequires:  update-desktop-files
Requires:       python-gtk
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%if 0%{?suse_version} >= 1140
BuildRequires:  python-gtk-devel
%else
BuildRequires:  python-gtk
%endif
%if 0%{?suse_version} >= 1210
BuildRequires:  python-docutils
%else
BuildRequires:  docutils
%endif
%if 0%{?suse_version} >= 1220
Requires:       xrandr
%else
Requires:       xorg-x11
%endif

%description
ARandR is designed to provide a simple visual front end for XRandR. Relative
monitor positions are shown graphically and can be changed in a drag-and-drop
way.

%prep
%setup -q
%patch1

%build
python ./setup.py build

%install
python ./setup.py install \
    --prefix="%{_prefix}" \
    --root=%{buildroot} \
    --record-rpm=files.lst

perl -n -i -e 'print unless m,%{_datadir}/(locale|applications),' files.lst
perl -n -i -e 'print unless m,%{_bindir},' files.lst

%suse_update_desktop_file -r "%{name}" Settings DesktopSettings

%find_lang "%{name}"

chmod 0755 "%{buildroot}%{_bindir}"/*

%files -f "%{name}.lang" -f files.lst
%defattr(-,root,root)
%doc ChangeLog COPYING NEWS README TODO
%{_bindir}/arandr
%{_bindir}/unxrandr
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/arandr.1*
%{_mandir}/man1/unxrandr.1*

%changelog