[xmonad/f12/master] backport new session desktop file and xmonad-start

Jens Petersen petersen at fedoraproject.org
Tue Sep 28 10:37:07 UTC 2010


commit 5a2bb2449f83b434eb8730da2e69d73d773be1d0
Author: Jens Petersen <petersen at redhat.com>
Date:   Tue Sep 28 20:36:15 2010 +1000

    backport new session desktop file and xmonad-start
    
    - add application desktop file for gnome-session to find xmonad
    - move display of manpage for new users from xmonad.hs to xmonad-start
    - drop skel file and dont create ~/.xmonad by default
    - update to latest macros

 README.fedora               |   29 ++++++++
 xmonad-config-manpage.patch |   13 ----
 xmonad-session.desktop      |   11 +++
 xmonad-start                |    4 +-
 xmonad.desktop              |   18 +++---
 xmonad.spec                 |  165 ++++++++++++-------------------------------
 6 files changed, 96 insertions(+), 144 deletions(-)
---
diff --git a/README.fedora b/README.fedora
new file mode 100644
index 0000000..b512111
--- /dev/null
+++ b/README.fedora
@@ -0,0 +1,29 @@
+For documentation and examples see:
+- xmonad manpage
+- /usr/share/doc/xmonad-$version/xmonad.hs (full default basic configuration)
+- /usr/share/doc/ghc/html/libraries/xmonad-contrib-$version/index.html
+and online:
+- Xmonad wiki: http://www.haskell.org/haskellwiki/Xmonad
+- http://hackage.haskell.org/packages/archive/xmonad-contrib/latest/doc/html/XMonad-Doc.html
+  (detailed configuration information and examples)
+- http://xmonad.org/ website
+
+To make use of extensions, including adding Desktop support,
+you need to install ghc-xmonad-contrib-devel.
+
+= EWMH Desktop support =
+xmonad does not work well with desktop environment panels out of the box.
+See:
+- /usr/share/doc/ghc/html/libraries/xmonad-contrib-$version/XMonad-Config-Desktop.html
+- http://haskell.org/haskellwiki/Xmonad/Basic_Desktop_Environment_Integration
+for how to setup desktop support.
+
+== GNOME ==
+You can override xmonad as your GNOME default window manager with:
+
+$ gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
+
+= Bluetile =
+New users may find the Bluetile window manager built
+on top of xmonad-contrib a gentler introduction to xmonad
+and tiling.
diff --git a/xmonad-session.desktop b/xmonad-session.desktop
new file mode 100644
index 0000000..799d921
--- /dev/null
+++ b/xmonad-session.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=xmonad
+Comment=Tiling window manager
+Exec=xmonad-start
+Terminal=False
+TryExec=xmonad-start
+
+[Window Manager]
+SessionManaged=true
+# vi: encoding=utf-8
diff --git a/xmonad-start b/xmonad-start
index f4f3472..0f6a4e9 100644
--- a/xmonad-start
+++ b/xmonad-start
@@ -1,8 +1,8 @@
 #!/bin/sh
 
+# display the manpage if there is no user configuration
 if [ ! -d ~/.xmonad ]; then
-  mkdir -p ~/.xmonad
-  cp /etc/skel/.xmonad/xmonad.hs ~/.xmonad/
+  xterm -e man xmonad &
 fi
 
 exec xmonad
diff --git a/xmonad.desktop b/xmonad.desktop
index 799d921..b874e04 100644
--- a/xmonad.desktop
+++ b/xmonad.desktop
@@ -1,11 +1,11 @@
 [Desktop Entry]
+Type=Application
 Encoding=UTF-8
