Fix compile error.
[monky] / app-admin / conky / conky-1.5.2.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/${PN}/${P}.tar.bz2"
11
12 LICENSE="GPL-3 BSD LGPL-2.1 MIT"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
15 IUSE="audacious bmpx debug hddtemp ipv6 mpd nano-syntax rss truetype vim-syntax smapi wifi X"
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-1.4.0 )
29                 bmpx? ( media-sound/bmpx
30                                 >=sys-apps/dbus-0.35
31                         )
32         )
33         rss? ( dev-libs/libxml2
34                         net-misc/curl
35                         )
36         wifi? ( net-wireless/wireless-tools )
37         !ipv6? ( >=dev-libs/glib-2.0 )"
38 RDEPEND="${DEPEND_COMMON}
39         hddtemp? ( app-admin/hddtemp )
40         vim-syntax? ( || ( app-editors/vim
41         app-editors/gvim ) )
42         nano-syntax? ( app-editors/nano )"
43 DEPEND="
44         ${DEPEND_COMMON}
45         dev-util/pkgconfig
46         X? (
47                 x11-libs/libXt
48                 x11-proto/xextproto
49                 x11-proto/xproto
50         )"
51
52 pkg_setup() {
53         if use audacious; then
54                 if has_version <media-sound/audacious-1.5.0 && ! built_with_use media-sound/audacious dbus; then
55                         eerror "media-sound/audacious is not built with dbus USE flag."
56                         eerror "Please add 'dbus' to your USE flags, and re-emerge media-sound/audacious."
57                         die "media-sound/audacious needs USE=dbus"
58                 fi
59         fi
60 }
61
62 src_compile() {
63         local mymake
64         if useq ipv6 ; then
65                 ewarn "You have the ipv6 USE flag enabled.  Please note that using"
66                 ewarn "the ipv6 USE flag with Conky disables the port monitor."
67                 epause
68         else
69                 mymake="MPD_NO_IPV6=noipv6"
70         fi
71         local myconf
72         myconf="--enable-proc-uptime"
73         if useq X; then
74                 myconf="${myconf} --enable-x11 --enable-double-buffer --enable-xdamage --enable-own-window"
75                 myconf="${myconf} $(use_enable truetype xft)"
76         else
77                 myconf="${myconf} --disable-x11 --disable-double-buffer --disable-xdamage --disable-own-window"
78                 myconf="${myconf} --disable-xft"
79         fi
80         econf \
81                 ${myconf} \
82                 $(use_enable audacious) \
83                 $(use_enable bmpx) \
84                 $(use_enable debug) \
85                 $(use_enable hddtemp ) \
86                 $(use_enable mpd) \
87                 $(use_enable rss) \
88                 $(use_enable smapi) \
89                 $(use_enable wifi wlan) \
90                 $(use_enable !ipv6 portmon) || die "econf failed"
91         emake ${mymake} || die "compile failed"
92 }
93
94 src_install() {
95         emake DESTDIR="${D}" install || die "make install failed"
96         dodoc ChangeLog AUTHORS README
97         dohtml doc/docs.html doc/config_settings.html doc/variables.html
98
99         if use vim-syntax; then
100                 insinto /usr/share/vim/vimfiles/ftdetect
101                 doins "${S}"/extras/vim/ftdetect/conkyrc.vim
102
103                 insinto /usr/share/vim/vimfiles/syntax
104                 doins "${S}"/extras/vim/syntax/conkyrc.vim
105         fi
106
107         if use nano-syntax; then
108                 insinto /usr/share/nano/
109                 doins "${S}"/extras/nano/conky.nanorc
110         fi
111 }
112
113 pkg_postinst() {
114         elog "You can find the sample configuration file at"
115         elog "/etc/conky/conky.conf.  To customize it, copy"
116         elog "/etc/conky/conky.conf to ~/.conkyrc and edit"
117         elog "it to your liking."
118         elog
119         elog "For more info on Conky's new features,"
120         elog "please look at the README and ChangeLog:"
121         elog "/usr/share/doc/${PF}/README.bz2"
122         elog "/usr/share/doc/${PF}/ChangeLog.bz2"
123         elog "There are also pretty html docs available"
124         elog "on Conky's site or in /usr/share/doc/${PF}"
125         elog
126         elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
127         elog
128         elog "Vim syntax highlighting for conkyrc now enabled with"
129         elog "USE=vim-syntax, for Nano with USE=nano-syntax"
130         elog
131 }