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