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.

206 lines
5.9 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. include $(INCLUDE_DIR)/package.mk
  30. include ../../lang/python/python3-package.mk
  31. CONFIGURE_ARGS += \
  32. --$(if $(CONFIG_GENSIO_SSL),with,without)-openssl \
  33. --$(if $(CONFIG_GENSIO_SCTP),with,without)-sctp \
  34. --$(if $(CONFIG_GENSIO_WRAP),with,without)-tcp-wrappers \
  35. --$(if $(CONFIG_GENSIO_PTHREADS),with,without)-pthreads \
  36. --$(if $(CONFIG_GENSIO_GLIB),with,without)-glib \
  37. --$(if $(CONFIG_GENSIO_TCL),with,without)-tcl \
  38. --without-openipmi \
  39. --with-cplusplus \
  40. --disable-doc
  41. CONFIGURE_VARS += \
  42. ac_cv_lib_avahi_client_avahi_client_new=$(if $(CONFIG_GENSIO_AVAHI),yes,no) \
  43. ac_cv_lib_pam_pam_start=$(if $(CONFIG_GENSIO_SSHD),yes,no)
  44. ifneq ($(CONFIG_PACKAGE_python3-gensio),)
  45. CONFIGURE_ARGS += \
  46. --with-swig \
  47. --with-python \
  48. --with-pythoninstall=$(PYTHON3_PKG_DIR)
  49. CONFIGURE_VARS += \
  50. PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --ldflags) -l${PYTHON3}" \
  51. PYTHON_CPPFLAGS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \
  52. PYTHON="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)"
  53. else
  54. CONFIGURE_ARGS += \
  55. --without-python \
  56. --without-swig
  57. endif
  58. define Package/gensio/Default
  59. TITLE:=Abstract stream I/O
  60. URL:=https://github.com/cminyard/gensio
  61. endef
  62. define Package/gensio/Default/description
  63. This project (pronounced gen'-see-oh) is used to abstract stream I/O
  64. like serial port, TCP, telnet, UDP, SSL, IPMI SOL etc and offers a
  65. framework for giving a consistent view of various stream (and packet)
  66. I/O types. You create a gensio object (or a gensio), and you can use
  67. that gensio without having to know too much about what is going on
  68. underneath. You can stack gensio on top of another one to add protocol
  69. funcionality. For instance, you can create a TCP gensio, stack SSL on
  70. top of that, and stack Telnet on top of that. It supports a number of
  71. network I/O and serial ports. Gensio can be used for sending and
  72. receiving ports, and it also supports establishing encrypted and
  73. authenticated connections.
  74. endef
  75. define Package/libgensio
  76. $(call Package/gensio/Default)
  77. TITLE+= (runtime files)
  78. SECTION:=libs
  79. CATEGORY:=Libraries
  80. ABI_VERSION:=0
  81. MENU:=1
  82. 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
  83. endef
  84. define Package/libgensio/description
  85. $(call Package/gensio/Default/description)
  86. .
  87. This package contains the runtime libraries.
  88. endef
  89. define Package/libgensio/config
  90. source "$(SOURCE)/Config.in"
  91. endef
  92. define Package/gensio-bin
  93. $(call Package/gensio/Default)
  94. TITLE+= (command-line tools)
  95. SECTION:=net
  96. CATEGORY:=Network
  97. MENU:=1
  98. DEPENDS:=+libgensio
  99. endef
  100. define Package/gensio-bin/description
  101. $(call Package/gensio/Default/description)
  102. .
  103. This package contains the command-line tools.
  104. endef
  105. define Package/gensio-bin/config
  106. source "$(SOURCE)/Config-bin.in"
  107. endef
  108. define Package/python3-gensio
  109. $(call Package/gensio/Default)
  110. TITLE+= (Python3-bindings)
  111. SECTION:=lang
  112. CATEGORY:=Languages
  113. BUILD_DEPENDS:=+swig +python3
  114. DEPENDS:=+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 +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))