Signed-off-by: Jon Ringle <[email protected]> --- rules/socat.in | 57 ++++++++++++++++++++++++++ rules/socat.make | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+), 0 deletions(-) create mode 100644 rules/socat.in create mode 100644 rules/socat.make
diff --git a/rules/socat.in b/rules/socat.in new file mode 100644 index 0000000..f308e1f --- /dev/null +++ b/rules/socat.in @@ -0,0 +1,57 @@ +## SECTION=networking + +config SOCAT + tristate + prompt "socat" + help + socat is a relay for bidirectional data transfer between two independent data + channels. Each of these data channels may be a file, pipe, device (serial line + etc. or a pseudo terminal), a socket (UNIX, IP4, IP6 - raw, UDP, TCP), an + SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU + line editor (readline), a program, or a combination of two of these. + These modes include generation of "listening" sockets, named pipes, and pseudo + terminals. + + socat can be used, e.g., as TCP port forwarder (one-shot or daemon), as an + external socksifier, for attacking weak firewalls, as a shell interface to UNIX + sockets, IP6 relay, for redirecting TCP oriented programs to a serial line, to + logically connect serial lines on different computers, or to establish a + relatively secure environment (su and chroot) for running client or server + shell scripts with network connections. + + Many options are available to refine socats behaviour: + terminal parameters, open() options, file permissions, file and process owners, + basic socket options like bind address, advanced socket options like IP source + routing, linger, TTL, TOS (type of service), or TCP performance tuning. + + More capabilities, like daemon mode with forking, client address check, + "tail -f" mode, some stream data processing (line terminator conversion), + choosing sockets, pipes, or ptys for interprocess communication, debug and + trace options, logging to syslog, stderr or file, and last but not least + precise error messages make it a versatile tool for many different purposes. + + In fact, many of these features already exist in specialized tools; but until + now, there does not seem to exists another tool that provides such a generic, + flexible, simple and almost comprehensive (UNIX) byte stream connector. + +if SOCAT +config SOCAT_PREDEF_CRDLY_SHIFT + string "CRDLY_SHIFT" + default "9" + help + Add configure variable + +config SOCAT_PREDEF_TABDLY_SHIFT + string "TABDLY_SHIFT" + default "11" + help + Add configure variable + +config SOCAT_PREDEF_CSIZE_SHIFT + string "CSIZE_SHIFT" + default "4" + help + Add configure variable + +endif + diff --git a/rules/socat.make b/rules/socat.make new file mode 100644 index 0000000..01008bb --- /dev/null +++ b/rules/socat.make @@ -0,0 +1,117 @@ +# -*-makefile-*- +# +# Copyright (C) 2009 by Jon Ringle +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SOCAT) += socat + +# +# Paths and names +# +SOCAT_VERSION := 1.7.1.1 +SOCAT := socat-$(SOCAT_VERSION) +SOCAT_SUFFIX := tar.bz2 +SOCAT_URL := http://www.dest-unreach.org/socat/download/$(SOCAT).$(SOCAT_SUFFIX) +SOCAT_SOURCE := $(SRCDIR)/$(SOCAT).$(SOCAT_SUFFIX) +SOCAT_DIR := $(BUILDDIR)/$(SOCAT) +SOCAT_LICENSE := unknown + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(SOCAT_SOURCE): + @$(call targetinfo) + @$(call get, SOCAT) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +SOCAT_PATH := PATH=$(CROSS_PATH) +SOCAT_ENV := $(CROSS_ENV) + +# +# autoconf +# +SOCAT_AUTOCONF := $(CROSS_AUTOCONF_USR) +ifneq ($(PTXCONF_SOCAT_PREDEF_CRDLY_SHIFT),) +SOCAT_AUTOCONF += sc_cv_sys_crdly_shift=$(PTXCONF_SOCAT_PREDEF_CRDLY_SHIFT) +endif +ifneq ($(PTXCONF_SOCAT_PREDEF_TABDLY_SHIFT),) +SOCAT_AUTOCONF += sc_cv_sys_tabdly_shift=$(PTXCONF_SOCAT_PREDEF_TABDLY_SHIFT) +endif +ifneq ($(PTXCONF_SOCAT_PREDEF_CSIZE_SHIFT),) +SOCAT_AUTOCONF += sc_cv_sys_csize_shift=$(PTXCONF_SOCAT_PREDEF_CSIZE_SHIFT) +endif + +$(STATEDIR)/socat.prepare: + @$(call targetinfo) + @$(call clean, $(SOCAT_DIR)/config.cache) + (cd $(SOCAT_DIR); \ + $(SOCAT_PATH) $(SOCAT_ENV) \ + ./configure $(SOCAT_AUTOCONF); \ + sed -i 's/#define HAVE_TERMIOS_ISPEED 1/#undef HAVE_TERMIOS_ISPEED/g' config.h \ + ) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +#$(STATEDIR)/socat.compile: +# @$(call targetinfo) +# cd $(SOCAT_DIR) && $(SOCAT_PATH) $(MAKE) $(PARALLELMFLAGS) +# @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +#$(STATEDIR)/socat.install: +# @$(call targetinfo) +# @$(call install, SOCAT) +# @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/socat.targetinstall: + @$(call targetinfo) + + @$(call install_init, socat) + @$(call install_fixup, socat,PACKAGE,socat) + @$(call install_fixup, socat,PRIORITY,optional) + @$(call install_fixup, socat,VERSION,$(SOCAT_VERSION)) + @$(call install_fixup, socat,SECTION,base) + @$(call install_fixup, socat,AUTHOR,"Jon Ringle") + @$(call install_fixup, socat,DEPENDS,) + @$(call install_fixup, socat,DESCRIPTION,missing) + + @$(call install_copy, socat, 0, 0, 0755, $(SOCAT_DIR)/socat, /usr/bin/socat) + @$(call install_copy, socat, 0, 0, 0755, $(SOCAT_DIR)/procan, /usr/bin/procan) + @$(call install_copy, socat, 0, 0, 0755, $(SOCAT_DIR)/filan, /usr/bin/filan) + + @$(call install_finish, socat) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +socat_clean: + rm -rf $(STATEDIR)/socat.* + rm -rf $(PKGDIR)/socat_* + rm -rf $(SOCAT_DIR) + +# vim: syntax=make -- 1.7.0.2.182.ge007 -- ptxdist mailing list [email protected]
