See the Gentoo Wiki for more information. "emerge openswan" will get the userland tools. The latest version is visible at packages.gentoo.org (2.2.0 at the time of this writing, with 2.3.0 marked unstable).
Matching kernel space is in gentoo-sources-2.4.26-r4 and higher.
Support is in the ebuild for both a 2.6 kernel (gentoo-dev-sources) and an ipsec patched 2.4 kernel. When using a 2.6 kernel, enable following kernel options under networking options section: PF_KEY sockets, AH transformation, ESP transformation, and IPComp transformation (will show up as CONFIG_NET_KEY, CONFIG_INET_AH, CONFIG_INET_ESP, and CONFIG_INET_IPCOMP in the kernel config)
Openswan 1.0.7 is provided for those needing 1.x *swan.