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