updating ebuild
[monky] / app-admin / conky / conky-1.5.0.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6 # used for epause
7
8 DESCRIPTION="An advanced, highly configurable system monitor for X"
9 HOMEPAGE="http://conky.sourceforge.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="audacious audacious-legacy bmpx debug hddtemp ipv6 mpd nano-syntax rss truetype vim-syntax
16 smapi wifi X"
17
18 DEPEND_COMMON="
19         virtual/libc
20         X? (
21                 x11-libs/libICE
22                 x11-libs/libXext
23                 x11-libs/libX11
24                 x11-libs/libSM
25                 x11-libs/libXrender
26                 x11-libs/libXdamage
27                 x11-libs/libXft
28                 truetype? ( >=media-libs/freetype-2 )
29                 audacious? ( >=media-sound/audacious-1.4.0 )
30                 audacious-legacy? ( <media-sound/audacious-1.4.0 )
31                 bmpx? ( media-sound/bmpx
32                                 >=sys-apps/dbus-0.35
33                         )
34         )
35         rss? ( dev-libs/libxml2
36                         net-misc/curl
37                         )
38         wifi? ( net-wireless/wireless-tools )
39         !ipv6? ( >=dev-libs/glib-2.0 )"
40 RDEPEND="${DEPEND_COMMON}
41         hddtemp? ( app-admin/hddtemp )
42         vim-syntax? ( || ( app-editors/vim
43         app-editors/gvim ) )
44         nano-syntax? ( app-editors/nano )"
45
46 DEPEND="
47         ${DEPEND_COMMON}
48         X? (
49                 x11-libs/libXt
50                 x11-proto/xextproto
51                 x11-proto/xproto
52         )"
53
54 pkg_setup() {
55         if use audacious; then
56                 if has_version <media-sound/audacious-1.5.0 && ! built_with_use media-sound/audacious dbus; then
57                         eerror "media-sound/audacious is not built with dbus USE flag."
58                         eerror "Please add 'dbus' to your USE flags, and re-emerge media-sound/audacious."
59                         die "media-sound/audacious needs USE=dbus"
60                 fi
61         fi
62 }
63
64 src_unpack() {
65         unpack ${A}
66         cd ${S}
67         epatch ${FILESDIR}/conky-1.5.0-disable-x11.patch
68 }
69
70 src_compile() {
71         local mymake
72         if useq ipv6 ; then
73                 ewarn "You have the ipv6 USE flag enabled.  Please note that using"
74                 ewarn "the ipv6 USE flag with Conky disables the port monitor."
75                 epause
76         else
77                 mymake="MPD_NO_IPV6=noipv6"
78         fi
79         local myconf
80         myconf="--enable-proc-uptime"
81         if useq X; then
82                 myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
83                 myconf="${myconf} $(use_enable truetype xft)"
84         else
85                 myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
86                 myconf="${myconf} --disable-xft"
87         fi
88         if useq audacious-legacy; then
89                 myconf="${myconf} --enable-audacious=legacy"
90         elif useq audacious; then
91                 myconf="${myconf} --enable-audacious"
92         fi
93         econf \
94                 ${myconf} \
95                 $(use_enable bmpx) \
96                 $(use_enable debug) \
97                 $(use_enable hddtemp ) \
98                 $(use_enable mpd) \
99                 $(use_enable rss) \
100                 $(use_enable smapi) \
101                 $(use_enable wifi wlan) \
102                 $(use_enable !ipv6 portmon) || die "econf failed"
103         emake ${mymake} || die "compile failed"
104 }
105
106 src_install() {
107         emake DESTDIR="${D}" install || die "make install failed"
108         dodoc ChangeLog AUTHORS README
109         dohtml doc/docs.html doc/config_settings.html doc/variables.html
110
111         if use vim-syntax; then
112                 insinto /usr/share/vim/vimfiles/ftdetect
113                 doins "${S}"/extras/vim/ftdetect/conkyrc.vim
114
115                 insinto /usr/share/vim/vimfiles/syntax
116                 doins "${S}"/extras/vim/syntax/conkyrc.vim
117         fi
118
119         if use nano-syntax; then
120                 insinto /usr/share/nano/
121                 doins "${S}"/extras/nano/conky.nanorc
122         fi
123 }
124
125 pkg_postinst() {
126         elog "You can find the sample configuration file at"
127         elog "/etc/conky/conky.conf.  To customize it, copy"
128         elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
129         elog "it to your liking."
130         elog
131         elog "For more info on Conky's new features,"
132         elog "please look at the README and ChangeLog:"
133         elog "/usr/share/doc/${PF}/README.bz2"
134         elog "/usr/share/doc/${PF}/ChangeLog.bz2"
135         elog "There are also pretty html docs available"
136         elog "on Conky's site or in /usr/share/doc/${PF}"
137         elog
138         elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
139         elog
140         elog "Vim syntax highlighting for conkyrc now enabled with"
141         elog "USE=vim-syntax, for Nano with USE=nano-syntax"
142         elog
143 }