01aa86d9f309f627f672fa1d62dd70ea2e7462d3
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lcd4linux
11 PKG_REV:=903
12 PKG_VERSION:=r$(PKG_REV)
13 PKG_RELEASE:=1
14
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)
19 PKG_SOURCE_PROTO:=svn
20
21 PKG_FIXUP = libtool
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/lcd4linux
26 SECTION:=utils
27 CATEGORY:=Utilities
28 DEPENDS:=+libusb
29 TITLE:=LCD display utility
30 URL:=http://lcd4linux.bulix.org/
31 MENU:=1
32 endef
33
34 define Package/lcd4linux/config
35 menu "Configuration"
36 depends on PACKAGE_lcd4linux
37 source "$(SOURCE)/Config.in"
38 endmenu
39 endef
40
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.
44 endef
45
46 define Package/lcd4linux/conffiles
47 /etc/lcd4linux.conf
48 endef
49
50 LCD4LINUX_DRIVERS:= \
51 BeckmannEgle \
52 BWCT \
53 CrystalFontz \
54 Curses \
55 Cwlinux \
56 D4D \
57 G15 \
58 IRLCD \
59 HD44780 \
60 LCD2USB \
61 LCDLinux \
62 LCDTerm \
63 LPH7508 \
64 LUIse \
65 M50530 \
66 MatrixOrbital \
67 MilfordInstruments \
68 Noritake \
69 NULL \
70 PNG \
71 PPM \
72 Pertelian \
73 picoLCD \
74 picoLCDGraphic \
75 RouterBoard \
76 serdisplib \
77 SimpleLCD \
78 st2205 \
79 T6963 \
80 Trefon \
81 USBLCD \
82 USBHUB \
83 ULA200 \
84 WincorNixdorf \
85 X11 \
86
87 LCD4LINUX_PLUGINS:= \
88 apm \
89 asterisk \
90 button_exec \
91 cpuinfo \
92 diskstats \
93 dvb \
94 exec \
95 fifo \
96 file \
97 gps \
98 i2c_sensors \
99 iconv \
100 imon \
101 isdn \
102 kvv \
103 loadavg \
104 meminfo \
105 mpd \
106 mysql \
107 netdev \
108 pop3 \
109 ppp \
110 proc_stat \
111 python \
112 seti \
113 statfs \
114 uname \
115 uptime \
116 wireless \
117 xmms \
118
119 LCD4LINUX_CONFIGURE_DRIVERS:= \
120 $(foreach c, $(LCD4LINUX_DRIVERS), \
121 $(if $(CONFIG_LCD4LINUX_DRV_$(c)),$(c),) \
122 )
123
124 LCD4LINUX_CONFIGURE_PLUGINS:= \
125 $(foreach c, $(LCD4LINUX_PLUGINS), \
126 $(if $(CONFIG_LCD4LINUX_PLUGIN_$(c)),$(c),) \
127 )
128
129 ifneq ($(CONFIG_LCD4LINUX_DRV_PNG),)
130 PKG_BUILD_DEPENDS += libgd
131 endif
132
133 ifneq ($(CONFIG_LCD4LINUX_DRV_PPM),)
134 PKG_BUILD_DEPENDS += libgd
135 endif
136
137 ifneq ($(CONFIG_LCD4LINUX_DRV_G15),)
138 PKG_BUILD_DEPENDS += libgd
139 endif
140
141 ifneq ($(CONFIG_LCD4LINUX_DRV_LPH7508),)
142 PKG_BUILD_DEPENDS += libgd
143 endif
144
145 ifneq ($(CONFIG_LCD4LINUX_DRV_LUIse),)
146 PKG_BUILD_DEPENDS += libgd
147 endif
148
149 ifneq ($(CONFIG_LCD4LINUX_DRV_Noritake),)
150 PKG_BUILD_DEPENDS += libgd
151 endif
152
153 ifneq ($(CONFIG_LCD4LINUX_DRV_serdisplib),)
154 PKG_BUILD_DEPENDS += libgd, serdisplib
155 endif
156
157 ifneq ($(CONFIG_LCD4LINUX_DRV_st2205),)
158 PKG_BUILD_DEPENDS += libgd, st2205tool
159 endif
160
161 ifneq ($(CONFIG_LCD4LINUX_DRV_T6963),)
162 PKG_BUILD_DEPENDS += libgd
163 endif
164
165 ifneq ($(CONFIG_LCD4LINUX_DRV_Curses),)
166 PKG_BUILD_DEPENDS += libncurses
167 endif
168
169 ifneq ($(CONFIG_LCD4LINUX_DRV_X11),)
170 PKG_BUILD_DEPENDS += libgd, libX11
171 endif
172
173 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_gps),)
174 PKG_BUILD_DEPENDS += libnmeap
175 endif
176
177 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_iconv),)
178 PKG_BUILD_DEPENDS += libiconv
179 endif
180
181 ifneq ($(CONFIG_LCD4LINUX_PLUGIN_mysql),)
182 PKG_BUILD_DEPENDS += libmysqlclient
183 endif
184
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
188 endif
189 ifeq ($(strip $(LCD4LINUX_CONFIGURE_PLUGINS)),)
190 LCD4LINUX_CONFIGURE_PLUGINS:=all
191 endif
192
193 ## TODO PYTHON PLUGIN, DEPENDS on ver >= '2.1.0'
194
195
196 EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/lib/libiconv/include
197 EXTRA_LDFLAGS+=-L$(STAGING_DIR)/usr/lib -Wl,-rpath-link,$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libiconv/lib
198
199 TARGET_CONFIGURE_OPTS+=\
200 CC="$(TARGET_CC) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)"
201
202 CONFIGURE_ARGS += \
203 --without-x \
204 --without-python \
205 --disable-rpath \
206 --with-drivers="$(strip $(LCD4LINUX_CONFIGURE_DRIVERS))" \
207 --with-plugins="$(strip $(LCD4LINUX_CONFIGURE_PLUGINS))" \
208
209
210 define Build/Compile
211 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
212 endef
213
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)
221 endef
222
223 $(eval $(call BuildPackage,lcd4linux))