update lcd4linux to latest svn version, some important fixes
[openwrt/svn-archive/archive.git] / utils / lcd4linux / Makefile
1 #
2 # Copyright (C) 2007-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=lcd4linux
12 PKG_REV:=903
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
18 PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20 PKG_SOURCE_PROTO:=svn
21
22 PKG_FIXUP = libtool
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/lcd4linux
27 SECTION:=utils
28 CATEGORY:=Utilities
29 DEPENDS:=+libusb
30 TITLE:=LCD display utility
31 URL:=http://lcd4linux.bulix.org/
32 MENU:=1
33 endef
34
35 define Package/lcd4linux/config
36 menu "Configuration"
37 depends on PACKAGE_lcd4linux
38 source "$(SOURCE)/Config.in"
39 endmenu
40 endef
41
42 define Package/lcd4linux/description
43 LCD4Linux is a small program that grabs information from the kernel and
44 some subsystems and displays it on an external liquid crystal display.
45 endef
46
47 define Package/lcd4linux/conffiles
48 /etc/lcd4linux.conf
49 endef
50
51 LCD4LINUX_DRIVERS:= \
52 BeckmannEgle \
53 BWCT \
54 CrystalFontz \
55 Curses \
56 Cwlinux \
57 D4D \
58 G15 \
59 IRLCD \
60 HD44780 \
61 LCD2USB \
62 LCDLinux \
63 LCDTerm \
64 LPH7508 \
65 LUIse \
66 M50530 \
67 MatrixOrbital \
68 MilfordInstruments \
69 Noritake \
70 NULL \
71 PNG \
72 PPM \
73 Pertelian \
74 picoLCD \
75 picoLCDGraphic \
76 RouterBoard \
77 serdisplib \
78 SimpleLCD \
79 st2205 \
80 T6963 \
81 Trefon \
82 USBLCD \
83 USBHUB \
84 ULA200 \
85 WincorNixdorf \
86 X11 \
87
88 LCD4LINUX_PLUGINS:= \
89 apm \
90 asterisk \
91 button_exec \
92 cpuinfo \
93 diskstats \
94 dvb \
95 exec \
96 fifo \
97 file \
98 gps \
99 i2c_sensors \
100 iconv \
101 imon \
102 isdn \
103 kvv \
104 loadavg \
105 meminfo \
106 mpd \
107 mysql \
108 netdev \
109 pop3 \
110 ppp \
111 proc_stat \
112 python \
113 seti \
114 statfs \
115 uname \
116 uptime \
117 wireless \
118 xmms \
119
120 LCD4LINUX_CONFIGURE_DRIVERS:= \
121 $(foreach c, $(LCD4LINUX_DRIVERS), \
122 $(if $(CONFIG_LCD4LINUX_DRV_$(c)),$(c),) \
123 )
124
125 LCD4LINUX_CONFIGURE_PLUGINS:= \
126 $(foreach c, $(LCD4LINUX_PLUGINS), \
127 $(if $(CONFIG_LCD4LINUX_PLUGIN_$(c)),$(c),) \
128 )
129
130 ifneq ($(CONFIG_LCD4LINUX_DRV_PNG),)
131 PKG_BUILD_DEPENDS += libgd
132 endif
133
134 ifneq ($(CONFIG_LCD4LINUX_DRV_PPM),)
135 PKG_BUILD_DEPENDS += libgd
136 endif
137
138 ifneq ($(CONFIG_LCD4LINUX_DRV_G15),)
139 PKG_BUILD_DEPENDS += libgd
140 endif
141
142 ifneq ($(CONFIG_LCD4LINUX_DRV_LPH7508),)
143 PKG_BUILD_DEPENDS += libgd
144 endif
145
146 ifneq ($(CONFIG_LCD4LINUX_DRV_LUIse),)
147 PKG_BUILD_DEPENDS += libgd
148 endif
149
150 ifneq ($(CONFIG_LCD4LINUX_DRV_Noritake),)
151 PKG_BUILD_DEPENDS += libgd
152 endif
153
154 ifneq ($(CONFIG_LCD4LINUX_DRV_serdisplib),)
155 PKG_BUILD_DEPENDS += libgd, serdisplib
156 endif
157
158 ifneq ($(CONFIG_LCD4LINUX_DRV_st2205),)
159 PKG_BUILD_DEPENDS += libgd, st2205tool
160 endif
161
162 ifneq ($(CONFIG_LCD4LINUX_DRV_T6963),)
163 PKG_BUILD_DEPENDS += libgd
164 endif
165
166 ifneq ($(CONFIG_LCD4LINUX_DRV_Curses),)
167 PKG_BUILD_DEPENDS += libncurses
168 endif
169
170 ifneq ($(CONFIG_LCD4LINUX_DRV_X11),)
171 PKG_BUILD_DEPENDS += libgd, libX11
172 endif
173
174 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_gps),)
175 PKG_BUILD_DEPENDS += libnmeap
176 endif
177
178 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_iconv),)
179 PKG_BUILD_DEPENDS += libiconv
180 endif
181
182 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_mysql),)
183 PKG_BUILD_DEPENDS += libmysqlclient
184 endif
185
186 # XXX: lcd4linux needs at least one driver and one plugin, if none are selected, build'em all
187 ifeq ($(strip $(LCD4LINUX_CONFIGURE_DRIVERS)),)
188 LCD4LINUX_CONFIGURE_DRIVERS:=all
189 endif
190 ifeq ($(strip $(LCD4LINUX_CONFIGURE_PLUGINS)),)
191 LCD4LINUX_CONFIGURE_PLUGINS:=all
192 endif
193
194 ## TODO PYTHON PLUGIN, DEPENDS on ver >= '2.1.0'
195
196
197 EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/lib/libiconv/include
198 EXTRA_LDFLAGS+=-L$(STAGING_DIR)/usr/lib -Wl,-rpath-link,$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libiconv/lib
199
200 TARGET_CONFIGURE_OPTS+=\
201 CC="$(TARGET_CC) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)"
202
203 CONFIGURE_ARGS += \
204 --without-x \
205 --without-python \
206 --disable-rpath \
207 --with-drivers="$(strip $(LCD4LINUX_CONFIGURE_DRIVERS))" \
208 --with-plugins="$(strip $(LCD4LINUX_CONFIGURE_PLUGINS))" \
209
210
211 define Build/Compile
212 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
213 endef
214
215 define Package/lcd4linux/install
216 $(INSTALL_DIR) $(1)/usr/bin
217 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
218 $(INSTALL_DIR) $(1)/etc
219 $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
220 $(INSTALL_DIR) $(1)/etc/init.d
221 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
222 endef
223
224 $(eval $(call BuildPackage,lcd4linux))