-Name=xmonad
-Comment=Tiling window manager
-Exec=xmonad-start
-Terminal=False
-TryExec=xmonad-start
-
-[Window Manager]
-SessionManaged=true
-# vi: encoding=utf-8
+Name=XMonad
+Exec=xmonad
+NoDisplay=true
+# name we put on the WM spec check window
+X-GNOME-WMName=Xmonad
+X-GNOME-Autostart-Phase=WindowManager
+X-GNOME-Provides=windowmanager
+X-GNOME-Autostart-Notify=true
diff --git a/xmonad.spec b/xmonad.spec
index 1c91b41..c3aca52 100644
--- a/xmonad.spec
+++ b/xmonad.spec
@@ -1,118 +1,74 @@
-%global X11_minver 1.4.6.1
+%global pkg_name xmonad
+
+%global common_summary Haskell %{pkg_name} library
+
+%global common_description xmonad is a tiling window manager for X. Windows are arranged\
+automatically to tile the screen without gaps or overlap, maximising\
+screen use. All features of the window manager are accessible from\
+the keyboard: a mouse is strictly optional. xmonad is written and\
+extensible in Haskell. Custom layout algorithms, and other\
+extensions, may be written by the user in config files. Layouts are\
+applied dynamically, and different layouts may be used on each\
+workspace. Xinerama is fully supported, allowing windows to be tiled\
+on several screens.
+
+%global ghc_pkg_deps ghc-mtl-devel, ghc-X11-devel
 
-%bcond_without doc
-%bcond_without prof
+%bcond_without shared
+%bcond_without hscolour
 
-# ghc does not emit debug information
+# debuginfo is not useful for ghc
 %global debug_package %{nil}
 
 Name:           xmonad
 Version:        0.9
-Release:        4%{?dist}
+Release:        4.1%{?dist}
 Summary:        A tiling window manager
 
 Group:          User Interface/X
 License:        BSD
 URL:            http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
 Source0:        http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
-Source1:        xmonad.desktop
-Source2:        xmonad-start
-Patch0:         xmonad-config-manpage.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source1:        xmonad-session.desktop
+Source2:        xmonad-start
+Source3:        xmonad.desktop
+Source4:        README.fedora
 # fedora ghc archs:
-ExclusiveArch: %{ix86} x86_64 ppc alpha
-BuildRequires:  ghc, ghc-rpm-macros
-BuildRequires:  ghc-X11-devel >= %{X11_minver}
-%if %{with doc}
-BuildRequires:  ghc-doc
-BuildRequires:  ghc-X11-doc >= %{X11_minver}
-%endif
-%if %{with prof}
-BuildRequires:  ghc-prof
-BuildRequires:  ghc-X11-prof >= %{X11_minver}
+ExclusiveArch:  %{ix86} x86_64 ppc alpha
+BuildRequires:  ghc, ghc-doc, ghc-prof
+BuildRequires:  ghc-rpm-macros >= 0.7.0
+%if %{with hscolour}
+BuildRequires:  hscolour
 %endif
+%{?ghc_pkg_deps:BuildRequires:  %{ghc_pkg_deps}, %(echo %{ghc_pkg_deps} | sed -e "s/\(ghc-[^, ]\+\)-devel/\1-doc,\1-prof/g")}
 Requires:       ghc-%{name}-devel = %{version}-%{release}
-# required until there is a command to open some system default
-# xterminal
+# required until there is a command to open a system-default xterminal
 Requires:       xterm
 # for xmessage
 Requires:       xorg-x11-apps
 
 %description
