File notion.spec of Package notion

#
# spec file for package notion
#
# Copyright (c) 2018 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/
#


%define maj_version 3
%define day_version 2017050501
%define pkg_version %{maj_version}-%{day_version}
Name:           notion
Version:        %{maj_version}+%{day_version}
Release:        0
Summary:        Free Tiling Tabbed Window Manager
License:        LGPL-2.1+
Group:          System/GUI/Other
Url:            http://notion.sourceforge.net/
Source:         https://github.com/raboof/%{name}/archive/%{maj_version}-%{day_version}.tar.gz#/%{name}-%{pkg_version}.tar.gz
Source1:        notion.desktop
BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  pkgconfig
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 -n "%{name}-%{pkg_version}"

%build
make %{?_smp_mflags}

%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
%doc CHANGELOG LICENSE
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/*.lua
%{_docdir}/notion/README.md
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_datadir}/%{name}
%{_mandir}/man1/*.1*
%{_datadir}/xsessions/%{name}.desktop

%changelog