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.

302 lines
7.7 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:=3.2p3
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/owfs/owfs/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=b8d33eba57d4a2f6c8a11ff23f233e3248bd75a42c8219b058a888846edd8717
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_CPE_ID:=cpe:/a:owfs:owfs
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_LIBOW_MASTER_USB \
  21. CONFIG_LIBOW_MASTER_I2C \
  22. CONFIG_LIBOW_MASTER_W1 \
  23. CONFIG_LIBOW_ZEROCONF \
  24. CONFIG_LIBOW_DEBUG \
  25. CONFIG_LIBOW_OWTRAFFIC
  26. include $(INCLUDE_DIR)/package.mk
  27. #
  28. # templates
  29. #
  30. define Package/owfs/Default
  31. TITLE:=OWFS (1-Wire File System)
  32. URL:=https://github.com/owfs/owfs
  33. SECTION:=net
  34. CATEGORY:=Network
  35. SUBMENU:=Filesystem
  36. endef
  37. define Package/owfs/Default/description
  38. OWFS is a suite of programs that designed to make the 1-wire bus and its
  39. devices easily accessible. The underlying principle is to create a virtual
  40. filesystem, with the unique ID being the directory, and the individual
  41. properties of the device are represented as simple files that can be read
  42. and written.
  43. Details of the individual slave or master design are hidden behind a
  44. consistent interface. The goal is to provide an easy set of tools for a
  45. software designer to create monitoring or control applications. There are
  46. some performance enhancements in the implementation, including data caching,
  47. parallel access to bus masters, and aggregation of device communication.
  48. Still the fundemental goal has been ease of use, flexibility and correctness
  49. rather than speed.
  50. endef
  51. define Package/owfs/Server
  52. $(call Package/owfs/Default)
  53. DEPENDS:=+libow +libpthread
  54. endef
  55. define Package/owfs/Library
  56. $(call Package/owfs/Default)
  57. SECTION:=libs
  58. CATEGORY:=Libraries
  59. endef
  60. define Package/owfs/Utility
  61. $(call Package/owfs/Default)
  62. SECTION:=utils
  63. CATEGORY:=Utilities
  64. DEPENDS:=+libow
  65. endef
  66. #
  67. # shared libraries
  68. #
  69. define Package/libow
  70. $(call Package/owfs/Library)
  71. DEPENDS:= \
  72. +libpthread \
  73. +LIBOW_MASTER_USB:libusb-compat \
  74. +LIBOW_MASTER_W1:kmod-w1
  75. TITLE:=OWFS - common shared library
  76. endef
  77. define Package/libow/config
  78. source "$(SOURCE)/Config.in"
  79. endef
  80. define Package/libow/description
  81. $(call Package/owfs/Default/description)
  82. This package contains the OWFS library.
  83. endef
  84. define Package/libow-capi
  85. $(call Package/owfs/Library)
  86. DEPENDS:=+libow
  87. TITLE:=OWFS - C-API library
  88. endef
  89. define Package/libow-capi/description
  90. $(call Package/owfs/Default/description)
  91. This package contains the OWFS C-API library.
  92. endef
  93. #
  94. # utilities
  95. #
  96. define Package/owshell
  97. $(call Package/owfs/Utility)
  98. TITLE:=OWFS - shell utilities
  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. --disable-avahi \
  156. $(if $(CONFIG_LIBOW_MASTER_USB),--enable-usb,--disable-usb) \
  157. $(if $(CONFIG_LIBOW_MASTER_W1),--enable-w1,--disable-w1) \
  158. $(if $(CONFIG_LIBOW_MASTER_I2C),--enable-i2c,--disable-i2c) \
  159. $(if $(CONFIG_LIBOW_ZEROCONF),--enable-zero,--disable-zero) \
  160. $(if $(CONFIG_LIBOW_DEBUG),--enable-debug,--disable-debug) \
  161. $(if $(CONFIG_LIBOW_OWTRAFFIC),--enable-owtraffic,--disable-owtraffic)
  162. CONFIGURE_VARS += \
  163. LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -Wl,-rpath-link=$(TOOLCHAIN_DIR)/usr/lib" \
  164. lt_cv_sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
  165. lt_cv_sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
  166. shrext_cmds=".so" \
  167. MAKE_FLAGS += \
  168. CC="$(TARGET_CC)" \
  169. HOST_CPU="$(PKGARCH)"
  170. define Build/InstallDev
  171. $(INSTALL_DIR) $(STAGING_DIR)/usr/include
  172. $(CP) $(PKG_INSTALL_DIR)/usr/include/ow{capi,fs_config}.h $(STAGING_DIR)/usr/include/
  173. $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
  174. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow{,capi}*.so* $(STAGING_DIR)/usr/lib/
  175. endef
  176. define Package/owfs/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owfs $(1)/usr/bin/
  179. $(INSTALL_DIR) $(1)/etc/config
  180. $(INSTALL_DATA) ./files/owfs.conf $(1)/etc/config/owfs
  181. $(INSTALL_DIR) $(1)/etc/init.d
  182. $(INSTALL_BIN) ./files/owfs.init $(1)/etc/init.d/owfs
  183. mkdir -p $(1)/mnt/owfs
  184. endef
  185. define Package/owfs/conffiles
  186. /etc/config/owfs
  187. endef
  188. define Package/owshell/install
  189. $(INSTALL_DIR) $(1)/usr/bin
  190. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owget $(1)/usr/bin/
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owread $(1)/usr/bin/
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owwrite $(1)/usr/bin/
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owdir $(1)/usr/bin/
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owpresent $(1)/usr/bin/
  195. endef
  196. define Package/owserver/install
  197. $(INSTALL_DIR) $(1)/usr/bin
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owserver $(1)/usr/bin/
  199. $(INSTALL_DIR) $(1)/etc/config
  200. $(INSTALL_DATA) ./files/owserver.conf $(1)/etc/config/owserver
  201. $(INSTALL_DIR) $(1)/etc/init.d
  202. $(INSTALL_BIN) ./files/owserver.init $(1)/etc/init.d/owserver
  203. endef
  204. define Package/owserver/conffiles
  205. /etc/config/owserver
  206. endef
  207. define Package/owhttpd/install
  208. $(INSTALL_DIR) $(1)/usr/bin
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owhttpd $(1)/usr/bin/
  210. $(INSTALL_DIR) $(1)/etc/config
  211. $(INSTALL_DATA) ./files/owhttpd.conf $(1)/etc/config/owhttpd
  212. $(INSTALL_DIR) $(1)/etc/init.d
  213. $(INSTALL_BIN) ./files/owhttpd.init $(1)/etc/init.d/owhttpd
  214. endef
  215. define Package/owhttpd/conffiles
  216. /etc/config/owhttpd
  217. endef
  218. define Package/owftpd/install
  219. $(INSTALL_DIR) $(1)/usr/bin
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owftpd $(1)/usr/bin/
  221. $(INSTALL_DIR) $(1)/etc/config
  222. $(INSTALL_DATA) ./files/owftpd.conf $(1)/etc/config/owftpd
  223. $(INSTALL_DIR) $(1)/etc/init.d
  224. $(INSTALL_BIN) ./files/owftpd.init $(1)/etc/init.d/owftpd
  225. endef
  226. define Package/owftpd/conffiles
  227. /etc/config/owftpd
  228. endef
  229. define Package/libow/install
  230. $(INSTALL_DIR) $(1)/usr/lib
  231. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libow-*.so.* $(1)/usr/lib/
  232. endef
  233. define Package/libow-capi/install
  234. $(INSTALL_DIR) $(1)/usr/lib
  235. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libowcapi-*.so.* $(1)/usr/lib/
  236. endef
  237. $(eval $(call BuildPackage,owfs))
  238. $(eval $(call BuildPackage,owshell))
  239. $(eval $(call BuildPackage,owserver))
  240. $(eval $(call BuildPackage,owhttpd))
  241. $(eval $(call BuildPackage,owftpd))
  242. $(eval $(call BuildPackage,libow))
  243. $(eval $(call BuildPackage,libow-capi))