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.

301 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:=3.2p3
  10. PKG_RELEASE:=2
  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_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:=https://github.com/owfs/owfs
  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. endef
  99. define Package/owshell/description
  100. $(call Package/owfs/Default/description)
  101. This package contains the OWFS shell utilities.
  102. endef
  103. define Package/owfs
  104. $(call Package/owfs/Utility)
  105. # libfuse depends on kmod-fuse, no need to declare dependency
  106. DEPENDS+= +libfuse +fuse-utils
  107. TITLE:=OWFS - fuse file system
  108. endef
  109. define Package/owfs/description
  110. $(call Package/owfs/Default/description)
  111. This package contains the OWFS fuse filesystem.
  112. endef
  113. #
  114. # network daemons
  115. #
  116. define Package/owhttpd
  117. $(call Package/owfs/Server)
  118. TITLE:=OWFS - http server
  119. endef
  120. define Package/owhttpd/description
  121. $(call Package/owfs/Default/description)
  122. This package contains the OWFS http server.
  123. endef
  124. define Package/owftpd
  125. $(call Package/owfs/Server)
  126. TITLE:=OWFS - ftp server
  127. endef
  128. define Package/owftpd/description
  129. $(call Package/owfs/Default/description)
  130. This package contains the OWFS ftp server.
  131. endef
  132. define Package/owserver
  133. $(call Package/owfs/Server)
  134. TITLE:=OWFS - network server
  135. endef
  136. define Package/owserver/description
  137. $(call Package/owfs/Default/description)
  138. This package contains the OWFS network server.
  139. endef
  140. CONFIGURE_ARGS += \
  141. --enable-owftpd \
  142. --enable-owserver \
  143. --enable-owhttpd \
  144. --enable-owfs \
  145. --with-fuseinclude="$(STAGING_DIR)/usr/include" \
  146. --with-fuselib="$(STAGING_DIR)/usr/lib" \
  147. --enable-shared \
  148. --disable-parport \
  149. --disable-ownet \
  150. --disable-owpython \
  151. --disable-owphp \
  152. --disable-owtcl \
  153. --disable-swig \
  154. --disable-avahi \
  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))