bluez-tools: Add package bluezetools
[feed/packages.git] / utils / owfs / Makefile
1 #
2 # Copyright (C) 2008-2014 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:=owfs
11 PKG_VERSION:=3.2p4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/owfs/owfs/releases/download/v$(PKG_VERSION)
16 PKG_HASH:=af0a5035f3f3df876ca15aea13486bfed6b3ef5409dee016db0be67755c35fcc
17
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=GPL-2.0
20 PKG_CPE_ID:=cpe:/a:owfs:owfs
21
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24
25 PKG_CONFIG_DEPENDS:= \
26 CONFIG_LIBOW_MASTER_USB \
27 CONFIG_LIBOW_MASTER_I2C \
28 CONFIG_LIBOW_MASTER_W1 \
29 CONFIG_LIBOW_ZEROCONF \
30 CONFIG_LIBOW_DEBUG \
31 CONFIG_LIBOW_OWTRAFFIC
32
33 include $(INCLUDE_DIR)/package.mk
34
35 #
36 # templates
37 #
38
39 define Package/owfs/Default
40 TITLE:=OWFS (1-Wire File System)
41 URL:=https://github.com/owfs/owfs
42 SECTION:=net
43 CATEGORY:=Network
44 SUBMENU:=Filesystem
45 endef
46
47 define Package/owfs/Default/description
48 OWFS is a suite of programs that designed to make the 1-wire bus and its
49 devices easily accessible. The underlying principle is to create a virtual
50 filesystem, with the unique ID being the directory, and the individual
51 properties of the device are represented as simple files that can be read
52 and written.
53
54 Details of the individual slave or master design are hidden behind a
55 consistent interface. The goal is to provide an easy set of tools for a
56 software designer to create monitoring or control applications. There are
57 some performance enhancements in the implementation, including data caching,
58 parallel access to bus masters, and aggregation of device communication.
59 Still the fundemental goal has been ease of use, flexibility and correctness
60 rather than speed.
61 endef
62
63 define Package/owfs/Server
64 $(call Package/owfs/Default)
65 DEPENDS:=+libow +libpthread
66 endef
67
68 define Package/owfs/Library
69 $(call Package/owfs/Default)
70 SECTION:=libs
71 CATEGORY:=Libraries
72 endef
73
74 define Package/owfs/Utility
75 $(call Package/owfs/Default)
76 SECTION:=utils
77 CATEGORY:=Utilities
78 DEPENDS:=+libow
79 endef
80
81 #
82 # shared libraries
83 #
84
85 define Package/libow
86 $(call Package/owfs/Library)
87 DEPENDS:= \
88 +libpthread \
89 +LIBOW_MASTER_USB:libusb-compat \
90 +LIBOW_MASTER_W1:kmod-w1
91 TITLE:=OWFS - common shared library
92 endef
93
94 define Package/libow/config
95 source "$(SOURCE)/Config.in"
96 endef
97
98 define Package/libow/description
99 $(call Package/owfs/Default/description)
100
101 This package contains the OWFS library.
102 endef
103
104 define Package/libow-capi
105 $(call Package/owfs/Library)
106 DEPENDS:=+libow
107 TITLE:=OWFS - C-API library
108 endef
109
110 define Package/libow-capi/description
111 $(call Package/owfs/Default/description)
112
113 This package contains the OWFS C-API library.
114 endef
115
116 #
117 # utilities
118 #
119
120 define Package/owshell
121 $(call Package/owfs/Utility)
122 TITLE:=OWFS - shell utilities
123 endef
124
125 define Package/owshell/description
126 $(call Package/owfs/Default/description)
127
128 This package contains the OWFS shell utilities.
129 endef
130
131 define Package/owfs
132 $(call Package/owfs/Utility)
133 # libfuse depends on kmod-fuse, no need to declare dependency
134 DEPENDS+= +libfuse +fuse-utils
135 TITLE:=OWFS - fuse file system
136 endef
137
138 define Package/owfs/description
139 $(call Package/owfs/Default/description)
140
141 This package contains the OWFS fuse filesystem.
142 endef
143
144 #
145 # network daemons
146 #
147
148 define Package/owhttpd
149 $(call Package/owfs/Server)
150 TITLE:=OWFS - http server
151 endef
152
153 define Package/owhttpd/description
154 $(call Package/owfs/Default/description)
155
156 This package contains the OWFS http server.
157 endef
158
159 define Package/owftpd
160 $(call Package/owfs/Server)
161 TITLE:=OWFS - ftp server
162 endef
163
164 define Package/owftpd/description
165 $(call Package/owfs/Default/description)
166
167 This package contains the OWFS ftp server.
168 endef
169
170 define Package/owserver
171 $(call Package/owfs/Server)
172 TITLE:=OWFS - network server
173 endef
174
175 define Package/owserver/description
176 $(call Package/owfs/Default/description)
177
178 This package contains the OWFS network server.
179 endef
180
181 CONFIGURE_ARGS += \
182 --enable-owftpd \
183 --enable-owserver \
184 --enable-owhttpd \
185 --enable-owfs \
186 --with-fuseinclude="$(STAGING_DIR)/usr/include" \
187 --with-fuselib="$(STAGING_DIR)/usr/lib" \
188 --enable-shared \
189 --disable-parport \
190 --disable-ownet \
191 --disable-owpython \
192 --disable-owphp \
193 --disable-owtcl \
194 --disable-swig \
195 --disable-avahi \
196 $(if $(CONFIG_LIBOW_MASTER_USB),--enable-usb,--disable-usb) \
197 $(if $(CONFIG_LIBOW_MASTER_W1),--enable-w1,--disable-w1) \
198 $(if $(CONFIG_LIBOW_MASTER_I2C),--enable-i2c,--disable-i2c) \
199 $(if $(CONFIG_LIBOW_ZEROCONF),--enable-zero,--disable-zero) \
200 $(if $(CONFIG_LIBOW_DEBUG),--enable-debug,--disable-debug) \
201 $(if $(CONFIG_LIBOW_OWTRAFFIC),--enable-owtraffic,--disable-owtraffic)
202
203 CONFIGURE_VARS += \
204 LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -Wl,-rpath-link=$(TOOLCHAIN_DIR)/usr/lib" \
205 lt_cv_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
206 lt_cv_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
207 shrext_cmds=".so" \
208
209 MAKE_FLAGS += \
210 CC="$(TARGET_CC)" \
211 HOST_CPU="$(PKGARCH)"
212
213 define Build/InstallDev
214 $(INSTALL_DIR) $(STAGING_DIR)/usr/include
215 $(CP) $(PKG_INSTALL_DIR)/usr/include/ow{capi,fs_config}.h $(STAGING_DIR)/usr/include/
216 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
217 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow{,capi}*.so* $(STAGING_DIR)/usr/lib/
218 endef
219
220 define Package/owfs/install
221 $(INSTALL_DIR) $(1)/usr/bin
222 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/
223 $(INSTALL_DIR) $(1)/etc/config
224 $(INSTALL_DATA) ./files/owfs.conf $(1)/etc/config/owfs
225 $(INSTALL_DIR) $(1)/etc/init.d
226 $(INSTALL_BIN) ./files/owfs.init $(1)/etc/init.d/owfs
227 mkdir -p $(1)/mnt/owfs
228 endef
229
230 define Package/owfs/conffiles
231 /etc/config/owfs
232 endef
233
234 define Package/owshell/install
235 $(INSTALL_DIR) $(1)/usr/bin
236 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owget $(1)/usr/bin/
237 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/
239 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/
240 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/
241 endef
242
243
244 define Package/owserver/install
245 $(INSTALL_DIR) $(1)/usr/bin
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owserver $(1)/usr/bin/
247 $(INSTALL_DIR) $(1)/etc/config
248 $(INSTALL_DATA) ./files/owserver.conf $(1)/etc/config/owserver
249 $(INSTALL_DIR) $(1)/etc/init.d
250 $(INSTALL_BIN) ./files/owserver.init $(1)/etc/init.d/owserver
251 endef
252
253 define Package/owserver/conffiles
254 /etc/config/owserver
255 endef
256
257 define Package/owhttpd/install
258 $(INSTALL_DIR) $(1)/usr/bin
259 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owhttpd $(1)/usr/bin/
260 $(INSTALL_DIR) $(1)/etc/config
261 $(INSTALL_DATA) ./files/owhttpd.conf $(1)/etc/config/owhttpd
262 $(INSTALL_DIR) $(1)/etc/init.d
263 $(INSTALL_BIN) ./files/owhttpd.init $(1)/etc/init.d/owhttpd
264 endef
265
266 define Package/owhttpd/conffiles
267 /etc/config/owhttpd
268 endef
269
270 define Package/owftpd/install
271 $(INSTALL_DIR) $(1)/usr/bin
272 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owftpd $(1)/usr/bin/
273 $(INSTALL_DIR) $(1)/etc/config
274 $(INSTALL_DATA) ./files/owftpd.conf $(1)/etc/config/owftpd
275 $(INSTALL_DIR) $(1)/etc/init.d
276 $(INSTALL_BIN) ./files/owftpd.init $(1)/etc/init.d/owftpd
277 endef
278
279 define Package/owftpd/conffiles
280 /etc/config/owftpd
281 endef
282
283 define Package/libow/install
284 $(INSTALL_DIR) $(1)/usr/lib
285 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/
286 endef
287
288 define Package/libow-capi/install
289 $(INSTALL_DIR) $(1)/usr/lib
290 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/
291 endef
292
293
294 $(eval $(call BuildPackage,owfs))
295 $(eval $(call BuildPackage,owshell))
296
297 $(eval $(call BuildPackage,owserver))
298 $(eval $(call BuildPackage,owhttpd))
299 $(eval $(call BuildPackage,owftpd))
300
301 $(eval $(call BuildPackage,libow))
302 $(eval $(call BuildPackage,libow-capi))