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.2p4
  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:=af0a5035f3f3df876ca15aea13486bfed6b3ef5409dee016db0be67755c35fcc
  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. 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))