|
Lines 4-52
Link Here
|
| 4 |
|
4 |
|
| 5 |
EAPI=4 |
5 |
EAPI=4 |
| 6 |
|
6 |
|
| 7 |
inherit eutils multilib toolchain-funcs autotools flag-o-matic git-2 |
7 |
inherit eutils multilib toolchain-funcs |
| 8 |
|
8 |
|
| 9 |
DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes." |
9 |
DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes." |
| 10 |
EGIT_REPO_URI="git://${PN}.git.sourceforge.net/gitroot/${PN}/${PN}.git" |
|
|
| 11 |
HOMEPAGE="http://openvpn.net/" |
10 |
HOMEPAGE="http://openvpn.net/" |
| 12 |
|
11 |
|
|
|
12 |
if [[ "${PV}" = 9999 ]]; then |
| 13 |
inherit git-2 autotools |
| 14 |
KEYWORDS="" |
| 15 |
EGIT_REPO_URI="https://github.com/OpenVPN/${PN}.git" |
| 16 |
else |
| 17 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-linux" |
| 18 |
SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz" |
| 19 |
fi |
| 20 |
|
| 13 |
LICENSE="GPL-2" |
21 |
LICENSE="GPL-2" |
| 14 |
SLOT="0" |
22 |
SLOT="0" |
| 15 |
KEYWORDS="" |
23 |
IUSE="examples iproute2 minimal pam passwordsave selinux +ssl +lzo static pkcs11 userland_BSD" |
| 16 |
IUSE="examples iproute2 minimal pam passwordsave selinux +ssl static pkcs11 userland_BSD" |
|
|
| 17 |
|
24 |
|
| 18 |
DEPEND=">=dev-libs/lzo-1.07 |
25 |
DEPEND=" |
| 19 |
kernel_linux? ( |
26 |
kernel_linux? ( |
| 20 |
iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools ) |
27 |
iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools ) |
| 21 |
) |
28 |
) |
| 22 |
!minimal? ( pam? ( virtual/pam ) ) |
29 |
!minimal? ( pam? ( virtual/pam ) ) |
| 23 |
selinux? ( sec-policy/selinux-openvpn ) |
30 |
selinux? ( sec-policy/selinux-openvpn ) |
| 24 |
ssl? ( >=dev-libs/openssl-0.9.6 ) |
31 |
ssl? ( >=dev-libs/openssl-0.9.7 ) |
|
|
32 |
lzo? ( >=dev-libs/lzo-1.07 ) |
| 25 |
pkcs11? ( >=dev-libs/pkcs11-helper-1.05 )" |
33 |
pkcs11? ( >=dev-libs/pkcs11-helper-1.05 )" |
| 26 |
RDEPEND="${DEPEND}" |
34 |
RDEPEND="${DEPEND}" |
| 27 |
|
35 |
|
| 28 |
src_prepare() { |
36 |
src_prepare() { |
| 29 |
epatch "${FILESDIR}/${P}-pkcs11.patch" |
37 |
[ "${PV}" = 9999 ] && eautoreconf |
| 30 |
sed -i \ |
|
|
| 31 |
-e "s/gcc \${CC_FLAGS}/\${CC} \${CFLAGS} -Wall/" \ |
| 32 |
-e "s/-shared/-shared \${LDFLAGS}/" \ |
| 33 |
plugin/*/Makefile || die "sed failed" |
| 34 |
|
| 35 |
# Add GIT commit ID to Product Version |
| 36 |
sed -i \ |
| 37 |
-e "/^define(PRODUCT_VERSION/s/])/-git-${EGIT_VERSION}])/" \ |
| 38 |
version.m4 |
| 39 |
eautoreconf |
| 40 |
} |
38 |
} |
| 41 |
|
39 |
|
| 42 |
src_configure() { |
40 |
src_configure() { |
| 43 |
# basic.h defines a type 'bool' that conflicts with the altivec |
|
|
| 44 |
# keyword bool which has to be fixed upstream, see bugs #293840 |
| 45 |
# and #297854. |
| 46 |
# For now, filter out -maltivec on ppc and append -mno-altivec, as |
| 47 |
# -maltivec is enabled implicitly by -mcpu and similar flags. |
| 48 |
(use ppc || use ppc64) && filter-flags -maltivec && append-flags -mno-altivec |
| 49 |
|
| 50 |
local myconf="" |
41 |
local myconf="" |
| 51 |
|
42 |
|
| 52 |
if use minimal ; then |
43 |
if use minimal ; then |
|
Lines 56-84
src_configure() {
Link Here
|
| 56 |
myconf="$(use_enable pkcs11)" |
47 |
myconf="$(use_enable pkcs11)" |
| 57 |
fi |
48 |
fi |
| 58 |
|
49 |
|
|
|
50 |
use static && LDFLAGS="${LDFLAGS} -Xcompiler -static" |
| 59 |
econf ${myconf} \ |
51 |
econf ${myconf} \ |
| 60 |
$(use_enable passwordsave password-save) \ |
52 |
$(use_enable passwordsave password-save) \ |
| 61 |
$(use_enable ssl) \ |
53 |
$(use_enable ssl) \ |
| 62 |
$(use_enable ssl crypto) \ |
54 |
$(use_enable ssl crypto) \ |
|
|
55 |
$(use_enable lzo) \ |
| 63 |
$(use_enable iproute2) \ |
56 |
$(use_enable iproute2) \ |
| 64 |
--docdir="${EPREFIX}/usr/share/doc/${PF}" |
57 |
--docdir="${EPREFIX}/usr/share/doc/${PF}" |
| 65 |
} |
58 |
} |
| 66 |
|
59 |
|
| 67 |
src_compile() { |
60 |
src_compile() { |
| 68 |
|
|
|
| 69 |
if use static ; then |
| 70 |
sed -i -e '/^LIBS/s/LIBS = /LIBS = -static /' Makefile || die "sed failed" |
| 71 |
fi |
| 72 |
|
| 73 |
emake |
61 |
emake |
| 74 |
|
62 |
|
| 75 |
if ! use minimal ; then |
63 |
if ! use minimal ; then |
| 76 |
cd plugin |
64 |
cd src/plugins |
| 77 |
for i in *; do |
65 |
for i in *; do |
| 78 |
[[ ${i} == "README" || ${i} == "examples" || ${i} == "defer" ]] && continue |
66 |
[[ ${i} == "README" || ${i} == "examples" || ${i} == "defer" ]] && continue |
| 79 |
[[ ${i} == "auth-pam" ]] && ! use pam && continue |
67 |
[[ ${i} == "auth-pam" ]] && ! use pam && continue |
| 80 |
einfo "Building ${i} plugin" |
68 |
einfo "Building ${i} plugin" |
| 81 |
emake -C "${i}" CC=$(tc-getCC) |
69 |
emake -C "${i}" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" |
| 82 |
done |
70 |
done |
| 83 |
cd .. |
71 |
cd .. |
| 84 |
fi |
72 |
fi |
|
Lines 87-98
src_compile() {
Link Here
|
| 87 |
src_install() { |
75 |
src_install() { |
| 88 |
emake DESTDIR="${D}" install |
76 |
emake DESTDIR="${D}" install |
| 89 |
|
77 |
|
| 90 |
# install openvpn-plugin.h |
|
|
| 91 |
insinto /usr/include |
| 92 |
doins openvpn-plugin.h |
| 93 |
|
| 94 |
# install documentation |
78 |
# install documentation |
| 95 |
dodoc AUTHORS ChangeLog PORTS README README.IPv6 TODO.IPv6 |
79 |
dodoc AUTHORS ChangeLog PORTS README README.IPv6 |
| 96 |
|
80 |
|
| 97 |
# Install some helper scripts |
81 |
# Install some helper scripts |
| 98 |
keepdir /etc/openvpn |
82 |
keepdir /etc/openvpn |
|
Lines 108-125
src_install() {
Link Here
|
| 108 |
if use examples ; then |
92 |
if use examples ; then |
| 109 |
# dodoc does not supportly support directory traversal, #15193 |
93 |
# dodoc does not supportly support directory traversal, #15193 |
| 110 |
insinto /usr/share/doc/${PF}/examples |
94 |
insinto /usr/share/doc/${PF}/examples |
| 111 |
doins -r sample-{config-files,keys,scripts} contrib |
95 |
doins -r sample contrib |
| 112 |
fi |
96 |
fi |
| 113 |
|
97 |
|
| 114 |
# Install plugins and easy-rsa |
|
|
| 115 |
doenvd "${FILESDIR}/65openvpn" # config-protect easy-rsa |
| 116 |
if ! use minimal ; then |
98 |
if ! use minimal ; then |
| 117 |
cd easy-rsa/2.0 |
|
|
| 118 |
make install "DESTDIR=${D}" "PREFIX=${EPREFIX}/usr/share/${PN}/easy-rsa" |
| 119 |
cd ../.. |
| 120 |
|
| 121 |
exeinto "/usr/$(get_libdir)/${PN}" |
99 |
exeinto "/usr/$(get_libdir)/${PN}" |
| 122 |
doexe plugin/*/*.so |
100 |
doexe src/plugins/*/*.so |
| 123 |
fi |
101 |
fi |
| 124 |
} |
102 |
} |
| 125 |
|
103 |
|