%define glib2_version 2.48.0
%define pango_version 1.40.0
%define gtk3_version 3.20.0
%define dbus_glib_version 0.100
%define dbus_version 1.6.4
%define libnotify_version 0.7

%define po_package gnome-session-3.0

%define _unpackaged_files_terminate_build 1

Summary: GNOME session manager
Summary(ja): GNOME セッションマネージャ
Name: gnome-session
Version: 3.30.1
Release: 1%{?_dist_release}
URL: http://www.gnome.org/
License: GPLv2+ 
Group: User Interface/Desktops

Source0: http://ftp.gnome.org/pub/GNOME/sources/gnome-session/3.30/%{name}-%{version}.tar.xz
Source1: vine-default-session
Source2: gnome.desktop 

Patch0:	gnome-session-3.14.0-hardware-compatibility.patch
Patch1: gnome-session-3.3.92-nv30.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=772421
Patch4: 0001-check-accelerated-gles-Use-eglGetPlatformDisplay-EXT.patch

# patch for Vine
Patch1000: gnome-session-3.18.1.2-ignore-gsm-fail.patch
Patch1001: 0001-meson-allow-usage-of-elogind.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: meson
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: pango-devel >= %{pango_version}
BuildRequires: gtk2-devel >= %{gtk2_version}
BuildRequires: dbus-devel >= %{dbus_version}
BuildRequires: dbus-glib-devel >= %{dbus_glib_version}
BuildRequires: libnotify-devel >= %{libnotify_version}
BuildRequires: gnome-desktop3-devel
BuildRequires: librsvg2-devel
BuildRequires: usermode
BuildRequires: startup-notification-devel
BuildRequires: libSM-devel
BuildRequires: libXtst-devel
BuildRequires: xorg-x11-xtrans-devel
BuildRequires: json-glib-devel
BuildRequires: desktop-file-utils
BuildRequires: autoconf
BuildRequires: gnome-common
BuildRequires: elogind-devel
BuildRequires: mesa-libGLES-devel
BuildRequires: xmlto

Conflicts: gdm < 2.4.0.7
Requires: vine-backgrounds >= 3.8
Requires: control-center
Requires: gsettings-desktop-schemas

Vendor: Project Vine
Distribution: Vine Linux

%description
gnome-session manages a GNOME desktop session. It starts up the other core 
GNOME components and handles logout and saving the session.


%prep
%autosetup -p1

%build

%meson \
  -Dsession_selector=true \
  -Dsystemd=false \
  -Dsystemd_journal=false \
  -Delogind=true

%meson_build

%install
rm -rf $RPM_BUILD_ROOT
%meson_install

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/xsessions/
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_datadir}/xsessions/

#/bin/rm $RPM_BUILD_ROOT%{_datadir}/gnome/default.session
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/gnome/
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/gnome/default.session

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gnome/autostart

cp %{buildroot}%{_docdir}/gnome-session/dbus/gnome-session.html ./
rm -rf %{buildroot}%{_docdir}/gnome-session

# remove gnome default splash screen
#rm -rf $RPM_BUILD_ROOT%{_datadir}/pixmaps/splash/*
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps/splash

# remove wayland-session
rm -rf $RPM_BUILD_ROOT%{_datadir}/wayland-sessions

#
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache

%find_lang %{po_package}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun
/sbin/ldconfig
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:

%posttrans
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f %{po_package}.lang
%defattr(-,root,root)
%license COPYING
%doc AUTHORS ChangeLog NEWS README gnome-session.html
%{_sysconfdir}/xdg/autostart
%{_bindir}/*
%{_libexecdir}/gnome-session-binary
%{_libexecdir}/gnome-session-check-accelerated
%{_libexecdir}/gnome-session-check-accelerated-gl-helper
%{_libexecdir}/gnome-session-check-accelerated-gles-helper
%{_libexecdir}/gnome-session-failed
%{_datadir}/GConf/gsettings/gnome-session.convert
%{_datadir}/glib-2.0/schemas/org.gnome.SessionManager.gschema.xml
%{_datadir}/gnome
%{_datadir}/gnome-session/*.ui
%{_datadir}/gnome-session/hardware-compatibility
%{_datadir}/gnome-session/sessions/*
%{_datadir}/xsessions/*
%dir %{_datadir}/pixmaps/splash
%{_mandir}/man*/*


%changelog
* Sat Dec 29 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.30.1-1
- new upstream release.
- added Patch1001 to support elogind.
- imported Patch1 and 4 from rawhide.

* Sun Jul 17 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.2-1
- new upstream release

