# ChangeLog for net-misc/openvpn
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.104 2007/02/07 10:36:09 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.105 2007/02/23 11:44:20 uberlord Exp $
+
+*openvpn-2.1_rc1-r2 (23 Feb 2007)
+*openvpn-2.0.7-r2 (23 Feb 2007)
+
+ 23 Feb 2007; Roy Marples <uberlord@gentoo.org> files/openvpn-2.1.init,
+ files/down.sh, files/openvpn.init, files/up.sh, +openvpn-2.0.7-r2.ebuild,
+ +openvpn-2.1_rc1-r2.ebuild:
+ Init scripts no longer require bash.
07 Feb 2007; Roy Marples <uberlord@gentoo.org> files/down.sh, files/up.sh:
up.sh and down.sh no longer require bash.
-AUX down.sh 850 RMD160 9dac1eec04d0de77462d4444a088f63a1aa107b9 SHA1 fad140e43f7ca079d08abaafda6316ee4451feb6 SHA256 f3188619fe84cc9b87ae28bf5e465618a4951f233b4df37b9cfa1993f32624be
-MD5 e5a5c7781fbfb7e8250bb9cfd140c727 files/down.sh 850
-RMD160 9dac1eec04d0de77462d4444a088f63a1aa107b9 files/down.sh 850
-SHA256 f3188619fe84cc9b87ae28bf5e465618a4951f233b4df37b9cfa1993f32624be files/down.sh 850
+AUX down.sh 855 RMD160 0fed7862ed257e13ee93a9c29750eb26c4b83e68 SHA1 e14110015b89ab24b4bfa1b4e91d66bc1e54ea3b SHA256 b06bdbc9b8f9d3b4575fd20f69792625f1b65fcae0d92ad904778bdfb84a7457
+MD5 c777a06955c64fe15f78a9a456abe13b files/down.sh 855
+RMD160 0fed7862ed257e13ee93a9c29750eb26c4b83e68 files/down.sh 855
+SHA256 b06bdbc9b8f9d3b4575fd20f69792625f1b65fcae0d92ad904778bdfb84a7457 files/down.sh 855
AUX openvpn-2.0.4-darwin.patch 717 RMD160 66aa5ea349329cf3e6089aa75eb7c80e0d21063b SHA1 ca21fbc61b78d893699b6bf4fb40eb2735db28c8 SHA256 ad70b77c10bb57a07af3d512e953fc8b5a07108df5bf9795e0cb12e1ba2b2136
MD5 9f0fcb64287dc55bb770ca86415e5cdd files/openvpn-2.0.4-darwin.patch 717
RMD160 66aa5ea349329cf3e6089aa75eb7c80e0d21063b files/openvpn-2.0.4-darwin.patch 717
MD5 3960920a53d3398558b984d2952b6aa6 files/openvpn-2.0.7-persistent.patch 1857
RMD160 b3232feb19810ac405cd7af6bb692ed03f9c44c2 files/openvpn-2.0.7-persistent.patch 1857
SHA256 51de714f2191ac3ea59a7f7c5a0aa1c0bf15ee5d79ace10f2276d415cd0f59e0 files/openvpn-2.0.7-persistent.patch 1857
-AUX openvpn-2.1.init 4030 RMD160 2fd09ed8b13bdd3cc7010c8101b4df02c3c0563f SHA1 9321aa3acf0440b17bbd97cb8c3f7de68bd05122 SHA256 5fcdb3c7b27584d9a3167e3794fec77b8657814408287ef12fcb58996d66b7da
-MD5 7de21271f38af5f627ec66cc766831b9 files/openvpn-2.1.init 4030
-RMD160 2fd09ed8b13bdd3cc7010c8101b4df02c3c0563f files/openvpn-2.1.init 4030
-SHA256 5fcdb3c7b27584d9a3167e3794fec77b8657814408287ef12fcb58996d66b7da files/openvpn-2.1.init 4030
+AUX openvpn-2.1.init 3892 RMD160 4ddd5afde46f8f7c5dc953bc4a01bc8466e28809 SHA1 45059c62edd225c2cc447a0648932680e9acfb23 SHA256 361224ecf68000e7de2492b0e681a3bc61339c2ae0c629111a54aff562b1703c
+MD5 39328399810ebab35dd58f564c64d51a files/openvpn-2.1.init 3892
+RMD160 4ddd5afde46f8f7c5dc953bc4a01bc8466e28809 files/openvpn-2.1.init 3892
+SHA256 361224ecf68000e7de2492b0e681a3bc61339c2ae0c629111a54aff562b1703c files/openvpn-2.1.init 3892
AUX openvpn-2.1_rc1-persistent.patch 1977 RMD160 44a70845a1dac1f169fdf5f45d927709389d3166 SHA1 04dd0226e9ca71a3d4fee4e9338c4a07206f3167 SHA256 e1e1426aee7b17e784a8477d5efef1a262afd9cd124950d6a8f314c17cdb95c4
MD5 c5392cca1d5862f58bac2a8f40ed5b58 files/openvpn-2.1_rc1-persistent.patch 1977
RMD160 44a70845a1dac1f169fdf5f45d927709389d3166 files/openvpn-2.1_rc1-persistent.patch 1977
SHA256 e1e1426aee7b17e784a8477d5efef1a262afd9cd124950d6a8f314c17cdb95c4 files/openvpn-2.1_rc1-persistent.patch 1977
-AUX openvpn.init 1457 RMD160 233cf3953ee341f025a9bc863e7ad0fac91369ab SHA1 b625de203e357b5e2a8d276c36e2fecc31946c1a SHA256 bfb8ac1e2d8a7d2a0313741e45f6e14ab4076581ba4166709dbe05ab110cb80a
-MD5 35cb74384ed5232c68dbf19f9107bd8e files/openvpn.init 1457
-RMD160 233cf3953ee341f025a9bc863e7ad0fac91369ab files/openvpn.init 1457
-SHA256 bfb8ac1e2d8a7d2a0313741e45f6e14ab4076581ba4166709dbe05ab110cb80a files/openvpn.init 1457
-AUX up.sh 1657 RMD160 5df34061627485c43960bb295a158b65cdeca53e SHA1 4f3c072f00d317d8ec347ba2d01d5a568c424403 SHA256 31153327cb020850277802ce3fc74234bba316457ce51905c1e0fe7ae61de65c
-MD5 b27118ce5849886814d9190a977823c8 files/up.sh 1657
-RMD160 5df34061627485c43960bb295a158b65cdeca53e files/up.sh 1657
-SHA256 31153327cb020850277802ce3fc74234bba316457ce51905c1e0fe7ae61de65c files/up.sh 1657
+AUX openvpn.init 1461 RMD160 5b1e41f449e287fc2629c2ecef28f7437d10eb74 SHA1 756afc52a29aae1bc41e5eb43f5604e4d9e39112 SHA256 81782885fe6b65434404e4d5875071cb9a4c70914f25c71826290bb265ab109e
+MD5 8f8bae9823ceafe8b9a1ac24bb4a23da files/openvpn.init 1461
+RMD160 5b1e41f449e287fc2629c2ecef28f7437d10eb74 files/openvpn.init 1461
+SHA256 81782885fe6b65434404e4d5875071cb9a4c70914f25c71826290bb265ab109e files/openvpn.init 1461
+AUX up.sh 1665 RMD160 c66e7436aa2205e9e730e9d5c14bec1c863386fa SHA1 f7fd7df33323f21ac1ca9788b9d134d0d925aeca SHA256 e9ea6cfc963e5d90c1b233274de8c4992e8557cea9d3892c01356c2d234bc6ff
+MD5 a17c9563cf8d44d2938b4b95d26cb888 files/up.sh 1665
+RMD160 c66e7436aa2205e9e730e9d5c14bec1c863386fa files/up.sh 1665
+SHA256 e9ea6cfc963e5d90c1b233274de8c4992e8557cea9d3892c01356c2d234bc6ff files/up.sh 1665
DIST openvpn-2.0.6.tar.gz 664816 RMD160 cf3cd807bb657baf317e896b57900958cf442a63 SHA1 046f3811831a06e4fbc9c64544faaecf04547ae5 SHA256 1074c9fb5a7881e6d4ff0b125cf1e44a9fb650beef187f061785698522453003
DIST openvpn-2.0.7.tar.gz 665129 RMD160 b89f6df5ff08326f4e07e6cd4abda633627ef9e4 SHA1 74a4d19e42ca226f50ab5bdba16aa4a130c5e431 SHA256 9e29ebfb76375379b4ca12c2270dff3b4b1636eb643747c69249ae206833052e
DIST openvpn-2.1_rc1.tar.gz 796620 RMD160 751d07c3b9b40cc3c9a1649ad8b10b9d889a5690 SHA1 252715678c8d2c5d708267e7947cf89242209f0a SHA256 b5eb4f0d4eda58aaa8b60eb1b2f1d1a0d55ca22e9b098a2f65b6f44abc1c9e11
MD5 51d7c94dfc4a3c7994a464d09bcbcbef openvpn-2.0.7-r1.ebuild 4210
RMD160 c0fbb1a09b279e9b43d5fe685595ffb2d9075d07 openvpn-2.0.7-r1.ebuild 4210
SHA256 d9688d1fb1856926e48985aed2eb14283c71247773224e886c096d5ea87fb193 openvpn-2.0.7-r1.ebuild 4210
+EBUILD openvpn-2.0.7-r2.ebuild 4209 RMD160 89c2cd995fa9737cdf8c4ec99dc2e757f0d7fbfb SHA1 ce1d097f66be475a6690cd9f6aa9c7c730c560f2 SHA256 75a3b316adb34e6ac9546c8de5d0fa39aec1a104aee7c7fcb9f854b5891a5498
+MD5 cddab539e8f3fee2bc38dc18ea54f391 openvpn-2.0.7-r2.ebuild 4209
+RMD160 89c2cd995fa9737cdf8c4ec99dc2e757f0d7fbfb openvpn-2.0.7-r2.ebuild 4209
+SHA256 75a3b316adb34e6ac9546c8de5d0fa39aec1a104aee7c7fcb9f854b5891a5498 openvpn-2.0.7-r2.ebuild 4209
EBUILD openvpn-2.0.7.ebuild 4163 RMD160 319a6802dedbe00d538d5c8fd9162d7d291ba291 SHA1 a84f36bd6e88da0547ec5708cb02d4d2b7ed0164 SHA256 451a955d927928a68400e6d320ced315b1597cc56a91d474aa3032ba910db259
MD5 b7439cd88d561a3f02bdf3b5062b02a5 openvpn-2.0.7.ebuild 4163
RMD160 319a6802dedbe00d538d5c8fd9162d7d291ba291 openvpn-2.0.7.ebuild 4163
MD5 1d3ea21bf9f0a0c1a78237d6e8b310a5 openvpn-2.1_rc1-r1.ebuild 4721
RMD160 d28f62993516c6f3960b3c186fa17f3c9df09e74 openvpn-2.1_rc1-r1.ebuild 4721
SHA256 4579e0f5eca9a7083978b5ac11aa64578f5da38829715c6d85506cf3e0e09e97 openvpn-2.1_rc1-r1.ebuild 4721
+EBUILD openvpn-2.1_rc1-r2.ebuild 4720 RMD160 45d15ecb288ec277dae0d418eb9392349044ae4e SHA1 247979a9dc466341021026621200cb07bab82e84 SHA256 495cdd4bf9bc6c9e1b2116b3f3666fb79992ac4f8c05af5f7efccb709c7d9f0b
+MD5 84829e7e3e3940aa063a1537d427ad61 openvpn-2.1_rc1-r2.ebuild 4720
+RMD160 45d15ecb288ec277dae0d418eb9392349044ae4e openvpn-2.1_rc1-r2.ebuild 4720
+SHA256 495cdd4bf9bc6c9e1b2116b3f3666fb79992ac4f8c05af5f7efccb709c7d9f0b openvpn-2.1_rc1-r2.ebuild 4720
EBUILD openvpn-2.1_rc1.ebuild 4674 RMD160 74cc582adcc8f01839d7f19fba29e936ed18873e SHA1 7d28477fc4e636c9fe46c13d34608a3e347d04a1 SHA256 1a4548212c003c3784fe8ca1c0ad5f9d76e91b819b63aeda1606f62c9a6f9cbe
MD5 46b837bceccbff3ba38def30957c1d07 openvpn-2.1_rc1.ebuild 4674
RMD160 74cc582adcc8f01839d7f19fba29e936ed18873e openvpn-2.1_rc1.ebuild 4674
SHA256 1a4548212c003c3784fe8ca1c0ad5f9d76e91b819b63aeda1606f62c9a6f9cbe openvpn-2.1_rc1.ebuild 4674
-MISC ChangeLog 16192 RMD160 03e0fc2d68f8be57eddb352c6db37834482d8f95 SHA1 ce030015fb7ae7affba9733546080e984ddcae6e SHA256 b68c3f0268d52b8307a6e1f69f1b1ba71676401e646529bfd7d319676516c61c
-MD5 f068de575c80a88b978157d031c9fd7c ChangeLog 16192
-RMD160 03e0fc2d68f8be57eddb352c6db37834482d8f95 ChangeLog 16192
-SHA256 b68c3f0268d52b8307a6e1f69f1b1ba71676401e646529bfd7d319676516c61c ChangeLog 16192
+MISC ChangeLog 16478 RMD160 a5a49e0178e55aa6c733fd9f51ebf75085465e55 SHA1 1a41a4d3fded57e508129338629c713633f89e85 SHA256 6dd4bfd6facbd46e3b8da8869060f6b442cb92d9dfe3845c47db4e3f28385962
+MD5 4bc6739c35961f7cb4a9d0dc9f45c986 ChangeLog 16478
+RMD160 a5a49e0178e55aa6c733fd9f51ebf75085465e55 ChangeLog 16478
+SHA256 6dd4bfd6facbd46e3b8da8869060f6b442cb92d9dfe3845c47db4e3f28385962 ChangeLog 16478
MISC metadata.xml 440 RMD160 120089ec9c799161dfeeacd9a3adfc40b4317f06 SHA1 23d2975ef0f709dc2e754a5867942e679ee60740 SHA256 408ca4fc4f58fa21e629582d0a44a759f9695a018479d70efbd3338b6bdbcfd6
MD5 62aa0438042b29eba4a6afd971037761 metadata.xml 440
RMD160 120089ec9c799161dfeeacd9a3adfc40b4317f06 metadata.xml 440
MD5 f8b2e9d63bd97591290f11cd6bf8ae2a files/digest-openvpn-2.0.7-r1 241
RMD160 95c02dbccbc539ab7e6c2947ef7d187c3be3b6ad files/digest-openvpn-2.0.7-r1 241
SHA256 a1f31a906a965a6209c5e248a0a36f80423f087dd519d8465503446f23f1446d files/digest-openvpn-2.0.7-r1 241
+MD5 f8b2e9d63bd97591290f11cd6bf8ae2a files/digest-openvpn-2.0.7-r2 241
+RMD160 95c02dbccbc539ab7e6c2947ef7d187c3be3b6ad files/digest-openvpn-2.0.7-r2 241
+SHA256 a1f31a906a965a6209c5e248a0a36f80423f087dd519d8465503446f23f1446d files/digest-openvpn-2.0.7-r2 241
MD5 bb7afa7edeacc9e41966e22abf947db5 files/digest-openvpn-2.1_rc1 247
RMD160 3d9aea0ae09e97b06c00e158b96ea1ec46cb4bcf files/digest-openvpn-2.1_rc1 247
SHA256 cb762f95d659bb7f55c64f681b194e75afded7641d68a3528a2d80df14dc1a24 files/digest-openvpn-2.1_rc1 247
MD5 bb7afa7edeacc9e41966e22abf947db5 files/digest-openvpn-2.1_rc1-r1 247
RMD160 3d9aea0ae09e97b06c00e158b96ea1ec46cb4bcf files/digest-openvpn-2.1_rc1-r1 247
SHA256 cb762f95d659bb7f55c64f681b194e75afded7641d68a3528a2d80df14dc1a24 files/digest-openvpn-2.1_rc1-r1 247
+MD5 bb7afa7edeacc9e41966e22abf947db5 files/digest-openvpn-2.1_rc1-r2 247
+RMD160 3d9aea0ae09e97b06c00e158b96ea1ec46cb4bcf files/digest-openvpn-2.1_rc1-r2 247
+SHA256 cb762f95d659bb7f55c64f681b194e75afded7641d68a3528a2d80df14dc1a24 files/digest-openvpn-2.1_rc1-r2 247
--- /dev/null
+MD5 93528233f1f6d02fc18e2c00f82e0aca openvpn-2.0.7.tar.gz 665129
+RMD160 b89f6df5ff08326f4e07e6cd4abda633627ef9e4 openvpn-2.0.7.tar.gz 665129
+SHA256 9e29ebfb76375379b4ca12c2270dff3b4b1636eb643747c69249ae206833052e openvpn-2.0.7.tar.gz 665129
--- /dev/null
+MD5 b0773149ef9d93a0075dfa42b87042a0 openvpn-2.1_rc1.tar.gz 796620
+RMD160 751d07c3b9b40cc3c9a1649ad8b10b9d889a5690 openvpn-2.1_rc1.tar.gz 796620
+SHA256 b5eb4f0d4eda58aaa8b60eb1b2f1d1a0d55ca22e9b098a2f65b6f44abc1c9e11 openvpn-2.1_rc1.tar.gz 796620
#!/bin/sh
-# Copyright (c) 2006 Gentoo Foundation
+# Copyright (c) 2006-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
#!/sbin/runscript
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-VPNDIR="${VPNDIR:-/etc/openvpn}"
-VPN="${SVCNAME#*.}"
-if [[ -n ${VPN} && ${SVCNAME} != "openvpn" ]]; then
+VPNDIR=${VPNDIR:-/etc/openvpn}
+VPN=${SVCNAME#*.}
+if [ -n "${VPN}" ] && [ ${SVCNAME} != "openvpn" ]; then
VPNPID="/var/run/openvpn.${VPN}.pid"
else
VPNPID="/var/run/openvpn.pid"
checkconfig() {
# Linux has good dynamic tun/tap creation
- if [[ $(uname) == "Linux" ]] ; then
- if [[ ! -e /dev/net/tun ]]; then
+ if [ $(uname -s) = "Linux" ] ; then
+ if [ ! -e /dev/net/tun ]; then
if ! modprobe tun ; then
eerror "TUN/TAP support is not available" \
"in this kernel"
return 1
fi
fi
- if [[ -h /dev/net/tun && -c /dev/misc/net/tun ]]; then
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
ebegin "Detected broken /dev/net/tun symlink, fixing..."
rm -f /dev/net/tun
ln -s /dev/misc/net/tun /dev/net/tun
# Other OS's don't, so we rely on a pre-configured interface
# per vpn instance
local ifname=$(sed -n -e 's/[[:space:]]*dev[[:space:]][[:space:]]*\([^[:space:]]*\).*/\1/p' "${VPNCONF}")
- if [[ -z ${ifname} ]] ; then
+ if [ -z ${ifname} ] ; then
eerror "You need to specify the interface that this openvpn" \
"instance should use" \
"by using the dev option in ${VPNCONF}"
return 1
fi
- if ! ifconfig "${ifname}" &>/dev/null ; then
+ if ! ifconfig "${ifname}" >/dev/null ; then
# Try and create it
- echo > /dev/"${ifname}" &>/dev/null
+ echo > /dev/"${ifname}" >/dev/null
fi
- if ! ifconfig "${ifname}" &>/dev/null ; then
+ if ! ifconfig "${ifname}" >/dev/null ; then
eerror "${VPNCONF} requires interface ${ifname}" \
"but that does not exist"
return 1
start() {
# If we are re-called by the openvpn gentoo-up.sh script
# then we don't actually want to start openvpn
- [[ ${IN_BACKGROUND} == "true" ]] && return 0
+ [ "${IN_BACKGROUND}" = "true" ] && return 0
ebegin "Starting ${SVCNAME}"
grep -q "^[ \t]*group[ \t].*" "${VPNCONF}" || args="${args} --group openvpn"
fi
- if ${client} && [[ $(type -t mark_service_inactive) == "function" ]] ; then
- mark_service_inactive "${SVCNAME}"
- fi
+ ${client} && mark_service_inactive "${SVCNAME}"
start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID}" \
-- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon ${args}
eend $? "Check your logs to see why startup failed"
stop() {
# If we are re-called by the openvpn gentoo-down.sh script
# then we don't actually want to stop openvpn
- if [[ ${IN_BACKGROUND} == "true" ]] ; then
- [[ $(type -t mark_service_inactive) == "function" ]] \
- && mark_service_inactive "${SVCNAME}"
+ if [ "${IN_BACKGROUND}" = "true" ] ; then
+ mark_service_inactive "${SVCNAME}"
return 0
fi
#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
VPNDIR="/etc/openvpn"
VPN="${SVCNAME#*.}"
-if [[ -n ${VPN} && ${SVCNAME} != "openvpn" ]]; then
+if [ -n "${VPN}" ] && [ "${SVCNAME}" != "openvpn" ]; then
VPNPID="/var/run/openvpn.${VPN}.pid"
else
VPNPID="/var/run/openvpn.pid"
}
checktundevice() {
- if [[ ! -e /dev/net/tun ]]; then
+ if [ ! -e /dev/net/tun ]; then
if ! modprobe tun ; then
eerror "TUN/TAP support is not available in this kernel"
return 1
fi
fi
- if [[ -h /dev/net/tun && -c /dev/misc/net/tun ]]; then
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
ebegin "Detected broken /dev/net/tun symlink, fixing..."
rm -f /dev/net/tun
ln -s /dev/misc/net/tun /dev/net/tun
checktundevice || return 1
- if [[ ! -e "${VPNCONF}" ]]; then
+ if [ ! -e "${VPNCONF}" ]; then
eend 1 "${VPNCONF} does not exist"
return 1
fi
#!/bin/sh
-# Copyright (c) 2006 Gentoo Foundation
+# Copyright (c) 2006-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
elif [ "${opt}" != "${opt#dhcp-option DNS *}" ] ; then
NS="${DNS}nameserver ${opt#dhcp-option DNS *}\n"
fi
- i=$((i + 1))
+ i=$((${i} + 1))
done
if [ -n "${NS}" ] ; then
--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-2.0.7-r2.ebuild,v 1.1 2007/02/23 11:44:20 uberlord Exp $
+
+inherit eutils multilib
+
+DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes."
+SRC_URI="http://openvpn.net/release/openvpn-${PV}.tar.gz"
+HOMEPAGE="http://openvpn.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc-macos ~ppc64 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="examples iproute2 minimal pam passwordsave selinux ssl static threads"
+
+RDEPEND=">=dev-libs/lzo-1.07
+ kernel_linux? (
+ iproute2? ( sys-apps/iproute2 ) !iproute2? ( sys-apps/net-tools )
+ )
+ !minimal? ( pam? ( virtual/pam ) )
+ selinux? ( sec-policy/selinux-openvpn )
+ ssl? ( >=dev-libs/openssl-0.9.6 )"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+pkg_setup() {
+ if use iproute2 ; then
+ if built_with_use sys-apps/iproute2 minimal ; then
+ eerror "iproute2 support requires that sys-apps/iproute2 was not"
+ eerror "built with the minimal USE flag"
+ die "iproute2 support not available"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack "${A}"
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}"-2.0.4-darwin.patch
+ epatch "${FILESDIR}/${P}-pam.patch"
+ epatch "${FILESDIR}/${P}-persistent.patch"
+
+}
+
+src_compile() {
+ local myconf=""
+ # We cannot use use_enable with iproute2 as the Makefile stupidly
+ # enables it with --disable-iproute2
+ use iproute2 && myconf="${myconf} --enable-iproute2"
+ use minimal && myconf="${myconf} --disable-plugins"
+
+ econf ${myconf} \
+ $(use_enable passwordsave password-save) \
+ $(use_enable ssl) \
+ $(use_enable ssl crypto) \
+ $(use_enable threads pthread) \
+ || die "configure failed"
+
+ use static && sed -e -i '/^LIBS/s/LIBS = /LIBS = -static /' Makefile
+
+ emake || die "make failed"
+
+ if ! use minimal ; then
+ cd plugin
+ for i in $( ls 2>/dev/null ); do
+ [[ ${i} == "README" || ${i} == "examples" ]] && continue
+ [[ ${i} == "auth-pam" ]] && ! use pam && continue
+ einfo "Building ${i} plugin"
+ cd "${i}"
+ emake || die "make failed"
+ cd ..
+ done
+ cd ..
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ # install documentation
+ dodoc AUTHORS ChangeLog PORTS README
+
+ # Empty dir
+ dodir /etc/openvpn
+ keepdir /etc/openvpn
+
+ # Install the init script
+ newinitd "${FILESDIR}/openvpn.init" openvpn
+
+ # install examples, controlled by the respective useflag
+ if use examples ; then
+ # dodoc does not supportly support directory traversal, #15193
+ insinto /usr/share/doc/${PF}/examples
+ doins -r sample-{config-files,keys,scripts} contrib
+ prepalldocs
+ fi
+
+ # Install plugins and easy-rsa
+ if ! use minimal ; then
+ cd easy-rsa/2.0
+ exeinto "/usr/share/${PN}/easy-rsa"
+ doexe *-* pkitool
+ insinto "/usr/share/${PN}/easy-rsa"
+ doins README openssl.cnf vars
+ cd ../..
+
+ exeinto "/usr/$(get_libdir)/${PN}"
+ doexe plugin/*/*.so
+ fi
+}
+
+pkg_postinst() {
+ ewarn "WARNING: The openvpn init script has changed"
+ ewarn ""
+ einfo "The openvpn init script expects to find the configuration file"
+ einfo "openvpn.conf in /etc/openvpn along with any extra files it may need."
+ einfo ""
+ einfo "To create more VPNs, simply create a new .conf file for it and"
+ einfo "then create a symlink to the openvpn init script from a link called"
+ einfo "openvpn.newconfname - like so"
+ einfo " cd /etc/openvpn"
+ einfo " ${EDITOR##*/} foo.conf"
+ einfo " cd /etc/init.d"
+ einfo " ln -s openvpn openvpn.foo"
+ einfo ""
+ einfo "You can then treat openvpn.foo as any other service, so you can"
+ einfo "stop one vpn and start another if you need to."
+ if ! use minimal ; then
+ einfo ""
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
+ fi
+ einfo ""
+ einfo "It is recommended that you create your tun/tap interfaces using"
+ einfo "the net.tun0/net.tap0 scripts provided by baselayout instead of"
+ einfo "using the 'server' directive in openvpn configuration files."
+ einfo "This will insure that the interface really is up after openvpn"
+ einfo "starts."
+ einfo "Note that you cannot use net.tun0/net.tap0 and the server option,"
+ einfo "otherwise openvpn will not start."
+ ebeep
+}
--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-2.1_rc1-r2.ebuild,v 1.1 2007/02/23 11:44:20 uberlord Exp $
+
+inherit eutils multilib
+
+DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes."
+SRC_URI="http://openvpn.net/release/openvpn-${PV}.tar.gz"
+HOMEPAGE="http://openvpn.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc-macos ~ppc64 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="examples iproute2 minimal pam passwordsave selinux ssl static threads"
+
+DEPEND=">=dev-libs/lzo-1.07
+ kernel_linux? (
+ iproute2? ( sys-apps/iproute2 ) !iproute2? ( sys-apps/net-tools )
+ )
+ !minimal? ( pam? ( virtual/pam ) )
+ selinux? ( sec-policy/selinux-openvpn )
+ ssl? ( >=dev-libs/openssl-0.9.6 )"
+
+pkg_setup() {
+ if use iproute2 ; then
+ if built_with_use sys-apps/iproute2 minimal ; then
+ eerror "iproute2 support requires that sys-apps/iproute2 was not"
+ eerror "built with the minimal USE flag"
+ die "iproute2 support not available"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${PN}"-2.0.4-darwin.patch
+ epatch "${FILESDIR}/${PN}"-2.0.7-pam.patch
+ epatch "${FILESDIR}/${P}"-persistent.patch
+
+}
+
+src_compile() {
+ local myconf=""
+ # We cannot use use_enable with iproute2 as the Makefile stupidly
+ # enables it with --disable-iproute2
+ use iproute2 && myconf="${myconf} --enable-iproute2"
+ if use minimal ; then
+ myconf="${myconf} --disable-plugins"
+ myconf="${myconf} --disable-pkcs11"
+ fi
+
+ econf ${myconf} \
+ $(use_enable passwordsave password-save) \
+ $(use_enable ssl) \
+ $(use_enable ssl crypto) \
+ $(use_enable threads pthread) \
+ || die "configure failed"
+
+ use static && sed -e -i '/^LIBS/s/LIBS = /LIBS = -static /' Makefile
+
+ emake || die "make failed"
+
+ if ! use minimal ; then
+ cd plugin
+ for i in $( ls 2>/dev/null ); do
+ [[ ${i} == "README" || ${i} == "examples" ]] && continue
+ [[ ${i} == "auth-pam" ]] && ! use pam && continue
+ einfo "Building ${i} plugin"
+ cd "${i}"
+ emake || die "make failed"
+ cd ..
+ done
+ cd ..
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ # install documentation
+ dodoc AUTHORS ChangeLog PORTS README
+
+ # Empty dir
+ dodir /etc/openvpn
+ keepdir /etc/openvpn
+
+ # Install some helper scripts
+ exeinto /etc/openvpn
+ doexe "${FILESDIR}/up.sh"
+ doexe "${FILESDIR}/down.sh"
+
+ # Install the init script
+ newinitd "${FILESDIR}/openvpn-2.1.init" openvpn
+
+ # install examples, controlled by the respective useflag
+ if use examples ; then
+ # dodoc does not supportly support directory traversal, #15193
+ insinto /usr/share/doc/${PF}/examples
+ doins -r sample-{config-files,keys,scripts} contrib
+ prepalldocs
+ fi
+
+ # Install plugins and easy-rsa
+ if ! use minimal ; then
+ cd easy-rsa/2.0
+ make install "DESTDIR=${D}/usr/share/${PN}/easy-rsa"
+ cd ../..
+
+ exeinto "/usr/$(get_libdir)/${PN}"
+ doexe plugin/*/*.so
+ fi
+}
+
+pkg_postinst() {
+ # Add openvpn user so openvpn servers can drop privs
+ # Clients should run as root so they can change ip addresses,
+ # dns information and other such things.
+ enewgroup openvpn
+ enewuser openvpn "" "" "" openvpn
+
+ if [[ -n $(ls /etc/openvpn/*/local.conf 2>/dev/null) ]] ; then
+ ewarn "WARNING: The openvpn init script has changed"
+ ewarn ""
+ fi
+
+ einfo "The openvpn init script expects to find the configuration file"
+ einfo "openvpn.conf in /etc/openvpn along with any extra files it may need."
+ einfo ""
+ einfo "To create more VPNs, simply create a new .conf file for it and"
+ einfo "then create a symlink to the openvpn init script from a link called"
+ einfo "openvpn.newconfname - like so"
+ einfo " cd /etc/openvpn"
+ einfo " ${EDITOR##*/} foo.conf"
+ einfo " cd /etc/init.d"
+ einfo " ln -s openvpn openvpn.foo"
+ einfo ""
+ einfo "You can then treat openvpn.foo as any other service, so you can"
+ einfo "stop one vpn and start another if you need to."
+
+ if grep -Eq "^[ \t]*(up|down)[ \t].*" ${ROOT}/etc/openvpn/*.conf 2>/dev/null ; then
+ ewarn ""
+ ewarn "WARNING: If you use the remote keyword then you are deemed to be"
+ ewarn "a client by our init script and as such we force up,down scripts."
+ ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
+ ewarn "can move your scripts to."
+ fi
+
+ if ! use minimal ; then
+ einfo ""
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
+ fi
+
+ if use userland_BSD ; then
+ ewarn ""
+ ewarn "If you run any kind of firewall on BSD and use IPv6 acrosss"
+ ewarn "OpenVPN then you'll probably have to lower the MTU to 1420"
+ ewarn "using the tun-mtu statement (even for tap devices)"
+ fi
+}