Merge pull request #16244 from erdoukki/crowdsec
[feed/packages.git] / net / socat / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=socat
9 PKG_VERSION:=1.7.4.1
10 PKG_RELEASE:=1
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download
14 PKG_HASH:=3faca25614e89123dff5045680549ecef519d02e331aaf3c4f5a8f6837c675e9
15
16 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
17 PKG_LICENSE:=GPL-2.0-or-later OpenSSL
18 PKG_LICENSE_FILES:=COPYING COPYING.OpenSSL
19 PKG_CPE_ID:=cpe:/a:dest-unreach:socat
20
21 PKG_INSTALL:=1
22 PKG_BUILD_PARALLEL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/socat
27 SECTION:=net
28 CATEGORY:=Network
29 DEPENDS:=+libpthread +librt +SOCAT_SSL:libopenssl
30 TITLE:=A multipurpose relay (SOcket CAT)
31 URL:=http://www.dest-unreach.org/socat/
32 endef
33
34 define Package/socat/description
35 SoCat (for SOcket CAT) establishes two bidirectional byte streams and
36 transfers data between them.
37 Data channels may be files, pipes, devices (terminal or modem, etc.), or
38 sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking,
39 logging and tracing, different modes for interprocess communication and
40 many more options.
41 endef
42
43 define Package/socat/config
44 config SOCAT_SSL
45 bool "SSL support"
46 depends on PACKAGE_socat
47 default n
48 help
49 Implements SSL support in socat (using libopenssl).
50 endef
51
52 define Package/socat/conffiles
53 /etc/config/socat
54 endef
55
56 CONFIGURE_ARGS += \
57 --disable-libwrap \
58 --disable-readline \
59 --enable-termios
60
61 ifneq ($(CONFIG_SOCAT_SSL),y)
62 CONFIGURE_ARGS+= --disable-openssl
63 endif
64
65 # PowerPC has different TERMIOS bits
66 ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
67 CONFIGURE_VARS += \
68 sc_cv_sys_crdly_shift=12 \
69 sc_cv_sys_tabdly_shift=10 \
70 sc_cv_sys_csize_shift=8
71 else
72 CONFIGURE_VARS += \
73 sc_cv_sys_crdly_shift=9 \
74 sc_cv_sys_tabdly_shift=11 \
75 sc_cv_sys_csize_shift=4
76 endif
77
78 CONFIGURE_VARS += \
79 sc_cv_termios_ispeed="no" \
80 ac_cv_header_bsd_libutil_h=no \
81 ac_cv_lib_bsd_openpty=no \
82 BUILD_DATE=$(SOURCE_DATE_EPOCH)
83
84 define Package/socat/install
85 $(INSTALL_DIR) $(1)/usr/bin
86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/socat $(1)/usr/bin/
87 $(INSTALL_DIR) $(1)/etc/config
88 $(INSTALL_CONF) ./files/socat.config $(1)/etc/config/socat
89 $(INSTALL_DIR) $(1)/etc/init.d
90 $(INSTALL_BIN) ./files/socat.init $(1)/etc/init.d/socat
91 endef
92
93 $(eval $(call BuildPackage,socat))