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