* Mon Nov 16 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.1.2-2
- add Patch1000 (gnome-session-3.18.1.2-ignore-gsm-fail.patch)

* Sun Nov 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.1.2-1
- new upstream release

* Sat Apr 04 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.0-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.0-1
- new upstream release
- add Patch0 (gnome-session-3.14.0-hardware-compatibility.patch)
- remove BuildRequires: pangox-compat-devel

* Sun Sep 21 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.1-2
- remove BuildRequires: libupower09-devel

* Sun Apr 20 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.1-1
- new upstream release

* Sat Apr 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.0-1
- new upstream release
- update Patch0 (gnome-session-3.12.0-hardware-compatibility.patch)
- change BuildRequires: libupower09-devel instead of upower-devel

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1-2
- rebuild with VineSeed environment

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1-1
- new upstream release

* Sun Aug 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.4-1
- new upstream release

* Sat May 18 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.2.1-1
- new upstream release

* Sun Apr 21 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.1-1
- new upstream release
- update Patch0 (gnome-session-3.8.0-hardware-compatibility.patch)
- add BuildRequires: gnome-desktop3-devel

* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-1
- new upstream release

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.1-1
- new upstream release

* Sat Oct 06 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.0-1
- new upstream release
- remove BuildRequires: GConf2-devel
- add BuildRequires: pangox-compat-devel
- add Patch0 (gnome-session-3.6.0-hardware-compatibility.patch)

* Tue Jun 05 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2.1-1
- new upstream release
- add BuildRequires: xorg-x11-xtrans-devel

* Sun May 20 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
- new upstream release

* Sun Apr 22 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.1-1
- new upstream release

* Fri Oct 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.1-1
- new upstream release

* Thu Sep 29 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.92-1
- new upstream release
- add BuildRequires: libXtst-devel

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.90-1
- new upstream release
- add BuildRequires: json-glib-devel

* Sun Aug 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.5-1
- new upstream release

* Mon Aug 15 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.3-1
- new upstream release
- add BuildRequires: librsvg2-devel
- add Requires: gsettings-desktop-schemas

* Sat Nov 20 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.1-1
- new upstream release

* Sat Nov 06 2010 Yasumichi Akahoshi <yasumichi@vinelinux.org> 2.32.0-2
- update translation.

* Sun Oct 03 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.0-1
- new upstream release
- remove BuildRequires: libgnome-devel, libgnomeui-devel

* Tue Jun 29 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.2-1
- new upstream release

* Sun Apr 11 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.0-1
- new upstream release
- remove BuildRequires: gnome-keyring
- change BuildRequires: DeviceKit-power-devel -> upower-devel
- add BuildRequires: startup-notification-devel, libSM-devel, desktop-file-utils

* Sat Oct 31 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.28.0-1
- new upstream release
- added BR: DeviceKit-power-devel
- removed BR: PolicyKit-gnome-devel

* Sat Jul 04 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.2-1
- new upstream release

* Sat Apr 18 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.26.1-1
- new upstream release
- added BuildRequires: PolicyKit-gnome-devel

* Mon Mar 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.0-1
- new upstream release

* Mon Jan 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.24.3-1
- new upstream release

* Tue Oct 28 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.24.1-1
- new upstream release

* Wed Oct 22 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.24.0-2
- add patch5,6,7,8 from upstream/fedora
- remove gnome-volume-manager from vine-default-session

* Wed Sep 24 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.24.0-1
- new upstream release

* Sun Jun  1 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.22.2-1
- new upstream release

* Sat Apr 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.22.1.1-1vl5
- new upstream release

* Mon Mar 31 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.22.0-1vl5
- new upstream release
- updated Patch100

* Wed Jan  9 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.20.3-0vl1
- new upstream release

* Wed Jul  4 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.18.3-0vl1
- new upstream release

* Fri May 11 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.18.0-0vl2
- add BuildRequires: control-center-devel

* Sat Apr 28 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.18.0-0vl1
- new upstream release

* Thu Sep 21 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.14.3-0vl1
- new upstream release
- remove default gnome-splash.png, use our splash.
- add Requires: vine-backgrounds >= 3.8

* Sat Jun  3 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.2-0vl1
- new upstream release

* Fri Apr 14 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.14.1-0vl1
- new upstream release

* Tue Mar 14 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.14.0-0vl1
- new upstream release

* Tue Mar 07 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.13.92-0vl1
- new upstream release

* Mon Sep 19 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.12.0-0vl1
- new upstream release

* Thu Aug 04 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.11.90-0vl1
- new upstream release

