e5fe6cbe680edc487f6709b3309a1ebcb1f9a3e9
[packages.git] / utils / lcd4linux / Makefile
1 #
2 # Copyright (C) 2007-2012 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:=1187
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 LCD4LINUX_DRIVERS:= \
22         ASTUSB \
23         BeckmannEgle \
24         BWCT \
25         CrystalFontz \
26         Curses \
27         Cwlinux \
28         D4D \
29         DPF \
30         EA232graphic \
31         EFN \
32         FutabaVFD \
33         FW8888 \
34         G15 \
35         GLCD2USB \
36         IRLCD \
37         $(if $(CONFIG_BROKEN),HD44780) \
38         $(if $(CONFIG_BROKEN),HD44780-I2C) \
39         LCD2USB \
40         $(if $(CONFIG_BROKEN),LCDLinux) \
41         LCDTerm \
42         LEDMatrix \
43         LPH7508 \
44         $(if $(CONFIG_BROKEN),LUIse) \
45         LW_ABP \
46         M50530 \
47         MatrixOrbital \
48         MatrixOrbitalGX \
49         MilfordInstruments \
50         Newhaven \
51         Noritake \
52         NULL \
53         Pertelian \
54         PHAnderson \
55         PICGraphic \
56         picoLCD \
57         picoLCDGraphic \
58         PNG \
59         PPM \
60         $(if $(CONFIG_TARGET_rb532),RouterBoard) \
61         $(if $(CONFIG_BROKEN),SamsungSPF) \
62         serdisplib \
63         ShuttleVFD \
64         SimpleLCD \
65         st2205 \
66         T6963 \
67         TeakLCM \
68         $(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
69         Trefon \
70         USBHUB \
71         USBLCD \
72         VNC \
73         WincorNixdorf \
74 #       ULA200 \
75 #       X11 \
76
77 LCD4LINUX_PLUGINS:= \
78         apm \
79         asterisk \
80         button_exec \
81         cpuinfo \
82         dbus \
83         diskstats \
84         dvb \
85         event \
86         exec \
87         fifo \
88         file \
89         gps \
90         hddtemp \
91         huawei \
92         i2c_sensors \
93         iconv \
94         imon \
95         isdn \
96         kvv \
97         loadavg \
98         netdev \
99         netinfo \
100         meminfo \
101         mpd \
102         mpris_dbus \
103         mysql \
104         netdev \
105         pop3 \
106         ppp \
107         proc_stat \
108         qnaplog \
109         seti \
110         statfs \
111         uname \
112         uptime \
113         w1retap \
114         $(if $(CONFIG_BROKEN),wireless) \
115         xmms \
116 #       python \
117
118 PKG_FIXUP:=autoreconf
119 PKG_INSTALL:=1
120
121 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
122
123 PKG_BUILD_DEPENDS:= \
124         libdbus \
125         libgd \
126         libmpdclient \
127         libmysqlclient \
128         libncurses \
129         libnmeap \
130         libsqlite3 \
131         libvncserver \
132         ppp \
133         serdisplib \
134         st2205tool \
135 #       libftdi \
136 #       libX11 \
137 #       python \
138
139 PKG_CONFIG_DEPENDS:= \
140         $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
141         $(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
142
143 include $(INCLUDE_DIR)/package.mk
144 include $(INCLUDE_DIR)/nls.mk
145
146 define Package/lcd4linux/Default
147   SECTION:=utils
148   CATEGORY:=Utilities
149   MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
150   TITLE:=LCD display utility
151   URL:=http://lcd4linux.bulix.org/
152 endef
153
154 define Package/lcd4linux/Default/description
155  LCD4Linux is a small program that grabs information from the kernel and
156  some subsystems and displays it on an external liquid crystal display.
157 endef
158
159
160 define Package/lcd4linux-custom
161 $(call Package/lcd4linux/Default)
162   DEPENDS:= \
163         +LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \
164         +LCD4LINUX_CUSTOM_NEEDS_libdpf:libdpf \
165         +LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \
166         $(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \
167         +LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \
168         +LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \
169         +LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \
170         +LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \
171         +LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \
172         +LCD4LINUX_CUSTOM_NEEDS_libusb:libusb \
173         +LCD4LINUX_CUSTOM_NEEDS_libvncserver:libvncserver \
174         +LCD4LINUX_CUSTOM_NEEDS_serdisplib:serdisplib \
175         +LCD4LINUX_CUSTOM_NEEDS_st2205tool:st2205tool \
176 #       +LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \
177 #       +LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \
178 #       +LCD4LINUX_CUSTOM_NEEDS_python:python
179   MENU:=1
180   PROVIDES:=lcd4linux
181   VARIANT=custom
182 endef
183
184 define Package/lcd4linux-custom/config
185         source "$(SOURCE)/Config.in"
186 endef
187
188 define Package/lcd4linux-custom/description
189 $(call Package/lcd4linux/Default/description)
190  .
191  This package contains a customized version of LCD4Linux.
192 endef
193
194
195 define Package/lcd4linux-full
196 $(call Package/lcd4linux/Default)
197   DEPENDS:= @DEVEL \
198         +libdbus \
199         +libdpf \
200         +libgd \
201         $(if $(ICONV_FULL),+libiconv-full) \
202         +libmpdclient \
203         +libmysqlclient \
204         +libncurses \
205         +libsqlite3 \
206         +libusb \
207         +libvncserver \
208         +serdisplib \
209         +st2205tool \
210 #       +libftdi \
211 #       +libX11 \
212 #       +python
213   PROVIDES:=lcd4linux
214   VARIANT=full
215 endef
216
217 define Package/lcd4linux-full/description
218 $(call Package/lcd4linux/Default/description)
219  .
220  This package contains a version of LCD4Linux built with all supported
221  drivers and plugins.
222 endef
223
224
225 CONFIGURE_ARGS+= \
226         --disable-rpath \
227
228 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
229
230 ifeq ($(BUILD_VARIANT),custom)
231
232   LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
233     $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
234  ))
235   ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
236     LCD4LINUX_CUSTOM_DRIVERS:=Sample
237   endif
238
239   LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
240     $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
241   ))
242   ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
243     LCD4LINUX_CUSTOM_PLUGINS:=sample
244   endif
245
246   CONFIGURE_ARGS+= \
247         --with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
248         --with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
249
250   ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
251     CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
252   else
253     CONFIGURE_ARGS+= --without-libiconv-prefix
254   endif
255
256   ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
257     EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
258   endif
259
260 #  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
261 #    CONFIGURE_ARGS+= --with-python
262 #  else
263     CONFIGURE_ARGS+= --without-python
264 #  endif
265
266 #  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
267 #    CONFIGURE_ARGS+= --with-x
268 #  else
269     CONFIGURE_ARGS+= --without-x
270 #  endif
271
272 endif
273
274 ifeq ($(BUILD_VARIANT),full)
275
276   LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
277     $(c) \
278   ))
279
280   LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
281     $(c) \
282   ))
283
284   CONFIGURE_ARGS+= \
285         --with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
286         --with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
287         --with-libiconv-prefix="$(ICONV_PREFIX)" \
288         --without-python \
289         --without-x \
290
291   EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
292
293 endif
294
295
296 define Package/lcd4linux/conffiles
297 /etc/lcd4linux.conf
298 endef
299
300 define Package/lcd4linux/install
301         $(INSTALL_DIR) $(1)/usr/bin
302         $(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/
303         $(INSTALL_DIR) $(1)/etc
304         $(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf
305         $(INSTALL_DIR) $(1)/etc/init.d
306         $(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux
307         $(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \
308             -e "s|^\(Layout 'TestLayer'\)|#\1|g" \
309             -e "s|^#\(Display 'Image'\)|\1|g" \
310             -e "s|^#\(Layout 'Default'\)|\1|g" \
311              $(1)/etc/lcd4linux.conf
312 endef
313
314 Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
315 Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
316
317 Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
318 Package/lcd4linux-full/install = $(Package/lcd4linux/install)
319
320 $(eval $(call BuildPackage,lcd4linux-custom))
321 $(eval $(call BuildPackage,lcd4linux-full))