gensio: disable cm108gpio gensio and prevent using libudev
[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 else
81 CONFIGURE_ARGS += \
82 --without-python \
83 --without-swig
84 endif
85
86 define Package/gensio/Default
87 TITLE:=Abstract stream I/O
88 URL:=https://github.com/cminyard/gensio
89 endef
90
91 define Package/gensio/Default/description
92 This project (pronounced gen'-see-oh) is used to abstract stream I/O
93 like serial port, TCP, telnet, UDP, SSL, IPMI SOL etc and offers a
94 framework for giving a consistent view of various stream (and packet)
95 I/O types. You create a gensio object (or a gensio), and you can use
96 that gensio without having to know too much about what is going on
97 underneath. You can stack gensio on top of another one to add protocol
98 funcionality. For instance, you can create a TCP gensio, stack SSL on
99 top of that, and stack Telnet on top of that. It supports a number of
100 network I/O and serial ports. Gensio can be used for sending and
101 receiving ports, and it also supports establishing encrypted and
102 authenticated connections.
103 endef
104
105 define Package/libgensio
106 $(call Package/gensio/Default)
107 TITLE+= (runtime files)
108 SECTION:=libs
109 CATEGORY:=Libraries
110 ABI_VERSION:=0
111 MENU:=1
112 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
113 endef
114
115 define Package/libgensio/description
116 $(call Package/gensio/Default/description)
117 .
118 This package contains the runtime libraries.
119 endef
120
121 define Package/libgensio/config
122 source "$(SOURCE)/Config.in"
123 endef
124
125 define Package/gensio-bin
126 $(call Package/gensio/Default)
127 TITLE+= (command-line tools)
128 SECTION:=net
129 CATEGORY:=Network
130 MENU:=1
131 DEPENDS:=+libgensio
132 endef
133
134 define Package/gensio-bin/description
135 $(call Package/gensio/Default/description)
136 .
137 This package contains the command-line tools.
138 endef
139
140 define Package/gensio-bin/config
141 source "$(SOURCE)/Config-bin.in"
142 endef
143
144 define Package/python3-gensio
145 $(call Package/gensio/Default)
146 TITLE+= (Python bindings)
147 SECTION:=lang
148 CATEGORY:=Languages
149 SUBMENU:=Python
150 DEPENDS:=+PACKAGE_python3-gensio:python3-light +libgensiocpp
151 endef
152
153 define Package/python3-gensio/description
154 $(call Package/gensio/Default/description)
155 .
156 This package contains the Python3-bindings for libgensio.
157 endef
158
159 define Package/libgensiocpp
160 $(call Package/gensio/Default)
161 TITLE+= (C++ - bindings)
162 SECTION:=libs
163 CATEGORY:=Libraries
164 ABI_VERSION:=0
165 DEPENDS:=+libgensio +PACKAGE_libgensiocpp:libstdcpp
166 endef
167
168 define Package/libgensiocpp/description
169 $(call Package/gensio/Default/description)
170 .
171 This package contains the C++ runtime files.
172 endef
173
174 define Build/InstallDev
175 $(INSTALL_DIR) $(1)/usr/include/gensio/
176 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/gensio/* $(1)/usr/include/gensio/
177 $(INSTALL_DIR) $(1)/usr/lib/gensio
178 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
179 $(CP) $(PKG_INSTALL_DIR)/usr/lib/gensio/* $(1)/usr/lib/gensio/
180 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
181 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
182 ifneq ($(CONFIG_PACKAGE_python3-gensio),)
183 $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
184 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.{so*,a,la} $(1)/$(PYTHON3_PKG_DIR)
185 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.py* $(1)/$(PYTHON3_PKG_DIR)
186 endif
187 endef
188
189 define Package/libgensio/install
190 $(INSTALL_DIR) $(1)/usr/lib/gensio
191 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensio.so.* $(1)/usr/lib/
192 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensioosh.so.* $(1)/usr/lib/
193 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensiomdns.so.* $(1)/usr/lib/
194 $(CP) $(PKG_INSTALL_DIR)/usr/lib/gensio/* $(1)/usr/lib/gensio/
195 ifeq ($(CONFIG_GENSIO_GLIB),y)
196 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensioglib.so.* $(1)/usr/lib/
197 endif
198 endef
199
200 define Package/gensio-bin/install
201 $(INSTALL_DIR) $(1)/usr/bin
202 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
203 ifeq ($(CONFIG_GENSIO_SSHD),y)
204 $(INSTALL_DIR) $(1)/usr/sbin
205 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
206 endif
207 endef
208
209 define Package/python3-gensio/install
210 $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
211 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.so* $(1)/$(PYTHON3_PKG_DIR)
212 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/*.py* $(1)/$(PYTHON3_PKG_DIR)
213
214 $(INSTALL_DIR) $(1)/usr/lib
215 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensio_python_swig.so.* $(1)/usr/lib/
216 endef
217
218 define Package/libgensiocpp/install
219 $(INSTALL_DIR) $(1)/usr/lib
220 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgensio*cpp.so.* $(1)/usr/lib/
221 endef
222
223 $(eval $(call BuildPackage,libgensio))
224 $(eval $(call BuildPackage,gensio-bin))
225 $(eval $(call BuildPackage,python3-gensio))
226 $(eval $(call BuildPackage,libgensiocpp))