* Mon Mar 21 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.10.0-0vl1
- new upstream version

* Sun Nov 07 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.1-0vl1
- new upstream release

* Sun Oct 17 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.2-0vl1
- new upstream release

* Sun Oct 17 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.2-0vl2
- rebuild with new environment

* Fri Jan 30 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.4.2-0vl1
- new upstream release

* Thu Sep 11 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.0-0vl1
- new upstream release
- remove old gdm session file.

* Fri Sep 05 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.3.90-0vl1
- new upstream release

* Wed Sep 03 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.3.7-0vl1
- new upstream release

* Tue Apr 29 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.1-0vl1
- new upstream release
- import patch6,8 from rawhide release

* Wed Jan 22 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.0.1-0vl1
- new upstream release

* Tue Jan 21 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.0-0vl1
- new upstream release

* Fri Jan 10 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.90-0vl1
- new upstream release

* Thu Dec 26 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.5-0vl1
- new upstream release

* Sun Dec 15 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.4-0vl1
- build for Vine Linux
- new upstream release from gnome-2.1.4

* Wed Nov 13 2002 Havoc Pennington <hp@redhat.com>
- 2.1.2

* Tue Sep  3 2002 Owen Taylor <otaylor@redhat.com>
- Up purge delay for session manager to 5 minutes to avoid problem 
  with openoffice.org timing out

* Wed Aug 28 2002 Havoc Pennington <hp@redhat.com>
- put gdm session in here, conflict with old gdm
- use DITHER_MAX for dithering to make splash screen look good in 16
  bit

* Tue Aug 27 2002 Havoc Pennington <hp@redhat.com>
- fix missing icons and misaligned text in splash

* Fri Aug 23 2002 Tim Waugh <twaugh@redhat.com>
- Fix login sound disabling (bug #71664).

* Wed Aug 14 2002 Havoc Pennington <hp@redhat.com>
- put rhn applet in default session

* Wed Aug 14 2002 Havoc Pennington <hp@redhat.com>
- fix the session file, should speed up login a lot
- put magicdev in default session

* Thu Aug  8 2002 Havoc Pennington <hp@redhat.com>
- 2.0.5 with more translations

* Tue Aug  6 2002 Havoc Pennington <hp@redhat.com>
- 2.0.4
- remove gnome-settings-daemon from default session

* Wed Jul 31 2002 Havoc Pennington <hp@redhat.com>
- 2.0.3
- remove splash screen, require redhat-artwork instead

* Wed Jul 24 2002 Owen Taylor <otaylor@redhat.com>
- Set GTK_RC_FILES so we can change the gtk1 theme

* Tue Jul 16 2002 Havoc Pennington <hp@redhat.com>
- pass --with-halt-command=/usr/bin/poweroff
  --with-reboot-command=/usr/bin/reboot

* Tue Jun 25 2002 Owen Taylor <otaylor@redhat.com>
- Version 2.0.1, fixing missing po files

* Wed Jun 19 2002 Havoc Pennington <hp@redhat.com>
- put in new default session with pam-panel-icon
- disable schema install in make install, fixes rebuild failure.

* Sun Jun 16 2002 Havoc Pennington <hp@redhat.com>
- rebuild with new libraries

* Thu Jun 13 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Thu Jun 13 2002 Havoc Pennington <hp@redhat.com>
- add fix from Nalin to build require usermode

* Tue Jun 11 2002 Havoc Pennington <hp@redhat.com>
- 2.0.0

* Mon Jun 10 2002 Havoc Pennington <hp@redhat.com>
- install the schemas, so we get a logout dialog and splash
- put in the splash from 7.3

* Sun Jun 09 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Sun Jun 09 2002 Havoc Pennington <hp@redhat.com>
- rebuild in new environment, require newer gtk2

* Sun Jun  9 2002 Havoc Pennington <hp@redhat.com>
- remove obsoletes/provides gnome-core

* Fri Jun 07 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Wed Jun  5 2002 Havoc Pennington <hp@redhat.com>
- 1.5.21

* Sun May 26 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Tue May 21 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Tue May 21 2002 Havoc Pennington <hp@redhat.com>
- 1.5.19
- add more build reqs to chill out build system
- provide gnome-core

* Fri May  3 2002 Havoc Pennington <hp@redhat.com>
- obsolete gnome-core
- 1.5.18

* Fri Apr 19 2002 Havoc Pennington <hp@redhat.com>
- default to metacity

* Tue Apr 16 2002 Havoc Pennington <hp@redhat.com>
- Initial build.


