926c481cd7193c1d3597c1236052e1c75fd1d6cf
[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_compile() {
65         local mymake
66         if useq ipv6 ; then
67                 ewarn "You have the ipv6 USE flag enabled.  Please note that using"
68                 ewarn "the ipv6 USE flag with Conky disables the port monitor."
69                 epause
70         else
71                 mymake="MPD_NO_IPV6=noipv6"
72         fi
73         local myconf
74         myconf="--enable-proc-uptime"
75         if useq X; then
76                 myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
77                 myconf="${myconf} $(use_enable truetype xft)"
78         else
79                 myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
80                 myconf="${myconf} --disable-xft"
81         fi
82         if useq audacious-legacy; then
83                 myconf="${myconf} --enable-audacious=legacy"
84         elif useq audacious; then
85                 myconf="${myconf} --enable-audacious"
86         fi
87         econf \
88                 ${myconf} \
89                 $(use_enable bmpx) \
90                 $(use_enable debug) \
91                 $(use_enable hddtemp ) \
92                 $(use_enable mpd) \
93                 $(use_enable rss) \
94                 $(use_enable smapi) \
95                 $(use_enable wifi wlan) \
96                 $(use_enable !ipv6 portmon) || die "econf failed"
97         emake ${mymake} || die "compile failed"
98 }
99
100 src_install() {
101         emake DESTDIR="${D}" install || die "make install failed"
102         dodoc ChangeLog AUTHORS README
103         dohtml doc/docs.html doc/config_settings.html doc/variables.html
104
105         if use vim-syntax; then
106                 insinto /usr/share/vim/vimfiles/ftdetect
107                 doins "${S}"/extras/vim/ftdetect/conkyrc.vim
108
109                 insinto /usr/share/vim/vimfiles/syntax
110                 doins "${S}"/extras/vim/syntax/conkyrc.vim
111         fi
112
113         if use nano-syntax; then
114                 insinto /usr/share/nano/
115                 doins "${S}"/extras/nano/conky.nanorc
116         fi
117 }
118
119 pkg_postinst() {
120         elog "You can find the sample configuration file at"
121         elog "/etc/conky/conky.conf.  To customize it, copy"
122         elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
123         elog "it to your liking."
124         elog
125         elog "For more info on Conky's new features,"
126         elog "please look at the README and ChangeLog:"
127         elog "/usr/share/doc/${PF}/README.bz2"
128         elog "/usr/share/doc/${PF}/ChangeLog.bz2"
129         elog "There are also pretty html docs available"
130         elog "on Conky's site or in /usr/share/doc/${PF}"
131         elog
132         elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
133         elog
134         elog "Vim syntax highlighting for conkyrc now enabled with"
135         elog "USE=vim-syntax, for Nano with USE=nano-syntax"
136         elog
137 }