diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-09-16 17:54:50 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-09-16 17:54:50 +0000 |
commit | 02977d95c52c57b8f3079d83e73b90757ba047b9 (patch) | |
tree | bfc625fc917b0c3ac4dfcffec5a0ad2895d38c0b /net-firewall/ipsec-tools | |
parent | old (diff) | |
download | historical-02977d95c52c57b8f3079d83e73b90757ba047b9.tar.gz historical-02977d95c52c57b8f3079d83e73b90757ba047b9.tar.bz2 historical-02977d95c52c57b8f3079d83e73b90757ba047b9.zip |
Improve init.d script, bug #435174
Package-Manager: portage-2.1.11.9/cvs/Linux x86_64
Diffstat (limited to 'net-firewall/ipsec-tools')
-rw-r--r-- | net-firewall/ipsec-tools/ChangeLog | 8 | ||||
-rw-r--r-- | net-firewall/ipsec-tools/Manifest | 10 | ||||
-rw-r--r-- | net-firewall/ipsec-tools/files/racoon.init.d-r1 | 56 | ||||
-rw-r--r-- | net-firewall/ipsec-tools/ipsec-tools-0.8.0-r4.ebuild | 236 |
4 files changed, 305 insertions, 5 deletions
diff --git a/net-firewall/ipsec-tools/ChangeLog b/net-firewall/ipsec-tools/ChangeLog index d7113939e2dd..282fe4044bd4 100644 --- a/net-firewall/ipsec-tools/ChangeLog +++ b/net-firewall/ipsec-tools/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-firewall/ipsec-tools # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipsec-tools/ChangeLog,v 1.100 2012/08/05 20:08:33 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipsec-tools/ChangeLog,v 1.101 2012/09/16 17:54:50 blueness Exp $ + +*ipsec-tools-0.8.0-r4 (16 Sep 2012) + + 16 Sep 2012; Anthony G. Basile <blueness@gentoo.org> + +ipsec-tools-0.8.0-r4.ebuild, +files/racoon.init.d-r1: + Improve init.d script, bug #435174 05 Aug 2012; Anthony G. Basile <blueness@gentoo.org> ipsec-tools-0.8.0-r3.ebuild: diff --git a/net-firewall/ipsec-tools/Manifest b/net-firewall/ipsec-tools/Manifest index f242b05d8a3f..473db0728f2f 100644 --- a/net-firewall/ipsec-tools/Manifest +++ b/net-firewall/ipsec-tools/Manifest @@ -9,18 +9,20 @@ AUX psk.txt 293 SHA256 d34b142b4566712f87382caf0a64bcc070bbde17f16e2ee49d5dde26c AUX racoon.conf 772 SHA256 e00cea25741fa16aa985d80ce49f2a59af0c98a44707a047193e936644b497a3 SHA512 8876920331b4003fd096f1997e1266a12783120e390cea55ca283a8fd6485552b54e87f60e75f33409a4cdb99171d2358953287edd47ddeac8bda6da0cc8becc WHIRLPOOL 12c55b1f5e67592483c2602040454f7c0e511c4867b0ed1e7acb593d3ffd0b2b2bfe7a5defb900eb8759006b4382d8c3d891ace2472d772e223e68eb99bd72cc AUX racoon.conf.d 606 SHA256 a5bac8d1d84d11651027f4264a9adac85d18ea8f126abb504397a866695d2ddd SHA512 c2f12c2829e8f1852a81104feb6b5f4afa58394fa46b65347ec30d469a822b748d3e317023ec0f060c20242988692ab76eba52fdc5f473e393c563243ff53c1d WHIRLPOOL 58a48357c475e927cb3d659582bb8c9b8ae10f1164c1831300375694a33052454dd65a29a0c869f17915f3d36aa2772b64811f44920f57d9de8cf2eb5f3df485 AUX racoon.init.d 1314 SHA256 7c9447197032b30a2cb76a62179a3b0ef3768870c340adf4743976e7d65eba75 SHA512 ef882fde450ac1bd4ce4acfefa498699c1959d6a1fa9eb2ea210446007f8107c2203e5fb6c0ef5f21e7687479569bffe84a3815f32748fb103140fa2e8f3737a WHIRLPOOL d31da300e79211dff92568d9d6901b3cefaabbae57806b45f2e61031e11b4ba8afd53b3a2742e9174110291716a53910deb1a188da3ec279f5af2edcfa9281dc +AUX racoon.init.d-r1 1232 SHA256 d31ca0615464fbc8a3a2a6c6b308ab937e795ca6a1ca7d1a54eadff20caf9825 SHA512 1fa08aff6fe116e8c440600a23bb78385716ad6ab0e6b28d28d63516b9d67c6c592bcd876b198bf6bffa11efe97772399db66c1d2b57e9eaa494983495313f5e WHIRLPOOL d0b691de48313962b04e7a86aeeee1933b03fbbfe322e5e7662229a84d5d5d794bcbb51d0ef45160c25856ec4e1f4e15b435134ddea3378633f5116547c375d7 AUX racoon.pam.d 156 SHA256 166136e27d653e0bf481a6ca79fecb7d9fa2fc3d597d041f97df595f65a8193c SHA512 d3f7e6ca8c9f2b5060ebccb259316bb59c9a7e158e8ef9466765a20db263a4043a590811f1a3ab072b718dbd70898bc69b77e0b19603d7f394b5ac1bd0a4a56c WHIRLPOOL ba7a0a8c3bb39c5fda69de34b822a19696398e0a8789211ac1faae787ee34f9639eb35efe29c67f874b5f9fe674742503e570f441c005974f4a0c93468b8970b DIST ipsec-tools-0.7.3.tar.bz2 776096 SHA256 e6131d010b71d984194eb28267e6c01b49784a17a077bbafae58063f10b33b67 DIST ipsec-tools-0.8.0.tar.bz2 809297 SHA256 2359a24aa8eda9ca7043fc47950c8e6b7f58a07c5d5ad316aa7de2bc5e3a8717 SHA512 3bec6bab4fe555612f1d48966e797202830f5254a8d2146a14d268ff0c68445af790285214db41ab08ee4888625e8e680c3b848c30789d836169d1612a25fe2c WHIRLPOOL 862d2bbf78aca8c9e01e00c995aeb3b662e1ea4a769081b9880a3fee7821ef5968e10fe75d9671268979188c7ca3b91d507a1fc9a097729d0648bc4c965e675d EBUILD ipsec-tools-0.7.3-r1.ebuild 5494 SHA256 effba566f785bdd8ae09daf9cdbe8b3457a42dd134666c729f0ffb6822f146be SHA512 22a0ff2fe5b9f072ed3df5cc8ae420ebd28e91a02247bfe69d325aab76f2335b3921bc1e83c29a1dedda2ebddc747e7e0b1f24ad4d269a6d6e30743823b1e276 WHIRLPOOL 53d9d1d74ea96020fd9cbe5dc7a38ed6879dcf62333cf5ee08e21b14ad1ce358297e968c3ca870499091452483f51ff7edccaf94a7113aa5ef44b6d383ada231 EBUILD ipsec-tools-0.7.3.ebuild 8368 SHA256 f23d7469cbdc95fd0a1a4be9f4662be470aa2485130f169fd533576a498e9e94 SHA512 c8b5b1f9d647c75f6e8e167932dd02ebae767668772216d212ffa99b29b11bd0f79ae1c276c2367d4dfa8b6b5b614be62a16d67ab20942b542966a8ce68c58c2 WHIRLPOOL 8f17703b769c2cb4438279816c9e6aa3dd9c46b8e4a8e3a19a5d2f3c3bd297114a76db92bb5b9eae8716588eff6cca3af14655ef460cf8c7a5a24f95cf9d448f EBUILD ipsec-tools-0.8.0-r3.ebuild 6006 SHA256 42b79f3d22bdfe1b7920a006b41145dc85397dacdde543c0c78b68a03ad26cbc SHA512 8f6c9de64b3106bdbcf49353bb1c309bfa7dbdbea84cdcc85164385bc8a22a9784ffdbc8d46a2ae8991921a16f476a10d52ef384cd1f502e5d79f245c0fb2584 WHIRLPOOL 2e93081d6403c90b23b61641a7e8b0fd95b3ced657e0bf8a552a17388644ff06e2e8417b45a5589723cc8db5cdbefee3b4a11b888d890c2b31311efca060f558 -MISC ChangeLog 16136 SHA256 b7564abe8cdcfb177e778486ca87948e729af01727c5f2a3412697efbb3098ed SHA512 83d8e13c2fb1a57c56cc05c14382adff00cbbcd5bd82830a0a305b42a129c4c466a14c0ec860fd6adb800f07dc7ecae41194d8475d313522b94d635cd58b75d5 WHIRLPOOL 5207a8087a2e178694a4f65b6d053559ef06854e108a96c680f11137a42db460b31eb6680e7899eea853d93442508a977c96891fb9b7061312c55ebdc3b3041b +EBUILD ipsec-tools-0.8.0-r4.ebuild 6012 SHA256 234627faae33facc252c4676d8ee5d8658cd60866bff5a0132bba39bb0c0329a SHA512 e71660109a91c1d0768f13ebd2d50c4733fa083fe0027b3e7fb9974eb1e3848bd1268429a45069b662534db0de7e98696563ebca011461ed7f12353a9f957d5d WHIRLPOOL 04880638e4a9fda5d0f9d4381bb6fff4ce345a3bdf74db8e0f7a3e010ecb4b58ce9d04b97cab0d4325bbe1298ab0259bc0fd4d6fdc39b808b1d3e6094887d104 +MISC ChangeLog 16323 SHA256 c517ab1a22c9ad589231e451fba803cae03d413cac2f606436369b45f214ffff SHA512 07dd6c373f8bdf1961e8076cf260e9c36ebb671c9d49b2d601e3d263f8aa5f42b7fb3cba0cd948dd044f7514c8077c94e3d0dcc1e3f4c342f60388a9415316c1 WHIRLPOOL b721c5a67f6e5de046c4760adb32e931dc342642e09a1f2d9d3f5f1bb3a0bbdefa342bc45f0ab9dd6b90c3d1e801416bd34a4a7009e154d3b0a243c214572076 MISC metadata.xml 537 SHA256 12de55d6d62b8e91c8996422e33462b5637f9720a5096025752b93906bcbdc40 SHA512 9b26b2cd54e00527201339c3936ac717c57fe596e470d84e0dc0715f778b5797488b6cac61dea83bab61714a23a88e44dbd537bfeeb2b37d285653dcb838fab5 WHIRLPOOL a0dd0b61f957875ca3c50db5aa66470ed493be9c4f002bd165d75b41a8ca51cbcfd2567b4702bf1845b8e0a1ca54239e6ed163098d8b613d1f9f459192acc14e -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iEYEAREIAAYFAlAe0soACgkQl5yvQNBFVTVH0gCeJjAl5aO16la0EO1Zcwy+C/B+ -FPQAn3V1MfclmovAXC9rmpBuoFAX3vtL -=3B/x +iEYEAREIAAYFAlBWEnMACgkQl5yvQNBFVTVf9gCfaRNabBNDu6bZGwO2eJwhvpOZ +KOUAnjLfbfS4Io2UhyJK4Mj/1t/eRG+j +=PuVQ -----END PGP SIGNATURE----- diff --git a/net-firewall/ipsec-tools/files/racoon.init.d-r1 b/net-firewall/ipsec-tools/files/racoon.init.d-r1 new file mode 100644 index 000000000000..04b57522dbe7 --- /dev/null +++ b/net-firewall/ipsec-tools/files/racoon.init.d-r1 @@ -0,0 +1,56 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + before netmount + use net +} + +checkconfig() { + if [ ! -e ${SETKEY_CONF} ] ; then + eerror "You need to configure setkey before starting racoon." + return 1 + fi + if [ ! -e ${RACOON_CONF} ] ; then + eerror "You need a configuration file to start racoon." + return 1 + fi + if [ ! -z ${RACOON_PSK_FILE} ] ; then + if [ ! -f ${RACOON_PSK_FILE} ] ; then + eerror "PSK file not found as specified." + eerror "Set RACOON_PSK_FILE in /etc/conf.d/racoon." + return 1 + fi + case "`ls -Lldn ${RACOON_PSK_FILE}`" in + -r--------*) + ;; + *) + eerror "Your defined PSK file should be mode 400 for security!" + return 1 + ;; + esac + fi +} + +command=/usr/sbin/racoon +command_args="-f ${RACOON_CONF} ${RACOON_OPTS}" +pidfile=/var/run/racoon.pid + +start_pre() { + checkconfig || return 1 + einfo "Loading ipsec policies from ${SETKEY_CONF}." + /usr/sbin/setkey -f ${SETKEY_CONF} + if [ $? -eq 1 ] ; then + eerror "Error while loading ipsec policies" + fi +} + +stop_post() { + if [ -n "${RACOON_RESET_TABLES}" ]; then + ebegin "Flushing policy entries" + /usr/sbin/setkey -F + /usr/sbin/setkey -FP + eend $? + fi +} diff --git a/net-firewall/ipsec-tools/ipsec-tools-0.8.0-r4.ebuild b/net-firewall/ipsec-tools/ipsec-tools-0.8.0-r4.ebuild new file mode 100644 index 000000000000..6b3143d25013 --- /dev/null +++ b/net-firewall/ipsec-tools/ipsec-tools-0.8.0-r4.ebuild @@ -0,0 +1,236 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipsec-tools/ipsec-tools-0.8.0-r4.ebuild,v 1.1 2012/09/16 17:54:50 blueness Exp $ + +EAPI="4" + +inherit eutils flag-o-matic autotools linux-info pam + +DESCRIPTION="A port of KAME's IPsec utilities to the Linux-2.6 IPsec implementation" +HOMEPAGE="http://ipsec-tools.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86" +IUSE="hybrid idea ipv6 kerberos ldap nat pam rc5 readline selinux stats" + +RDEPEND=" + dev-libs/openssl + kerberos? ( virtual/krb5 ) + ldap? ( net-nds/openldap ) + pam? ( sys-libs/pam ) + readline? ( sys-libs/readline ) + selinux? ( + sys-libs/libselinux + sec-policy/selinux-ipsec + )" + +DEPEND="${RDEPEND} + >=sys-kernel/linux-headers-2.6.30" + +pkg_setup() { + linux-info_pkg_setup + + get_version + + if linux_config_exists && kernel_is -ge 2 6 19; then + ewarn + ewarn "\033[1;33m**************************************************\033[00m" + ewarn + ewarn "Checking kernel configuration in /usr/src/linux or" + ewarn "or /proc/config.gz for compatibility with ${PN}." + ewarn "Here are the potential problems:" + ewarn + + local nothing="1" + + # Check options for all flavors of IPSec + local msg="" + for i in XFRM_USER NET_KEY; do + if ! linux_chkconfig_present ${i}; then + msg="${msg} ${i}" + fi + done + if [[ ! -z "$msg" ]]; then + nothing="0" + ewarn + ewarn "ALL IPSec may fail. CHECK:" + ewarn "${msg}" + fi + + # Check unencrypted IPSec + if ! linux_chkconfig_present CRYPTO_NULL; then + nothing="0" + ewarn + ewarn "Unencrypted IPSec may fail. CHECK:" + ewarn " CRYPTO_NULL" + fi + + # Check IPv4 IPSec + msg="" + for i in \ + INET_IPCOMP INET_AH INET_ESP \ + INET_XFRM_MODE_TRANSPORT \ + INET_XFRM_MODE_TUNNEL \ + INET_XFRM_MODE_BEET + do + if ! linux_chkconfig_present ${i}; then + msg="${msg} ${i}" + fi + done + if [[ ! -z "$msg" ]]; then + nothing="0" + ewarn + ewarn "IPv4 IPSec may fail. CHECK:" + ewarn "${msg}" + fi + + # Check IPv6 IPSec + if use ipv6; then + msg="" + for i in INET6_IPCOMP INET6_AH INET6_ESP \ + INET6_XFRM_MODE_TRANSPORT \ + INET6_XFRM_MODE_TUNNEL \ + INET6_XFRM_MODE_BEET + do + if ! linux_chkconfig_present ${i}; then + msg="${msg} ${i}" + fi + done + if [[ ! -z "$msg" ]]; then + nothing="0" + ewarn + ewarn "IPv6 IPSec may fail. CHECK:" + ewarn "${msg}" + fi + fi + + # Check IPSec behind NAT + if use nat; then + if ! linux_chkconfig_present NETFILTER_XT_MATCH_POLICY; then + nothing="0" + ewarn + ewarn "IPSec behind NAT may fail. CHECK:" + ewarn " NETFILTER_XT_MATCH_POLICY" + fi + fi + + if [[ $nothing == "1" ]]; then + ewarn "NO PROBLEMS FOUND" + fi + + ewarn + ewarn "WARNING: If your *configured* and *running* kernel" + ewarn "differ either now or in the future, then these checks" + ewarn "may lead to misleading results." + ewarn + ewarn "\033[1;33m**************************************************\033[00m" + ewarn + else + eerror + eerror "\033[1;31m**************************************************\033[00m" + eerror "Make sure that your *running* kernel is/will be >=2.6.19." + eerror "Building ${PN} now, assuming that you know what you're doing." + eerror "\033[1;31m**************************************************\033[00m" + eerror + fi +} + +src_prepare() { + # fix for bug #124813 + sed -i 's:-Werror::g' "${S}"/configure.ac || die + # fix for building with gcc-4.6 + sed -i 's: -R: -Wl,-R:' "${S}"/configure.ac || die + + epatch "${FILESDIR}/${PN}-def-psk.patch" + epatch "${FILESDIR}/${PN}-include-vendoridh.patch" + + AT_M4DIR="${S}" eautoreconf + epunt_cxx +} + +src_configure() { + #--with-{iconv,libradius} lead to "Broken getaddrinfo()" + #--enable-samode-unspec is not supported in linux + local myconf + myconf="--with-kernel-headers=/usr/include \ + --enable-adminport \ + --enable-dependency-tracking \ + --enable-dpd \ + --enable-frag \ + --without-libiconv \ + --without-libradius \ + --disable-samode-unspec \ + $(use_enable idea) \ + $(use_enable ipv6) \ + $(use_enable kerberos gssapi) \ + $(use_with ldap libldap) \ + $(use_enable nat natt) \ + $(use_with pam libpam) \ + $(use_enable rc5) \ + $(use_with readline) \ + $(use_enable selinux security-context) \ + $(use_enable stats)" + + use nat && myconf="${myconf} --enable-natt-versions=yes" + + # enable mode-cfg and xauth support + if use pam; then + myconf="${myconf} --enable-hybrid" + else + myconf="${myconf} $(use_enable hybrid)" + fi + + econf ${myconf} +} + +src_install() { + emake DESTDIR="${D}" install + keepdir /var/lib/racoon + newconfd "${FILESDIR}"/racoon.conf.d racoon + newinitd "${FILESDIR}"/racoon.init.d-r1 racoon + use pam && newpamd "${FILESDIR}"/racoon.pam.d racoon + + insinto /etc + doins "${FILESDIR}"/ipsec.conf + insinto /etc/racoon + doins "${FILESDIR}"/racoon.conf + doins "${FILESDIR}"/psk.txt + chmod 400 "${D}"/etc/racoon/psk.txt + + dodoc ChangeLog README NEWS + dodoc -r src/racoon/samples + dodoc -r src/racoon/doc + docinto samples + newdoc src/setkey/sample.cf ipsec.conf +} + +pkg_postinst() { + if use nat; then + elog + elog "You have enabled the nat traversal functionnality." + elog "Nat versions wich are enabled by default are 00,02,rfc" + elog "you can find those drafts in the CVS repository:" + elog "cvs -d anoncvs@anoncvs.netbsd.org:/cvsroot co ipsec-tools" + elog + elog "If you feel brave enough and you know what you are" + elog "doing, you can consider emerging this ebuild with" + elog "EXTRA_ECONF=\"--enable-natt-versions=08,07,06\"" + elog + fi + + if use ldap; then + elog + elog "You have enabled ldap support with {$PN}." + elog "The man page does NOT contain any information on it yet." + elog "Consider using a more recent version or CVS." + elog + fi + + elog + elog "Please have a look in /usr/share/doc/${P} and visit" + elog "http://www.netbsd.org/Documentation/network/ipsec/" + elog "to find more information on how to configure this tool." + elog +} |