95576d90a15232a82ddcf52c8a73c2ce78670232
[openwrt/svn-archive/archive.git] / utils / owfs / Makefile
1 #
2 # Copyright (C) 2008-2009 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 PKG_NAME:=owfs
10 PKG_VERSION:=2.7p21
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
15 PKG_MD5SUM:=8aea6f3bb0dc9fdb52ed3f0e9d84fa79
16 PKG_FIXUP = libtool
17
18 include $(INCLUDE_DIR)/package.mk
19
20 #
21 # templates
22 #
23
24 define Package/$(PKG_NAME)/Default
25 TITLE:=OWFS (1-Wire File System)
26 URL:=http://owfs.sourceforge.net/
27 SECTION:=net
28 CATEGORY:=Network
29 SUBMENU:=Filesystem
30 endef
31
32 define Package/$(PKG_NAME)/Default/description
33 OWFS is a suite of programs that designed to make the 1-wire bus and its
34 devices easily accessible. The underlying priciple is to create a virtual
35 filesystem, with the unique ID being the directory, and the individual
36 properties of the device are represented as simple files that can be read
37 and written.
38
39 Details of the individual slave or master design are hidden behind a
40 consistent interface. The goal is to provide an easy set of tools for a
41 software designer to create monitoring or control applications. There are
42 some performance enhancements in the implementation, including data caching,
43 parallel access to bus masters, and aggregation of device communication.
44 Still the fundemental goal has been ease of use, flexibility and correctness
45 rather than speed.
46 endef
47
48 define Package/owfs-server
49 $(call Package/$(PKG_NAME)/Default)
50 DEPENDS:=+libow +libpthread
51 endef
52
53 define Package/owfs/Library
54 $(call Package/owfs/Default)
55 SECTION:=libs
56 CATEGORY:=Libraries
57 endef
58
59 define Package/owfs/Utility
60 $(call Package/owfs/Default)
61 SECTION:=utils
62 CATEGORY:=Utilities
63 DEPENDS:=+libow
64 endef
65
66 define Package/owfs-server/Install
67 $(INSTALL_DIR) $(1)/usr/bin
68 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin/
69 endef
70
71
72 #
73 # shared libraries
74 #
75
76 define Package/libow
77 $(call Package/owfs/Library)
78 DEPENDS:=+libusb +libpthread
79 TITLE:=OWFS - common shared library
80 endef
81
82 define Package/libow/description
83 $(call Package/$(PKG_NAME)/Default/description)
84
85 This package contains the OWFS library.
86 endef
87
88 define Package/libow-capi
89 $(call Package/owfs/Library)
90 DEPENDS:=+libow
91 TITLE:=OWFS - C-API library
92 endef
93
94 define Package/libow-capi/description
95 $(call Package/$(PKG_NAME)/Default/description)
96
97 This package contains the OWFS C-API library.
98 endef
99
100 #
101 # utilities
102 #
103
104 define Package/owshell
105 $(call Package/owfs/Utility)
106 TITLE:=OWFS - shell utilities
107 endef
108
109 define Package/owshell/description
110 $(call Package/$(PKG_NAME)/Default/description)
111
112 This package contains the OWFS shell utilities.
113 endef
114
115 define Package/owfs
116 $(call Package/owfs/Utility)
117 # libfuse depends on kmod-fuse, no need to declare dependency
118 DEPENDS+= +libfuse +fuse-utils
119 TITLE:=OWFS - fuse file system
120 endef
121
122 define Package/owfs/description
123 $(call Package/$(PKG_NAME)/Default/description)
124
125 This package contains the OWFS fuse filesystem.
126 endef
127
128 #
129 # network daemons
130 #
131
132 define Package/owhttpd
133 $(call Package/owfs-server)
134 TITLE:=OWFS - http server
135 endef
136
137 define Package/owhttpd/description
138 $(call Package/$(PKG_NAME)/Default/description)
139
140 This package contains the OWFS http server.
141 endef
142
143 define Package/owftpd
144 $(call Package/owfs-server)
145 TITLE:=OWFS - ftp server
146 endef
147
148 define Package/owftpd/description
149 $(call Package/$(PKG_NAME)/Default/description)
150
151 This package contains the OWFS ftp server.
152 endef
153
154 define Package/owserver
155 $(call Package/owfs-server)
156 TITLE:=OWFS - network server
157 endef
158
159 define Package/owserver/description
160 $(call Package/$(PKG_NAME)/Default/description)
161
162 This package contains the OWFS network server.
163 endef
164
165 PKG_CONFIGURE_OPTS:= \
166 --enable-zero \
167 --disable-parport \
168 --disable-ownfsd \
169 --disable-ownet \
170 --disable-owpython \
171 --disable-libow-perl \
172 --disable-owphp \
173 --disable-owtcl \
174 --disable-owside \
175 --disable-swig
176
177 CONFIGURE_ARGS += \
178 --prefix=/usr \
179 --exec-prefix=/usr \
180 --enable-owftpd \
181 --enable-owserver \
182 --enable-owhttpd \
183 --enable-owfs \
184 --with-fuseinclude="$(STAGING_DIR)/usr/include" \
185 --with-fuselib="$(STAGING_DIR)/usr/lib" \
186 $(PKG_CONFIGURE_OPTS) \
187 --enable-shared \
188 --disable-rpath
189
190 define Build/Configure
191 (cd $(PKG_BUILD_DIR); \
192 rm -rf config.{status,cache} ; \
193 ./bootstrap ; \
194 $(TARGET_CONFIGURE_OPTS) \
195 CFLAGS="$(TARGET_CFLAGS)" \
196 CPPFLAGS="$(TARGET_CPPFLAGS)" \
197 LDFLAGS="$(TARGET_LDFLAGS)" \
198 lt_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
199 lt_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
200 shrext_cmds=".so" \
201 ./configure \
202 $(CONFIGURE_ARGS) \
203 );
204 endef
205
206 define Build/Compile
207 $(MAKE) -C $(PKG_BUILD_DIR) \
208 DESTDIR="$(PKG_INSTALL_DIR)" \
209 all install
210 endef
211
212 define Build/InstallDev
213 mkdir -p $(STAGING_DIR)/usr/include
214 $(CP) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(STAGING_DIR)/usr/include/
215 mkdir -p $(STAGING_DIR)/usr/lib
216 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so* $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so* $(STAGING_DIR)/usr/lib/
217 endef
218
219 define Build/UninstallDev
220 rm -rf $(STAGING_DIR)/usr/include/{libow-capi,owfs_config}.h \
221 $(STAGING_DIR)/usr/lib/libow-capi-*.so* \
222 $(STAGING_DIR)/usr/lib/libow-*.so*
223 endef
224
225
226 define Package/owfs/install
227 $(INSTALL_DIR) $(1)/usr/bin
228 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/
229 endef
230
231 define Package/owshell/install
232 $(INSTALL_DIR) $(1)/usr/bin
233 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/
235 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/
236 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/
237 endef
238
239
240 define Package/owserver/install
241 $(call Package/owfs-server/Install,$(1),owserver,70)
242 endef
243
244 define Package/owhttpd/install
245 $(call Package/owfs-server/Install,$(1),owhttpd,80)
246 endef
247
248 define Package/owftpd/install
249 $(call Package/owfs-server/Install,$(1),owftpd,80)
250 endef
251
252
253 define Package/libow/install
254 $(INSTALL_DIR) $(1)/usr/lib
255 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/
256 endef
257
258 define Package/libow-capi/install
259 $(INSTALL_DIR) $(1)/usr/lib
260 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/
261 #$(INSTALL_DIR) $(1)/usr/include
262 #$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/{owcapi,owfs_config}.h $(1)/usr/include/
263 endef
264
265
266 $(eval $(call BuildPackage,owfs))
267 $(eval $(call BuildPackage,owshell))
268
269 $(eval $(call BuildPackage,owserver))
270 $(eval $(call BuildPackage,owhttpd))
271 $(eval $(call BuildPackage,owftpd))
272
273 $(eval $(call BuildPackage,libow))
274 $(eval $(call BuildPackage,libow-capi))