/[gentoo-x86]/net-misc/openvpn/openvpn-2.3.6-r2.ebuild
Gentoo

Contents of /net-misc/openvpn/openvpn-2.3.6-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Jul 12 19:33:49 2015 UTC (4 years, 4 months ago) by djc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
Don't default to polarssl, this was introduced accidentally

(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 30380381)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-2.3.6-r2.ebuild,v 1.2 2015/07/12 19:17:58 djc Exp $
4
5 EAPI=4
6
7 inherit multilib autotools flag-o-matic user systemd
8
9 DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
10 SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz"
11 HOMEPAGE="http://openvpn.net/"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux"
16 IUSE="examples down-root iproute2 pam passwordsave pkcs11 +plugins polarssl selinux +ssl systemd +lzo static userland_BSD"
17
18 REQUIRED_USE="static? ( !plugins !pkcs11 )
19 polarssl? ( ssl )
20 pkcs11? ( ssl )
21 !plugins? ( !pam !down-root )"
22
23 DEPEND="
24 kernel_linux? (
25 iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools )
26 )
27 pam? ( virtual/pam )
28 ssl? (
29 !polarssl? ( >=dev-libs/openssl-0.9.7 ) polarssl? ( >=net-libs/polarssl-1.2.10 )
30 )
31 lzo? ( >=dev-libs/lzo-1.07 )
32 pkcs11? ( >=dev-libs/pkcs11-helper-1.11 )"
33 RDEPEND="${DEPEND}
34 selinux? ( sec-policy/selinux-openvpn )
35 "
36
37 src_prepare() {
38 # Set correct pass to systemd-ask-password binary
39 sed -i "s:\(/bin/systemd-ask-password\):/usr\1:" ./src/openvpn/console.c || die
40 epatch "${FILESDIR}/2.3.6-null-cipher.patch" || die
41 epatch "${FILESDIR}/2.3.6-disable-compression.patch" || die
42 eautoreconf
43 }
44
45 src_configure() {
46 use static && LDFLAGS="${LDFLAGS} -Xcompiler -static"
47 local myconf
48 use polarssl && myconf="--with-crypto-library=polarssl"
49 econf \
50 ${myconf} \
51 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
52 --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \
53 $(use_enable passwordsave password-save) \
54 $(use_enable ssl) \
55 $(use_enable ssl crypto) \
56 $(use_enable lzo) \
57 $(use_enable pkcs11) \
58 $(use_enable plugins) \
59 $(use_enable iproute2) \
60 $(use_enable pam plugin-auth-pam) \
61 $(use_enable down-root plugin-down-root) \
62 $(use_enable systemd)
63 }
64
65 src_install() {
66 default
67 find "${ED}/usr" -name '*.la' -delete
68 # install documentation
69 dodoc AUTHORS ChangeLog PORTS README README.IPv6
70
71 # Install some helper scripts
72 keepdir /etc/openvpn
73 exeinto /etc/openvpn
74 doexe "${FILESDIR}/up.sh"
75 doexe "${FILESDIR}/down.sh"
76
77 # Install the init script and config file
78 newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
79 newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
80
81 # install examples, controlled by the respective useflag
82 if use examples ; then
83 # dodoc does not supportly support directory traversal, #15193
84 insinto /usr/share/doc/${PF}/examples
85 doins -r sample contrib
86 fi
87
88 systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
89 systemd_newunit "${FILESDIR}"/${PN}.service 'openvpn@.service'
90 }
91
92 pkg_postinst() {
93 # Add openvpn user so openvpn servers can drop privs
94 # Clients should run as root so they can change ip addresses,
95 # dns information and other such things.
96 enewgroup openvpn
97 enewuser openvpn "" "" "" openvpn
98
99 if [ path_exists -o "${ROOT}/etc/openvpn/*/local.conf" ] ; then
100 ewarn "WARNING: The openvpn init script has changed"
101 ewarn ""
102 fi
103
104 elog "The openvpn init script expects to find the configuration file"
105 elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
106 elog ""
107 elog "To create more VPNs, simply create a new .conf file for it and"
108 elog "then create a symlink to the openvpn init script from a link called"
109 elog "openvpn.newconfname - like so"
110 elog " cd /etc/openvpn"
111 elog " ${EDITOR##*/} foo.conf"
112 elog " cd /etc/init.d"
113 elog " ln -s openvpn openvpn.foo"
114 elog ""
115 elog "You can then treat openvpn.foo as any other service, so you can"
116 elog "stop one vpn and start another if you need to."
117
118 if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
119 ewarn ""
120 ewarn "WARNING: If you use the remote keyword then you are deemed to be"
121 ewarn "a client by our init script and as such we force up,down scripts."
122 ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
123 ewarn "can move your scripts to."
124 fi
125
126 if use plugins ; then
127 einfo ""
128 einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
129 fi
130
131 einfo ""
132 einfo "OpenVPN 2.3.x no longer includes the easy-rsa suite of utilities."
133 einfo "They can now be emerged via app-crypt/easy-rsa."
134 }

  ViewVC Help
Powered by ViewVC 1.1.20