Update to cabal2spec-0.24

xmonadpropwrite.hs is in the tarball again
This commit is contained in:
Ben Boeckel 2011-07-09 02:01:28 -04:00
parent 53a5330f6e
commit e886df4c06
2 changed files with 34 additions and 56 deletions

View File

@ -1,40 +1,57 @@
# For Haskell Packaging Guidelines see:
# - https://fedoraproject.org/wiki/Packaging:Haskell
# - https://fedoraproject.org/wiki/PackagingDrafts/Haskell
%bcond_without hinotify
%bcond_without libmpd
%bcond_with iwlib
%bcond_without iwlib
%bcond_with alsa
Name: xmobar
Version: 0.13
Release: 4%{?dist}
Release: 5%{?dist}
Summary: A minimalistic text-based status bar
Group: User Interface/X
License: BSD
# BEGIN: cabal2spec-0.24
URL: http://hackage.haskell.org/package/%{name}
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
Source1: xmobar.desktop
# Not in the package from Hackage.
# https://github.com/jaor/xmobar/issues/#issue/6
Source2: xmonadpropwrite.hs
Patch1: xmobar-0.13-default-fonts.patch
ExclusiveArch: %{ghc_arches}
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-X11-devel >= 1.3.0
BuildRequires: ghc-X11-xft-devel
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-parsec-devel
BuildRequires: ghc-stm-devel
BuildRequires: ghc-utf8-string-devel
# END: cabal2spec-0.24
%if %{with alsa}
BuildRequires: ghc-alsa-mixer-devel
%endif
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-directory-devel
BuildRequires: ghc-filepath-devel
%if %{with hinotify}
BuildRequires: ghc-hinotify-devel
%endif
%if %{with libmpd}
BuildRequires: ghc-libmpd-devel
%endif
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-old-locale-devel
BuildRequires: ghc-old-time-devel
BuildRequires: ghc-parsec-devel
BuildRequires: ghc-process-devel
BuildRequires: ghc-stm-devel
BuildRequires: ghc-time-devel
BuildRequires: ghc-unix-devel
BuildRequires: ghc-utf8-string-devel
BuildRequires: ghc-X11-devel >= 1.3.0
BuildRequires: ghc-X11-xft-devel
BuildRequires: desktop-file-utils
%if %{with iwlib}
BuildRequires: wireless-tools-devel
%endif
Patch1: xmobar-0.13-default-fonts.patch
%description
Inspired by the Ion3 status bar, it supports similar features, like dynamic
@ -43,9 +60,7 @@ color management, output templates, and extensibility through plugins.
%prep
%setup -q
%patch1 -p1 -b .orig
mkdir scripts
cp %{SOURCE2} scripts/xmonadpropwrite.hs
%patch1 -p1 -b .fonts
%build
@ -76,6 +91,10 @@ popd
%changelog
* Mon Jul 25 2011 Ben Boeckel <mathstuf@gmail.com> - 0.13-5
- Update to cabal2spec-0.24
- xmonadpropwrite.hs is in the tarball again
* Fri Jul 22 2011 Jens Petersen <petersen@redhat.com> - 0.13-4
- reenable hinotify

View File

@ -1,41 +0,0 @@
-- Copyright Spencer Janssen <spencerjanssen@gmail.com>
-- Tomas Janousek <tomi@nomi.cz>
-- BSD3 (see LICENSE)
--
-- Reads from standard input and writes to an X propery on root window.
-- To be used with XPropertyLog:
-- Add it to commands:
-- Run XPropertyLog "_XMONAD_LOG_CUSTOM"
-- Add it to the template:
-- template = "... %_XMONAD_LOG_CUSTOM% ..."
-- Run:
-- $ blah blah | xmonadpropwrite _XMONAD_LOG_CUSTOM
import Control.Monad
import Graphics.X11
import Graphics.X11.Xlib.Extras
import qualified Data.ByteString as B
import Foreign.C (CChar)
import System.IO
import System.Environment
main = do
atom <- flip fmap getArgs $ \args -> case args of
[a] -> a
_ -> "_XMONAD_LOG"
d <- openDisplay ""
xlog <- internAtom d atom False
ustring <- internAtom d "UTF8_STRING" False
root <- rootWindow d (defaultScreen d)
forever $ do
msg <- B.getLine
changeProperty8 d root xlog ustring propModeReplace (encodeCChar msg)
sync d True
return ()
encodeCChar :: B.ByteString -> [CChar]
encodeCChar = map fromIntegral . B.unpack