File fvwm3.spec of Package fvwm3

# spec file for package fvwm3

Name:           fvwm3
Version:        1.1.0
Release:        0
Summary:        The F Virtual Window Manager Version 3
License:        GPL-2.0-or-later
Group:          System/GUI/Other
Source1:        %{name}.desktop
Source2:        system.fvwm2rc
Source3:        fvwm_icons.tar.bz2
Source4:        openSUSE.xpm
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  go
BuildRequires:  libpng-devel
BuildRequires:  libxslt-tools
BuildRequires:  pkgconfig
BuildRequires:  python3-base
BuildRequires:  rubygem(asciidoctor)
BuildRequires:  readline-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(fribidi)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(sm)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xft)
BuildRequires:  pkgconfig(xpm)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xrender)
BuildRequires:  pkgconfig(xt)
BuildRequires:  pkgconfig(libevent)
BuildRequires:  pkgconfig(xt)

Requires:       desktop-data
Requires:       mktemp
Requires:       wallpaper-branding
Requires:       xdg-menu
Requires:       xli
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides:       %{name} = %{version}
Provides:       windowmanager
Provides:       xpmroot
Obsoletes:      fvwm
Obsoletes:      fvwm2
Obsoletes:      xpmroot

%define _enable_mandoc --enable-mandoc --enable-golang

FVWM is a virtual desktop window manager for the X Window System.

FVWM is intended to have a small memory footprint but a rich feature
set, to be extremely customizable and extendible, and to be very
compatible with the Motif Window Manager (mwm).

%setup -q -n %{name}-%{version}
mkdir icons
tar -C icons -j -x -v -f %{SOURCE3}
cp %{SOURCE4} icons

autoreconf -fvi
%configure \
    --sysconfdir=%{_sysconfdir}/X11/fvwm3 \
    --libexecdir=%{_prefix}/lib/X11/fvwm3 \
    --with-imagepath=%{_datadir}/X11/fvwm3/pixmaps:%{_datadir}/X11/fvwm3/bitmaps:%{_datadir}/pixmaps:%{_datadir}/wallpapers \
make %{?_smp_mflags}


# missed main manual page
install -m 644 doc/%{name}.1 %{buildroot}%{_mandir}/man1

# default config
install -d -m 755 %{buildroot}%{_sysconfdir}/X11/fvwm3
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/X11/fvwm3/system.fvwm2rc

rm -vf docs/Makefile*
install -d -m 755 docu-module
for i in $(find -name "README*" -not -name "*,v" -and -not -name "*.orig")
	TMPDIR=$(dirname ${i#./})
	if [ "x$TMPDIR" = "x." ]; then
		install -m 644 $i docu-module/${i#./}
		install -m 644 $i docu-module/README.$(basename "$TMPDIR")

# forbidden links
pushd %{buildroot}/
	find . -type l -printf '%%P %%l\n' | while read dst src
		case "$src" in
			rm -vf $dst
			ln -frsv $src $dst

# icons
install -d -m 755 %{buildroot}%{_datadir}/X11/%{name}/pixmaps
install -m 644 icons/* %{buildroot}%{_datadir}/X11/%{name}/pixmaps

# install kdm/gdm entry
install -m 0755 -d %{buildroot}%{_datadir}/xsessions/
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/xsessions/
# removing the useless README.vms file
rm -f  %{buildroot}/%{_docdir}/fvwm3/README.vms
%suse_update_desktop_file %{buildroot}%{_datadir}/xsessions/%{name}.desktop
%find_lang fvwm %{name}.lang
%find_lang FvwmScript %{name}.lang

%{_sbindir}/update-alternatives --install %{_datadir}/xsessions/default.desktop \
  default-xsession.desktop %{_datadir}/xsessions/fvwm3.desktop 20

[ -f %{_datadir}/xsessions/lxqt.desktop ] || %{_sbindir}/update-alternatives \
  --remove default-xsession.desktop %{_datadir}/xsessions/fvwm3.desktop

%files -f %{name}.lang
%license COPYING
%doc NEWS docu-module/*
%dir %{_sysconfdir}/X11/fvwm3
%config %{_sysconfdir}/X11/fvwm3/system.fvwm2rc
%dir %{_prefix}/lib/X11/fvwm3
%dir %{_datadir}/X11/fvwm3
%dir %{_datadir}/X11/fvwm3/pixmaps

openSUSE Build Service is sponsored by