-xmonad is a tiling window manager for X. Windows are arranged
-automatically to tile the screen without gaps or overlap, maximising
-screen use. All features of the window manager are accessible from
-the keyboard: a mouse is strictly optional. xmonad is written and
-extensible in Haskell. Custom layout algorithms, and other
-extensions, may be written by the user in config files. Layouts are
-applied dynamically, and different layouts may be used on each
-workspace. Xinerama is fully supported, allowing windows to be tiled
-on several screens.
-
-
-%package -n ghc-%{name}-devel
-Summary:        Haskell %{name} library
-Group:          Development/Libraries
-Requires:       ghc = %{ghc_version}
-Requires(post): ghc = %{ghc_version}
-Requires(preun): ghc = %{ghc_version}
-Requires:       ghc-X11-devel = %ghc_pkg_ver X11
-
-%description -n ghc-%{name}-devel
-This package provides the Haskell %{name} library
-built for ghc-%{ghc_version}.
-
-
-%if %{with doc}
-%package -n ghc-%{name}-doc
-Summary:        Documentation for %{name}
-Group:          Development/Libraries
-Requires:       ghc-doc = %{ghc_version}
-Requires(post): ghc-doc = %{ghc_version}
-Requires(postun): ghc-doc = %{ghc_version}
-Requires:       ghc-X11-doc = %ghc_pkg_ver X11
-
-%description -n ghc-%{name}-doc
-This package contains development documentation files for the %{name} library.
-%endif
-
-
-%if %{with prof}
-%package -n ghc-%{name}-prof
-Summary:        Profiling libraries for %{name}
-Group:          Development/Libraries
-Requires:       ghc-%{name}-devel = %{version}-%{release}
-Requires:       ghc-prof = %{ghc_version}
-Requires:       ghc-X11-prof = %ghc_pkg_ver X11
-
-%description -n ghc-%{name}-prof
-This package contains profiling libraries for %{name}.
-%endif
+%{common_description}
 
 
 %prep
 %setup -q
-%patch0 -p1 -b .orig
+cp -p %SOURCE4 .
+
 
 %build
-%cabal_configure --ghc %{?with_prof:-p}
-%cabal build
-%if %{with doc}
-%cabal haddock
-%endif
-%ghc_gen_scripts
+%ghc_lib_build
 
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%cabal_install
-%ghc_install_scripts
-%ghc_gen_filelists ghc-%{name}
+%ghc_lib_install
 
 install -p -m 0644 -D man/%{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
 install -p -m 0644 -D %SOURCE1 $RPM_BUILD_ROOT%{_datadir}/xsessions/%{name}.desktop
 install -p -m 0755 -D %SOURCE2 $RPM_BUILD_ROOT%{_bindir}/%{name}-start
-install -p -m 0644 -D man/xmonad.hs $RPM_BUILD_ROOT%{_sysconfdir}/skel/.%{name}/%{name}.hs
+install -p -m 0644 -D %SOURCE3 $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
 
 rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/man/xmonad.hs
 
@@ -121,57 +77,26 @@ rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/man/xmonad.hs
 rm -rf $RPM_BUILD_ROOT
 
 
-%post -n ghc-%{name}-devel
-%ghc_register_pkg
-
-
-%if %{with doc}
-%post -n ghc-%{name}-doc
-%ghc_reindex_haddock
-%endif
-
-
-%preun -n ghc-%{name}-devel
-if [ "$1" -eq 0 ] ; then
-  %ghc_unregister_pkg
-fi
-
-
-%if %{with doc}
-%postun -n ghc-%{name}-doc
-if [ "$1" -eq 0 ] ; then
-  %ghc_reindex_haddock
-fi
-%endif
-
-
 %files
 %defattr(-,root,root,-)
-%doc CONFIG LICENSE README STYLE TODO man/%{name}.hs.orig
+%doc CONFIG LICENSE README man/%{name}.hs README.fedora
 %attr(755,root,root) %{_bindir}/%{name}
 %attr(755,root,root) %{_bindir}/%{name}-start
 %{_mandir}/man1/%{name}.1*
+%{_datadir}/applications/%{name}.desktop
 %{_datadir}/xsessions/%{name}.desktop
-%{_sysconfdir}/skel/.%{name}/%{name}.hs
 
 
-%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
-%defattr(-,root,root,-)
-
-
-%if %{with doc}
-%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files
-%defattr(-,root,root,-)
-%endif
-
-
-%if %{with prof}
-%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
-%defattr(-,root,root,-)
-%endif
+%ghc_binlib_package
 
 
 %changelog
+* Tue Sep 28 2010 Jens Petersen <petersen at redhat.com> - 0.9-4.1
+- add application desktop file for gnome-session to find xmonad
+- move display of manpage for new users from xmonad.hs to xmonad-start
+- drop skel file and dont create ~/.xmonad by default
+- update to latest macros
+
 * Tue Dec  8 2009 Jens Petersen <petersen at redhat.com> - 0.9-4
 - drop the ppc build cabal workaround
 


More information about the scm-commits mailing list