updated ifuse ebuild
[dottout.git] / app-misc / lcdproc / lcdproc-9999.ebuild
blobd537e5ea86b570cdd1f76cfa4a92c89e3fe84184
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-misc/lcdproc/lcdproc-0.5.2-r1.ebuild,v 1.7 2007/08/14 21:08:27 dertobi123 Exp $
5 WANT_AUTOMAKE="1.9"
6 inherit eutils autotools multilib cvs
8 DESCRIPTION="Client/Server suite to drive all kinds of LCD (-like) devices"
9 HOMEPAGE="http://lcdproc.org/"
11 ECVS_SERVER="lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc"
12 ECVS_MODULE="lcdproc"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~x86"
18 IUSE="doc debug nfs samba seamless-hbars usb lirc irman joystick"
20 # The following array holds the USE_EXPANDed keywords
21 IUSE_LCD_DEVICES=(ncurses bayrad cfontz cfontz633 cfontzpacket
22 cwlinux eyeboxone g15 graphlcd glk
23 hd44780 icpa106 imon iowarrior
24 lb216 lcdm001 lcterm
25 md8800 ms6931 mtcs16209x mtxorb noritakevfd
26 pyramid sed1330 sed1520 serialvfd sli
27 stv5730 svga t6963 text tyan
28 ula200 xosd ea65 picolcd serialpos )
30 # Iterate through the array and add the lcd_devices_* that we support
31 NUM_DEVICES=${#IUSE_LCD_DEVICES[@]}
32 index=0
33 while [ "${index}" -lt "${NUM_DEVICES}" ] ; do
34 IUSE="${IUSE} lcd_devices_${IUSE_LCD_DEVICES[${index}]}"
35 let "index = ${index} + 1"
36 done
38 RDEPEND="
39 usb? ( dev-libs/libusb )
40 lirc? ( app-misc/lirc )
41 irman? ( media-libs/libirman )
43 lcd_devices_graphlcd? ( app-misc/graphlcd-base app-misc/glcdprocdriver )
44 lcd_devices_g15? ( dev-libs/libg15 >=dev-libs/libg15render-1.1.1 )
45 lcd_devices_ncurses? ( sys-libs/ncurses )
46 lcd_devices_svga? ( media-libs/svgalib )
47 lcd_devices_ula200? ( >=dev-embedded/libftdi-0.7 dev-libs/libusb )
48 lcd_devices_xosd? ( x11-libs/xosd x11-libs/libX11 x11-libs/libXext )
49 lcd_devices_cfontzpacket? ( dev-libs/libusb )
50 lcd_devices_cwlinux? ( dev-libs/libusb )
51 lcd_devices_pyramid? ( dev-libs/libusb )
52 lcd_devices_picolcd? ( dev-libs/libusb )"
53 DEPEND="${RDEPEND}
54 dev-util/cvs
55 doc? ( app-text/xmlto )"
57 RDEPEND="${RDEPEND}
58 lcd_devices_g15? ( app-misc/g15daemon )"
60 S="${WORKDIR}/${PN}"
62 pkg_setup() {
63 if [ -n "${LCDPROC_DRIVERS}" ] ; then
64 ewarn "Setting the drivers to compile via LCDPROC_DRIVERS is not supported anymore."
65 ewarn "Please use LCD_DEVICES now and see emerge -pv output for the options."
69 src_unpack() {
70 cvs_src_unpack
71 cd "${S}"
72 sed -i "79s:server/drivers:/usr/$(get_libdir)/lcdproc:" LCDd.conf
73 eautoreconf
76 src_compile() {
77 # This array contains the driver names required by configure --with-drivers=
78 # The positions must be the same as the corresponding use_expand flags
79 local DEVICE_DRIVERS=(curses bayrad CFontz CFontz633 CFontzPacket
80 CwLnx EyeboxOne g15 glcdlib glk
81 hd44780 icp_a106 imon IOWarrior
82 lb216 lcdm001 lcterm
83 MD8800 ms6931 mtc_s16209x MtxOrb NoritakeVFD
84 pyramid sed1330 sed1520 serialVFD sli
85 stv5730 svga t6963 text tyan
86 ula200 xosd ea65 picolcd serialPOS)
88 # Generate comma separated list of drivers
89 COMMA_DRIVERS=""
90 FIRST_DRIVER=""
91 local index=0
93 while [ "${index}" -lt "${NUM_DEVICES}" ] ; do
94 if use "lcd_devices_${IUSE_LCD_DEVICES[${index}]}" ; then
95 append-driver "${DEVICE_DRIVERS[${index}]}"
97 let "index = ${index} + 1"
98 done
100 # Append the not-lcd-drivers (input)
101 use lirc && append-driver "lirc"
102 use irman && append-driver "irman"
103 use joystick && append-driver "joy"
105 if [ -z "${COMMA_DRIVERS}" ] ; then
106 ewarn "You are compiling LCDd without support for any LCD drivers at all."
107 else
108 # Patch the config to contain a driver that is actually installed instead of the default
109 elog "Compiling the following drivers for LCDd: ${COMMA_DRIVERS}"
110 elog "Setting Driver=${FIRST_DRIVER} in LCDd.conf"
111 sed -i "44s:curses:${FIRST_DRIVER}:" LCDd.conf
114 local ENABLEUSB
115 if use lcd_devices_cfontzpacket || use lcd_devices_cwlinux || use lcd_devices_pyramid; then
116 ENABLEUSB="--enable-libusb"
117 else
118 ENABLEUSB="$(use_enable usb libusb)"
121 econf \
122 $(use_enable debug) \
123 $(use_enable nfs stat-nfs) \
124 $(use_enable samba stat-smbfs ) \
125 $(use_enable seamless-hbars) \
126 ${ENABLEUSB} \
127 "--enable-drivers=${COMMA_DRIVERS}" \
128 || die "configure failed"
130 emake || die "make failed"
132 if use doc; then
133 ebegin "Creating user documentation"
134 cd ${S}/docs/lcdproc-user
135 xmlto html lcdproc-user.docbook
136 eend $?
138 ebegin "Creating dev documentation"
139 cd ${S}/docs/lcdproc-dev
140 xmlto html lcdproc-dev.docbook
141 eend $?
145 append-driver() {
146 [[ -z $* ]] && return 0
147 if [ -z "${COMMA_DRIVERS}" ] ; then
148 # First in the list
149 COMMA_DRIVERS="$*"
150 FIRST_DRIVER="$*"
151 else
152 # Second, third, ... include a comma at the front
153 COMMA_DRIVERS="${COMMA_DRIVERS},$*"
155 return 0
158 src_install() {
159 emake DESTDIR="${D}" install || die "make install failed"
161 # move example clients installed to /usr/bin
162 rm -f "${D}"/usr/bin/{tail,lcdmetar,iosock,fortune,x11amp}.pl
163 insinto /usr/share/lcdproc/clients
164 doins clients/examples/*.pl
165 doins clients/metar/
167 newinitd "${FILESDIR}/0.5.1-LCDd.initd" LCDd
168 newinitd "${FILESDIR}/0.5.1-lcdproc.initd" lcdproc
170 dodoc README CREDITS ChangeLog INSTALL TODO
171 dodoc docs/README.* docs/*.txt
173 if use doc; then
174 insinto /usr/share/doc/${PF}/lcdproc-user
175 doins docs/lcdproc-user/*.html
176 insinto /usr/share/doc/${PF}/lcdproc-dev
177 doins docs/lcdproc-dev/*.html
181 pkg_postinst() {
182 ewarn "IMPORTANT: Please update your /etc/LCDd.conf"
183 ewarn "As of lcdproc-0.5.1-r2, the DriverPath changed from /usr/share/lcdproc to /usr/$(get_libdir)/lcdproc ."