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