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