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.

207 lines
6.0 KiB

  1. #
  2. # Copyright (C) 2022 Nita Vesa (werecatf@outlook.com)
  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:=gensio
  9. PKG_VERSION:=2.3.5
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@SF/ser2net
  13. PKG_HASH:=e9943b392ba85bdc13063059125794554f07e569d8ca0afd38f773a390f5f234
  14. PKG_LICENSE:=GPL-2.0-or-later
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Nita Vesa <werecatf@outlook.com>
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. PYTHON3_PKG_BUILD:=0
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_GENSIO_SSL \
  22. CONFIG_GENSIO_WRAP \
  23. CONFIG_GENSIO_SCTP \
  24. CONFIG_GENSIO_PTHREADS \
  25. CONFIG_GENSIO_AVAHI \
  26. CONFIG_GENSIO_GLIB \
  27. CONFIG_GENSIO_TCL \
  28. CONFIG_GENSIO_SSHD
  29. PKG_BUILD_DEPENDS:=PACKAGE_python3-gensio:swig
  30. include $(INCLUDE_DIR)/package.mk
  31. include ../../lang/python/python3-package.mk
  32. CONFIGURE_ARGS += \
  33. --$(if $(CONFIG_GENSIO_SSL),with,without)-openssl \
  34. --$(if $(CONFIG_GENSIO_SCTP),with,without)-sctp \
  35. --$(if $(CONFIG_GENSIO_WRAP),with,without)-tcp-wrappers \
  36. --$(if $(CONFIG_GENSIO_PTHREADS),with,without)-pthreads \
  37. --$(if $(CONFIG_GENSIO_GLIB),with,without)-glib \
  38. --$(if $(CONFIG_GENSIO_TCL),with,without)-tcl \
  39. --without-openipmi \
  40. --with-cplusplus \
  41. --disable-doc
  42. CONFIGURE_VARS += \
  43. ac_cv_lib_avahi_client_avahi_client_new=$(if $(CONFIG_GENSIO_AVAHI),yes,no) \
  44. ac_cv_lib_pam_pam_start=$(if $(CONFIG_GENSIO_SSHD),yes,no)
  45. ifneq ($(CONFIG_PACKAGE_python3-gensio),)
  46. CONFIGURE_ARGS += \
  47. --with-swig \
  48. --with-python \
  49. --with-pythoninstall=$(PYTHON3_PKG_DIR)
  50. CONFIGURE_VARS += \
  51. PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --ldflags) -l${PYTHON3}" \
  52. PYTHON_CPPFLAGS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \
  53. PYTHON="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)"
  54. else
  55. CONFIGURE_ARGS += \
  56. --without-python \
  57. --without-swig
  58. endif
  59. define Package/gensio/Default
  60. TITLE:=Abstract stream I/O
  61. URL:=https://github.com/cminyard/gensio
  62. endef
  63. define Package/gensio/Default/description
  64. This project (pronounced gen'-see-oh) is used to abstract stream I/O
  65. like serial port, TCP, telnet, UDP, SSL, IPMI SOL etc and offers a
  66. framework for giving a consistent view of various stream (and packet)
  67. I/O types. You create a gensio object (or a gensio), and you can use
  68. that gensio without having to know too much about what is going on
  69. underneath. You can stack gensio on top of another one to add protocol
  70. funcionality. For instance, you can create a TCP gensio, stack SSL on
  71. top of that, and stack Telnet on top of that. It supports a number of
  72. network I/O and serial ports. Gensio can be used for sending and
  73. receiving ports, and it also supports establishing encrypted and
  74. authenticated connections.
  75. endef
  76. define Package/libgensio
  77. $(call Package/gensio/Default)
  78. TITLE+= (runtime files)
  79. SECTION:=libs
  80. CATEGORY:=Libraries
  81. ABI_VERSION:=0
  82. MENU:=1
  83. DEPENDS:=+GENSIO_SSL:libopenssl +GENSIO_WRAP:libwrap +GENSIO_SCTP:libsctp +GENSIO_PTHREADS:libpthread +GENSIO_AVAHI:libavahi-client +GENSIO_TCL:tcl +GENSIO_GLIB:glib2 +GENSIO_SSHD:libpam
  84. endef
  85. define Package/libgensio/description
  86. $(call Package/gensio/Default/description)
  87. .
  88. This package contains the runtime libraries.
  89. endef
  90. define Package/libgensio/config
  91. source "$(SOURCE)/Config.in"
  92. endef
  93. define Package/gensio-bin
  94. $(call Package/gensio/Default)
  95. TITLE+= (command-line tools)
  96. SECTION:=net
  97. CATEGORY:=Network
  98. MENU:=1
  99. DEPENDS:=+libgensio
  100. endef
  101. define Package/gensio-bin/description
  102. $(call Package/gensio/Default/description)
  103. .
  104. This package contains the command-line tools.
  105. endef
  106. define Package/gensio-bin/config
  107. source "$(SOURCE)/Config-bin.in"
  108. endef
  109. define Package/python3-gensio
  110. $(call Package/gensio/Default)
  111. TITLE+= (Python3-bindings)
  112. SECTION:=lang
  113. CATEGORY:=Languages
  114. DEPENDS:=+PACKAGE_python3-gensio:python3-light +libgensio
  115. endef
  116. define Package/python3-gensio/description
  117. $(call Package/gensio/Default/description)
  118. .
  119. This package contains the Python3-bindings for libgensio.
  120. endef
  121. define Package/libgensiocpp
  122. $(call Package/gensio/Default)
  123. TITLE+= (C++ - bindings)
  124. SECTION:=libs
  125. CATEGORY:=Libraries
  126. ABI_VERSION:=0
  127. DEPENDS:=+libgensio +PACKAGE_libgensiocpp:libstdcpp
  128. endef
  129. define Package/libgensiocpp/description
  130. $(call Package/gensio/Default/description)
  131. .
  132. This package contains the C++ runtime files.
  133. endef
  134. define Build/InstallDev
  135. $(INSTALL_DIR) $(1)/usr/include/gensio/
  136. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/gensio/* $(1)/usr/include/gensio/
  137. $(INSTALL_DIR) $(1)/usr/lib/
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
  139. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  140. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  141. ifneq ($(CONFIG_PACKAGE_python3-gensio),)
  142. $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
  143. $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.{so*,a,la} $(1)/$(PYTHON3_PKG_DIR)
  144. $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.py* $(1)/$(PYTHON3_PKG_DIR)
  145. endif
  146. endef
  147. define Package/libgensio/install
  148. $(INSTALL_DIR) $(1)/usr/lib
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensio.so.* $(1)/usr/lib/
  150. ifeq ($(CONFIG_GENSIO_GLIB),y)
  151. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensioglib.so.* $(1)/usr/lib/
  152. endif
  153. endef
  154. define Package/gensio-bin/install
  155. $(INSTALL_DIR) $(1)/usr/bin
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  157. ifeq ($(CONFIG_GENSIO_SSHD),y)
  158. $(INSTALL_DIR) $(1)/usr/sbin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  160. endif
  161. endef
  162. define Package/python3-gensio/install
  163. $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
  164. $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.so* $(1)/$(PYTHON3_PKG_DIR)
  165. $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.py* $(1)/$(PYTHON3_PKG_DIR)
  166. $(INSTALL_DIR) $(1)/usr/lib
  167. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensio_python_swig.so.* $(1)/usr/lib/
  168. endef
  169. define Package/libgensiocpp/install
  170. $(INSTALL_DIR) $(1)/usr/lib
  171. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensiocpp.so.* $(1)/usr/lib/
  172. endef
  173. $(eval $(call BuildPackage,libgensio))
  174. $(eval $(call BuildPackage,gensio-bin))
  175. $(eval $(call BuildPackage,python3-gensio))
  176. $(eval $(call BuildPackage,libgensiocpp))