You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

300 lines
7.6 KiB

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