File notion.spec of Package notion

#
# spec file for package notion
#
# 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/
#


Name:           notion
Version:        4.0.1
Release:        0
Summary:        Free Tiling Tabbed Window Manager
License:        LGPL-2.1-or-later
Group:          System/GUI/Other
URL:            http://notion.sourceforge.net/
Source:         https://github.com/raboof/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        notion.desktop
BuildRequires:  cairo-devel
BuildRequires:  gcc
BuildRequires:  groff
BuildRequires:  make
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if 0%{?suse_version} > 1320
BuildRequires:  pkgconfig(lua) >= 5.1
%else
BuildRequires:  pkgconfig(lua)
%endif

%description
Notion is a tiling, tabbed window manager for the X window system:

* Tiling: you divide the screen into non-overlapping 'tiles'. Every
  window occupies one tile, and is maximized to it * Tabbing: a tile may
  contain multiple windows - they will be 'tabbed'* Static: most tiled
  window managers are 'dynamic', meaning they automatically resize and
  move around tiles as windows appear and disappear. Notion, by
  contrast, does not automatically change the tiling. You're in control.

Features include:
* Workspaces: each workspace has its own tiling
* Multihead: the mod_xinerama plugin provides very nice dual-monitor support
* RandR: mod_xrandr picks up changes in the xrandr configuration without the
  need for restarting Notion (read this, though)
* Extensibility: Notion can be extended with lua scripts. Browse through the
  scripts collection

%prep
%setup -q

%build
%make_build

%install
%make_install \
    PREFIX="%{_prefix}" \
    ETCDIR="%{_sysconfdir}/%{name}" \
    LIBDIR="%{_libdir}" \
    DOCDIR="%{_docdir}/%{name}"

install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/xsessions/%{name}.desktop"

%suse_update_desktop_file "%{buildroot}%{_datadir}/xsessions/%{name}.desktop"

%find_lang %{name}
LF="$PWD/%{name}.lang"
pushd "%{buildroot}%{_mandir}"
/bin/ls -1d */man1 | while read x; do
    l="${x%%/*}"
    l="${l%%/*}"
    echo "%doc %dir %lang($l) %{_mandir}/${l}" >>"$LF"
    echo "%doc %dir %lang($l) %{_mandir}/${l}/man1" >>"$LF"
done
/bin/ls -1 */man1/*.1* | while read x; do
    l="${x%%/*}"
    l="${l%%/*}"
    f="${x##*/}"
    echo "%doc %lang($l) %{_mandir}/${l}/man1/$f*" >>"$LF"
done
popd

%files -f %{name}.lang
%dir %{_sysconfdir}/%{name}
%doc LICENSE
%config %{_sysconfdir}/%{name}/*.lua
%{_docdir}/notion/AUTHORS
%{_docdir}/notion/CONTRIBUTING.md
%{_docdir}/notion/README.md
%{_bindir}/%{name}
%{_bindir}/notionflux
%{_libdir}/%{name}
%{_datadir}/%{name}
%{_mandir}/man1/*.1*
%{_datadir}/xsessions/%{name}.desktop

%changelog