%bcond_with systemd

Summary:	GNOME Flashback session and helper application
Summary(ja):	GNOMEフラッシュバックセッション及びヘルパーアプリケーション
Name:		gnome-flashback
Version:	3.36.3
Release:	1%{?_dist_release}%{?with_systemd:.systemd}

Vendor:		Project Vine
Distribution:	Vine Linux

License:	GPLv3
URL:		https://wiki.gnome.org/Projects/GnomeFlashback
%global		shortver %(echo %{version} | sed -e 's/\.[0-9]*$//')
Source0:	https://download.gnome.org/sources/%{name}/%{shortver}/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: glib2-devel
BuildRequires: gettext-devel
BuildRequires: gtk3-devel
BuildRequires: gdk-pixbuf2-devel
BuildRequires: gnome-desktop3-devel
BuildRequires: gnome-panel-devel
BuildRequires: libcanberra-gtk3-devel
BuildRequires: gsettings-desktop-schemas-devel
BuildRequires: polkit-devel
BuildRequires: ibus-devel
BuildRequires: upower-devel
BuildRequires: gnome-bluetooth-devel
BuildRequires: libXrandr-devel
BuildRequires: libXxf86vm-devel
BuildRequires: libxcb-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXi-devel
BuildRequires: gdm-devel
BuildRequires: pango-devel
BuildRequires: libxkbfile-devel
BuildRequires: xkeyboard-config
BuildRequires: libXfixes-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: alsa-lib-devel
BuildRequires: pam-devel
%if %{with systemd}
BuildRequires: systemd-devel
%else
BuildRequires: elogind-devel
%endif

Requires(posttrans,postun): desktop-file-utils
Requires(posttrans,postun): glib2

Requires: metacity
Requires: gnome-panel
Requires: gnome-applets
Requires: gnome-session

%description
Gnome Flashback is a session for Gnome 3 which was initially called
"Gnome Fallback", and shipped as a stand-alone session. It provides
a similar user experience to the Gnome 2.x series sessions.
The differences to the Mate project is that Gnome Flashback uses Gtk+3
 and tries to follow the current Gnome development by integrating
recent changes of the Gnome libraries. 


%prep
%setup -q

%if !%{with systemd}
sed -i \
	-e 's|systemd/sd-journal\.h|elogind/sd-journal\.h|' \
	./gnome-flashback/libdesktop/gf-utils.c

sed -i \
	-e 's|systemd/sd-login\.h|elogind/sd-login\.h|' \
	./gnome-flashback/libscreensaver/gf-screensaver-utils.c \
	./gnome-flashback/libscreensaver/gf-unlock-dialog.c 

sed -i \
	-e 's/libsystemd/libelogind/g' \
	./configure.ac

autoreconf -vif
%endif


%build
%configure \
	--disable-static \
%if %{with systemd}
	--enable-systemd-session=yes \
%else
	--enable-systemd-session=no \
%endif
	--with-compiz-session=no

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}

%find_lang %{name} --with-gnome


%clean
rm -rf $RPM_BUILD_ROOT


%postun
if [ $1 -eq 0 ]; then
  update-desktop-database -q &> /dev/null ||:
  glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:
fi

%posttrans
update-desktop-database -q &> /dev/null ||:
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f %{name}.lang
%defattr(-,root,root,-)
%license COPYING
%doc README NEWS
%{_sysconfdir}/xdg/autostart/gnome-flashback-clipboard.desktop
%{_sysconfdir}/xdg/autostart/gnome-flashback-nm-applet.desktop
%{_sysconfdir}/xdg/menus/gnome-flashback-applications.menu
%{_bindir}/%{name}
%dir %{_libdir}/gnome-panel
%dir %{_libdir}/gnome-panel/modules
%{_libdir}/gnome-panel/modules/system_indicators.so
%{_libexecdir}/gnome-flashback-clipboard
%{_libexecdir}/gnome-flashback-metacity
%{_datadir}/applications/gnome-flashback.desktop
%{_datadir}/desktop-directories/X-GNOME-Flashback-Settings-System.directory
%{_datadir}/desktop-directories/X-GNOME-Flashback-Settings.directory
%{_datadir}/glib-2.0/schemas/*
%{_datadir}/gnome-panel/layouts/gnome-flashback.layout
%{_datadir}/gnome-session/sessions/gnome-flashback-metacity.session
%{_datadir}/xsessions/gnome-flashback-metacity.desktop
%if %{with systemd}
%{_userunitdir}/*
%endif


%changelog
* Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.36.3-1
- new upstream release.

* Sun Sep 01 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.30.0-2
- rebuilt with tracker-2.2.2.

* Sun Dec 30 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.30.0-1
- new upstream release.

* Mon Jul 18 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.1-1
- new upstream release

