LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File gnome-session-ubuntu.spec of Package gnome-session-ubuntu (Project GNOME:Ayatana)

# Written by: Xiao-Long Chen <chenxiaolong@cxl.epac.to>

# Partially based off of openSUSE 12.2's spec file

%define _ubuntu_rel 0ubuntu1

Name:		gnome-session
Version:	3.4.2.1
Release:	2.%{_ubuntu_rel}
License:	GPL-2.0+
Summary:	Session Tools for the GNOME Desktop
Url:		http://www.gnome.org/
Group:		System/GUI/GNOME
Source:		http://download.gnome.org/sources/gnome-session/3.4/gnome-session-%{version}.tar.xz

Source1:	opensuse_gnome
Source2:	opensuse_gnome.desktop

Source99:	https://launchpad.net/ubuntu/+archive/primary/+files/gnome-session_%{version}-%{_ubuntu_rel}.debian.tar.gz

# PATCH-FIX-UPSTREAM gnome-session-ice-auth-for-suid.patch hpj@novell.com -- Carries ICE auth over to other UIDs in this session using an env var.
Patch0:		opensuse_gnome-session-ice-auth-for-suid.patch

# PATCH-FIX-UPSTREAM gnome-session-kdm-support.patch hpj@novell.com -- Adds support for KDM logout commands.
Patch1:		opensuse_gnome-session-kdm-support.patch

# PATCH-FEATURE-OPENSUSE gnome-session-unblacklist-llvmpipe.patch badshah400@gmail.com -- Remove llvmpipe from blacklisted drivers to enable full gnome-shell session on virtual machines.
Patch2:		opensuse_gnome-session-unblacklist-llvmpipe.patch
Patch3:		openSUSE-gnome-session-unity.patch

BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	gnome-common
BuildRequires:	hicolor-icon-theme
BuildRequires:	intltool
BuildRequires:	translation-update-upstream
BuildRequires:	update-desktop-files

BuildRequires:	pkgconfig(dbus-glib-1)
BuildRequires:	pkgconfig(gconf-2.0)
BuildRequires:	pkgconfig(gl)
BuildRequires:	pkgconfig(glib-2.0)
BuildRequires:	pkgconfig(gtk+-3.0)
BuildRequires:	pkgconfig(ice)
BuildRequires:	pkgconfig(json-glib-1.0)
BuildRequires:	pkgconfig(libsystemd-daemon)
BuildRequires:	pkgconfig(libsystemd-login)
BuildRequires:	pkgconfig(polkit-gobject-1)
BuildRequires:	pkgconfig(sm)
BuildRequires:	pkgconfig(upower-glib)
BuildRequires:	pkgconfig(xau)
BuildRequires:	pkgconfig(xcomposite)
BuildRequires:	pkgconfig(xext)
BuildRequires:	pkgconfig(xrender)
BuildRequires:	pkgconfig(xtst)

Requires:	%{name}-core = %{version}-%{release}
Requires:	%{name}-default-session = %{version}-%{release}

Recommends:	%{name}-lang

%description
This package provides the basic session tools, like session management
functionality, for the GNOME Desktop.


%package default-session
Summary:	Session Manager for GNOME -- Default GNOME Session
Group:		System/GUI/GNOME

Requires:	%{name} = %{version}-%{release}
Requires:	gnome-settings-daemon
Requires:	gnome-shell

Recommends:	%{name}-fallback-session

%description default-session
This package contains the definition of the default GNOME session.


%package fallback-session
Summary:	Session Manager for GNOME -- Fallback GNOME Session
Group:		System/GUI/GNOME

Requires:	%{name} = %{version}-%{release}
Requires:	gnome-panel
Requires:	gnome-settings-daemon
Requires:	metacity
Requires:	notification-daemon

%description fallback-session
This package contains the definition of the fallback GNOME session, which is
used when the graphics are not hardware-accelerated.


%package unity-session
Summary:	Session Manager for GNOME -- Unity Session
Group:		System/GUI/GNOME

Requires:	%{name} = %{version}-%{release}
Requires:	gnome-settings-daemon
Requires:	unity

%description unity-session
This package contains the definition of the Unity session.


%package -n gnome2-look-and-feel
Summary:	GNOME Desktop with the GNOME 2 Look and Feel
Group:		System/GUI/GNOME

Requires:	%{name}-fallback-session

%description -n gnome2-look-and-feel
This package contains the definition to choose in the display manager a GNOME 3
session that looks and feels like GNOME 2.


%package core
Summary:	Session Manager for GNOME -- Minimal Version
Group:		System/GUI/GNOME

Requires:	ConsoleKit
Requires:	dbus-1-x11
Requires:	gsettings-desktop-schemas
Requires:	hicolor-icon-theme

%glib2_gsettings_schema_requires

%description core
This package contains a minimal version of gnome-session, that can be used for
specific cases. The gnome-session package is needed for a fully functional
GNOME desktop.


%lang_package


%prep
%setup -q

translation-update-upstream

# Apply openSUSE's patches
%patch0 -p1
%patch1 -p1
%patch2 -p1

