updating ebuild
[monky] / app-admin / conky / conky-1.4.7.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.4.5.ebuild,v 1.11 2007/07/22 08:19:13 omp Exp $
4
5 inherit eutils
6 # used for epause
7
8 DESCRIPTION="Conky is an advanced, highly configurable system monitor for X"
9 HOMEPAGE="http://conky.sf.net"
10 SRC_URI="mirror://sourceforge/conky/${P}.tar.bz2"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 ppc ppc64 sparc x86"
15 IUSE="truetype X ipv6 audacious bmpx hddtemp mpd vim-syntax"
16
17 DEPEND_COMMON="
18         virtual/libc
19         X? (
20                 x11-libs/libICE
21                 x11-libs/libXext
22                 x11-libs/libX11
23                 x11-libs/libSM
24                 x11-libs/libXrender
25                 x11-libs/libXdamage
26                 x11-libs/libXft
27                 truetype? ( >=media-libs/freetype-2 )
28                 audacious? ( >=media-sound/audacious-0.1 )
29                 bmpx? ( media-sound/bmpx
30                                 >=sys-apps/dbus-0.35
31                         )
32         )
33         wlan? ( net-wireless/wireless-tools )
34         !ipv6? ( >=dev-libs/glib-2.0 )"
35 RDEPEND="${DEPEND_COMMON}
36         hddtemp? ( app-admin/hddtemp )
37         vim-syntax? ( || ( app-editors/vim
38         app-editors/gvim ) )"
39
40 DEPEND="
41         ${DEPEND_COMMON}
42         X? (
43                 x11-libs/libXt
44                 x11-proto/xextproto
45                 x11-proto/xproto
46         )"
47
48 src_compile() {
49         local mymake
50         if useq ipv6 ; then
51                 ewarn
52                 ewarn "You have the ipv6 USE flag enabled.  Please note that using"
53                 ewarn "the ipv6 USE flag with Conky disables the port monitor."
54                 epause
55         else
56                 mymake="MPD_NO_IPV6=noipv6"
57         fi
58         local myconf
59         myconf="--enable-proc-uptime"
60         if useq X; then
61                 myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
62                 myconf="${myconf} $(use_enable truetype xft)"
63         else
64                 myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
65                 myconf="${myconf} --disable-xft"
66         fi
67         econf \
68                 ${myconf} \
69                 $(use_enable audacious) \
70                 $(use_enable bmpx) \
71                 $(use_enable hddtemp ) \
72                 $(use_enable rss) \
73                 $(use_enable wlan) \
74                 $(use_enable mpd) \
75                 $(use_enable !ipv6 portmon) || die "econf failed"
76         emake ${mymake} || die "compile failed"
77 }
78
79 src_install() {
80         emake DESTDIR="${D}" install || die "make install failed"
81         dodoc ChangeLog AUTHORS README doc/conkyrc.sample
82         dohtml doc/docs.html doc/config_settings.html doc/variables.html
83
84         if use vim-syntax; then
85                 insinto /usr/share/vim/vimfiles/ftdetect
86                 doins "${S}"/extras/vim/ftdetect/conkyrc.vim
87
88                 insinto /usr/share/vim/vimfiles/syntax
89                 doins "${S}"/extras/vim/syntax/conkyrc.vim
90         fi
91 }
92
93 pkg_postinst() {
94         elog 'Default configuration file is "~/.conkyrc"'
95         elog "You can find a sample configuration file in"
96         elog "/usr/share/doc/${PF}/conkyrc.sample.bz2"
97         elog
98         elog "For more info on Conky's new features,"
99         elog "please look at the README and ChangeLog:"
100         elog "/usr/share/doc/${PF}/README.gz"
101         elog "/usr/share/doc/${PF}/ChangeLog.gz"
102         elog "There are also pretty html docs available"
103         elog "on Conky's site or in /usr/share/doc/${PF}"
104         elog
105         elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
106         elog
107         elog "Vim syntax highlighting for conkyrc now enabled with"
108         elog "USE=vim-syntax"
109         elog
110 }