86c75518c0b23b77fd7c8d2f9ad6f0f9d6aff66f
[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:=877
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=3
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 G15 \
58 HD44780 \
59 LCD2USB \
60 LCDLinux \
61 LCDTerm \
62 LPH7508 \
63 LUIse \
64 M50530 \
65 MatrixOrbital \
66 MilfordInstruments \
67 Noritake \
68 NULL \
69 PNG \
70 PPM \
71 Pertelian \
72 picoLCD \
73 RouterBoard \
74 serdisplib \
75 SimpleLCD \
76 st2205 \
77 T6963 \
78 Trefon \
79 USBLCD \
80 USBHUB \
81 WincorNixdorf \
82 X11 \
83
84 LCD4LINUX_PLUGINS:= \
85 apm \
86 asterisk \
87 button_exec \
88 cpuinfo \
89 diskstats \
90 dvb \
91 exec \
92 fifo \
93 file \
94 gps \
95 i2c_sensors \
96 iconv \
97 imon \
98 isdn \
99 kvv \
100 loadavg \
101 meminfo \
102 mpd \
103 mysql \
104 netdev \
105 pop3 \
106 ppp \
107 proc_stat \
108 python \
109 seti \
110 statfs \
111 uname \
112 uptime \
113 wireless \
114 xmms \
115
116 LCD4LINUX_CONFIGURE_DRIVERS:= \
117 $(foreach c, $(LCD4LINUX_DRIVERS), \
118 $(if $(CONFIG_LCD4LINUX_DRV_$(c)),$(c),) \
119 )
120
121 LCD4LINUX_CONFIGURE_PLUGINS:= \
122 $(foreach c, $(LCD4LINUX_PLUGINS), \
123 $(if $(CONFIG_LCD4LINUX_PLUGIN_$(c)),$(c),) \
124 )
125
126 ifneq ($(CONFIG_LCD4LINUX_DRV_PNG),)
127 PKG_BUILD_DEPENDS += libgd
128 endif
129
130 ifneq ($(CONFIG_LCD4LINUX_DRV_PPM),)
131 PKG_BUILD_DEPENDS += libgd
132 endif
133
134 ifneq ($(CONFIG_LCD4LINUX_DRV_G15),)
135 PKG_BUILD_DEPENDS += libgd
136 endif
137
138 ifneq ($(CONFIG_LCD4LINUX_DRV_LPH7508),)
139 PKG_BUILD_DEPENDS += libgd
140 endif
141
142 ifneq ($(CONFIG_LCD4LINUX_DRV_LUIse),)
143 PKG_BUILD_DEPENDS += libgd
144 endif
145
146 ifneq ($(CONFIG_LCD4LINUX_DRV_Noritake),)
147 PKG_BUILD_DEPENDS += libgd
148 endif
149
150 ifneq ($(CONFIG_LCD4LINUX_DRV_serdisplib),)
151 PKG_BUILD_DEPENDS += libgd, serdisplib
152 endif
153
154 ifneq ($(CONFIG_LCD4LINUX_DRV_st2205),)
155 PKG_BUILD_DEPENDS += libgd, st2205tool
156 endif
157
158 ifneq ($(CONFIG_LCD4LINUX_DRV_T6963),)
159 PKG_BUILD_DEPENDS += libgd
160 endif
161
162 ifneq ($(CONFIG_LCD4LINUX_DRV_Curses),)
163 PKG_BUILD_DEPENDS += libncurses
164 endif
165
166 ifneq ($(CONFIG_LCD4LINUX_DRV_X11),)
167 PKG_BUILD_DEPENDS += libgd, libX11
168 endif
169
170 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_gps),)
171 PKG_BUILD_DEPENDS += libnmeap
172 endif
173
174 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_iconv),)
175 PKG_BUILD_DEPENDS += libiconv
176 endif
177
178 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_mysql),)
179 PKG_BUILD_DEPENDS += libmysqlclient
180 endif
181
182 # XXX: lcd4linux needs at least one driver and one plugin, if none are selected, build'em all
183 ifeq ($(strip $(LCD4LINUX_CONFIGURE_DRIVERS)),)
184 LCD4LINUX_CONFIGURE_DRIVERS:=all
185 endif
186 ifeq ($(strip $(LCD4LINUX_CONFIGURE_PLUGINS)),)
187 LCD4LINUX_CONFIGURE_PLUGINS:=all
188 endif
189
190 ## TODO PYTHON PLUGIN, DEPENDS on ver >= '2.1.0'
191
192
193 EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/lib/libiconv/include
194 EXTRA_LDFLAGS+=-L$(STAGING_DIR)/usr/lib -Wl,-rpath-link,$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libiconv/lib
195
196 TARGET_CONFIGURE_OPTS+=\
197 CC="$(TARGET_CC) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)"
198
199 CONFIGURE_ARGS += \
200 --without-x \
201 --without-python \
202 --disable-rpath \
203 --with-drivers="$(strip $(LCD4LINUX_CONFIGURE_DRIVERS))" \
204 --with-plugins="$(strip $(LCD4LINUX_CONFIGURE_PLUGINS))" \
205
206
207 define Build/Compile
208 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
209 endef
210
211 define Package/lcd4linux/install
212 $(INSTALL_DIR) $(1)/usr/bin
213 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
214 $(INSTALL_DIR) $(1)/etc
215 $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
216 $(INSTALL_DIR) $(1)/etc/init.d
217 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
218 endef
219
220 $(eval $(call BuildPackage,lcd4linux))