diff --git a/packages/socat/0001-xioopts-conditionally-compile-applyopts_termios_valu.patch b/packages/socat/0001-xioopts-conditionally-compile-applyopts_termios_valu.patch new file mode 100644 index 00000000000..8ea4f0197f6 --- /dev/null +++ b/packages/socat/0001-xioopts-conditionally-compile-applyopts_termios_valu.patch @@ -0,0 +1,34 @@ +From c1fa329155c1b6805d64fcc7de4cb5c5ca80d387 Mon Sep 17 00:00:00 2001 +From: Kush Upadhyay +Date: Thu, 13 Jun 2024 15:27:14 +0000 +Subject: [PATCH] xioopts: conditionally compile applyopts_termios_value + function + +Signed-off-by: Kush Upadhyay +--- + xioopts.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xioopts.c b/xioopts.c +index 4b651aa..e957ba3 100644 +--- a/xioopts.c ++++ b/xioopts.c +@@ -4041,6 +4041,7 @@ int applyopt_spec( + return 0; + } + ++#if WITH_TERMIOS + int applyopts_termios_value( + int fd, + struct opt *opt) +@@ -4057,6 +4058,7 @@ int applyopts_termios_value( + } + return 0; + } ++#endif /* WITH_TERMIOS */ + + /* Note: not all options can be applied this way (e.g. OFUNC_SPEC with PH_OPEN) + implemented are: OFUNC_FCNTL, OFUNC_SOCKOPT (probably not all types), +-- +2.40.1 + diff --git a/packages/socat/Cargo.toml b/packages/socat/Cargo.toml new file mode 100644 index 00000000000..6c0e9948c45 --- /dev/null +++ b/packages/socat/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "socat" +version = "0.1.0" +edition = "2018" +publish = false +build = "../build.rs" + +[lib] +path = "../packages.rs" + +[[package.metadata.build-package.external-files]] +url = "http://www.dest-unreach.org/socat/download/socat-1.8.0.0.tar.gz" +sha512 = "edf459a9f1907a14025e13b3101ad29787f9a72795cffcd00017ce98847562884db29a95b9ae478a6a50868137548b142947c43fb18e975eb5853a763c42902c" + +[build-dependencies] +glibc = { path = "../glibc" } diff --git a/packages/socat/socat.spec b/packages/socat/socat.spec new file mode 100644 index 00000000000..eba6530fa79 --- /dev/null +++ b/packages/socat/socat.spec @@ -0,0 +1,84 @@ +Name: %{_cross_os}socat +Version: 1.8.0.0 +Release: 1%{?dist} +Summary: Transfer data between two channels +License: GPL-2.0-only +URL: http://www.dest-unreach.org/socat/ +Source0: http://www.dest-unreach.org/socat/download/socat-%{version}.tar.gz +Patch0001: 0001-xioopts-conditionally-compile-applyopts_termios_valu.patch + +BuildRequires: %{_cross_os}glibc-devel + +%description +%{summary}. + +%prep +%autosetup -n socat-%{version} -p0001 + +%build +%cross_configure \ + CFLAGS="-Wformat ${CFLAGS}" \ + --enable-help \ + --enable-ip4 \ + --enable-ip6 \ + --enable-listen \ + --enable-stdio \ + --enable-tcp \ + --enable-udp \ + --enable-unix \ + --disable-abstract-unixsocket \ + --disable-creat \ + --disable-dccp \ + --disable-exec \ + --disable-ext2 \ + --disable-fdnum \ + --disable-filan \ + --disable-file \ + --disable-fips \ + --disable-fs \ + --disable-genericsocket \ + --disable-gopen \ + --disable-interface \ + --disable-largefile \ + --disable-libwrap \ + --disable-namespaces \ + --disable-openssl \ + --disable-option-checking \ + --disable-pipe \ + --disable-posixmq \ + --disable-proxy \ + --disable-pty \ + --disable-rawip \ + --disable-readline \ + --disable-retry \ + --disable-sctp \ + --disable-shell \ + --disable-socketpair \ + --disable-socks4 \ + --disable-socks4a \ + --disable-stats \ + --disable-sycls \ + --disable-system \ + --disable-termios \ + --disable-tun \ + --disable-udplite \ + --disable-vsock \ + +%make_build + +%install +%make_install + +%files +%license COPYING +%{_cross_attribution_file} +%{_cross_bindir}/socat +%{_cross_bindir}/socat1 +%exclude %{_cross_bindir}/filan +%exclude %{_cross_bindir}/procan +%exclude %{_cross_bindir}/socat-broker.sh +%exclude %{_cross_bindir}/socat-chain.sh +%exclude %{_cross_bindir}/socat-mux.sh +%exclude %{_cross_mandir}/* + +%changelog diff --git a/variants/Cargo.lock b/variants/Cargo.lock index 3dcd84c3548..a8fa849aa35 100644 --- a/variants/Cargo.lock +++ b/variants/Cargo.lock @@ -28,6 +28,7 @@ dependencies = [ "kernel-6_1", "login", "release", + "socat", "soci-snapshotter", "strace", ] @@ -1220,6 +1221,13 @@ dependencies = [ name = "shim" version = "0.1.0" +[[package]] +name = "socat" +version = "0.1.0" +dependencies = [ + "glibc", +] + [[package]] name = "soci-snapshotter" version = "0.1.0" diff --git a/variants/aws-dev/Cargo.toml b/variants/aws-dev/Cargo.toml index 98180616aa9..5b925f8b7e7 100644 --- a/variants/aws-dev/Cargo.toml +++ b/variants/aws-dev/Cargo.toml @@ -37,6 +37,7 @@ included-packages = [ "strace", "chrony-tools", "soci-snapshotter", + "socat", ] [lib] @@ -56,3 +57,4 @@ iputils = { path = "../../packages/iputils" } strace = { path = "../../packages/strace" } chrony = { path = "../../packages/chrony" } soci-snapshotter = { path = "../../packages/soci-snapshotter" } +socat = { path = "../../packages/socat" }