# Apply Ubuntu's patches
tar zxvf '%{SOURCE99}'

# Disable patches
  # gnome-wm uses Debian's alternatives system (Fedora has it too, but other
  # packages need to use it)
    sed -i '/01_gnome-wm.patch/d' debian/patches/series
  # systemd should make these patches obsolete
    sed -i '/12_no_gdm_fallback.patch/d' debian/patches/series
    sed -i '/21_up_start_on_demand.patch/d' debian/patches/series
  # We're not Ubuntu, do not hide stuff
    sed -i '/20_hide_nodisplay.patch/d' debian/patches/series
  # Only Ubuntu uses apport
    sed -i '/96_no_catch_sigsegv.patch/d' debian/patches/series

# Fix patches
  # Needed because 01_gnome-wm.patch is disabled
    sed -i 's/gnome-wm/metacity/g' debian/patches/50_ubuntu_sessions.patch

for i in $(grep -v '#' debian/patches/series); do
  patch -Np1 -i "debian/patches/${i}"
done

#repatch OpenSUSE
%patch3 -p1

autoreconf -vfi


%build
%configure \
  --with-gtk=3.0 \
  --enable-systemd

make %{?_smp_mflags}


%install
%make_install

# Install startup script and session file
install -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/gnome
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome.desktop

# Install session file for GNOME Fallback (gnome2-look-and-feel)
install -m644 %{SOURCE2} \
  $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome2-look-and-feel.desktop
sed -i "s/^Exec=.*/Exec=gnome --session gnome-fallback/" \
  $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome2-look-and-feel.desktop

%suse_update_desktop_file session-properties X-SuSE-ControlCenter-Personal
%suse_update_desktop_file $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome.desktop
%suse_update_desktop_file -N "GNOME 2 Look and Feel" $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome2-look-and-feel.desktop

# Remove Ubuntu's session files for GNOME
rm -v $RPM_BUILD_ROOT%{_datadir}/gnome-session/sessions/gnome-classic.session
rm -v $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome-classic.desktop
rm -v $RPM_BUILD_ROOT%{_datadir}/xsessions/gnome-fallback.desktop

# /usr/lib/nux -> /usr/lib
sed -i 's,lib/nux,lib,' \
  $RPM_BUILD_ROOT%{_datadir}/gnome-session/sessions/ubuntu.session

%find_lang gnome-session-3.0 %{no_lang_C}


%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun


%post core
%glib2_gsettings_schema_post
%icon_theme_cache_post

%postun core
%glib2_gsettings_schema_postun
%icon_theme_cache_postun


%files
%defattr(-,root,root)
%{_bindir}/gnome
%{_bindir}/gnome-session-properties
%{_datadir}/applications/session-properties.desktop
%{_datadir}/icons/hicolor/*/apps/session-properties.*
%{_datadir}/gnome-session/session-properties.ui
%{_datadir}/xsessions/gnome.desktop
%{_mandir}/man1/gnome-session-properties.1%{ext_man}


%files default-session
%defattr(-,root,root)
%{_datadir}/gnome-session/sessions/gnome.session


%files fallback-session
%defattr(-,root,root)
%{_datadir}/gnome-session/sessions/gnome-fallback.session


%files unity-session
%defattr(-,root,root)
%{_datadir}/gnome-session/sessions/ubuntu.session
%{_datadir}/gnome-session/sessions/ubuntu-2d.session
%{_datadir}/xsessions/ubuntu.desktop
%{_datadir}/xsessions/ubuntu-2d.desktop


%files -n gnome2-look-and-feel
%defattr(-,root,root)
%{_datadir}/xsessions/gnome2-look-and-feel.desktop


%files core
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/gnome-session
%{_bindir}/gnome-session-quit
%{_libexecdir}/gnome-session-check-accelerated
%{_libexecdir}/gnome-session-check-accelerated-helper
%{_datadir}/GConf/gsettings/gnome-session.convert
%{_datadir}/glib-2.0/schemas/org.gnome.SessionManager.gschema.xml
%dir %{_datadir}/gnome-session/
%dir %{_datadir}/gnome-session/sessions/
%{_datadir}/gnome-session/gsm-inhibit-dialog.ui
%{_datadir}/gnome-session/hardware-compatibility
%{_mandir}/man1/gnome-session.1%{ext_man}
%{_mandir}/man1/gnome-session-quit.1%{ext_man}


%files lang -f gnome-session-3.0.lang


%changelog
* Fri Sep 14 2012 Xiao-Long Chen <chenxiaolong@cxl.epac.to> - 3.4.2.1-2.0ubuntu1
- Version 3.4.2.1
- Ubuntu release 0ubuntu1

* Wed Aug 22 2012 Xiao-Long Chen <chenxiaolong@cxl.epac.to> - 3.4.2.1-1.0ubuntu3.2.1.0ubuntu8
- Initial release
- Based on openSUSE 12.2's spec
- Version 3.4.2.1
- Refreshed patches for 3.4.1
- Ubuntu version 3.2.1
- Ubuntu release 0ubuntu8