2 # Copyright (C) 2007-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
12 PKG_VERSION:=r$(PKG_REV)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
17 PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
23 include $(INCLUDE_DIR)/package.mk
25 define Package/lcd4linux
29 TITLE:=LCD display utility
30 URL:=http://lcd4linux.bulix.org/
34 define Package/lcd4linux/config
36 depends on PACKAGE_lcd4linux
37 source "$(SOURCE)/Config.in"
41 define Package/lcd4linux/description
42 LCD4Linux is a small program that grabs information from the kernel and
43 some subsystems and displays it on an external liquid crystal display.
46 define Package/lcd4linux/conffiles
119 LCD4LINUX_CONFIGURE_DRIVERS:= \
120 $(foreach c, $(LCD4LINUX_DRIVERS), \
121 $(if $(CONFIG_LCD4LINUX_DRV_$(c)),$(c),) \
124 LCD4LINUX_CONFIGURE_PLUGINS:= \
125 $(foreach c, $(LCD4LINUX_PLUGINS), \
126 $(if $(CONFIG_LCD4LINUX_PLUGIN_$(c)),$(c),) \
129 ifneq ($(CONFIG_LCD4LINUX_DRV_PNG),)
130 PKG_BUILD_DEPENDS += libgd
133 ifneq ($(CONFIG_LCD4LINUX_DRV_PPM),)
134 PKG_BUILD_DEPENDS += libgd
137 ifneq ($(CONFIG_LCD4LINUX_DRV_G15),)
138 PKG_BUILD_DEPENDS += libgd
141 ifneq ($(CONFIG_LCD4LINUX_DRV_LPH7508),)
142 PKG_BUILD_DEPENDS += libgd
145 ifneq ($(CONFIG_LCD4LINUX_DRV_LUIse),)
146 PKG_BUILD_DEPENDS += libgd
149 ifneq ($(CONFIG_LCD4LINUX_DRV_Noritake),)
150 PKG_BUILD_DEPENDS += libgd
153 ifneq ($(CONFIG_LCD4LINUX_DRV_serdisplib),)
154 PKG_BUILD_DEPENDS += libgd, serdisplib
157 ifneq ($(CONFIG_LCD4LINUX_DRV_st2205),)
158 PKG_BUILD_DEPENDS += libgd, st2205tool
161 ifneq ($(CONFIG_LCD4LINUX_DRV_T6963),)
162 PKG_BUILD_DEPENDS += libgd
165 ifneq ($(CONFIG_LCD4LINUX_DRV_Curses),)
166 PKG_BUILD_DEPENDS += libncurses
169 ifneq ($(CONFIG_LCD4LINUX_DRV_X11),)
170 PKG_BUILD_DEPENDS += libgd, libX11
173 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_gps),)
174 PKG_BUILD_DEPENDS += libnmeap
177 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_iconv),)
178 PKG_BUILD_DEPENDS += libiconv
181 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_mysql),)
182 PKG_BUILD_DEPENDS += libmysqlclient
185 # XXX: lcd4linux needs at least one driver and one plugin, if none are selected, build'em all
186 ifeq ($(strip $(LCD4LINUX_CONFIGURE_DRIVERS)),)
187 LCD4LINUX_CONFIGURE_DRIVERS:=all
189 ifeq ($(strip $(LCD4LINUX_CONFIGURE_PLUGINS)),)
190 LCD4LINUX_CONFIGURE_PLUGINS:=all
193 ## TODO PYTHON PLUGIN, DEPENDS on ver >= '2.1.0'
196 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libiconv/include
197 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libiconv/lib
199 TARGET_CONFIGURE_OPTS+=\
200 CC="$(TARGET_CC) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)"
206 --with-drivers="$(strip $(LCD4LINUX_CONFIGURE_DRIVERS))" \
207 --with-plugins="$(strip $(LCD4LINUX_CONFIGURE_PLUGINS))" \
211 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
214 define Package/lcd4linux/install
215 $(INSTALL_DIR) $(1)/usr/bin
216 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
217 $(INSTALL_DIR) $(1)/etc
218 $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
219 $(INSTALL_DIR) $(1)/etc/init.d
220 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
223 $(eval $(call BuildPackage,lcd4linux))