|
Lines 4-42
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 flag-o-matic |
| 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="git://${PN}.git.sourceforge.net/gitroot/${PN}/${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.6 ) |
|
|
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() { |
|
Lines 60-65
src_configure() {
Link Here
|
| 60 |
$(use_enable passwordsave password-save) \ |
58 |
$(use_enable passwordsave password-save) \ |
| 61 |
$(use_enable ssl) \ |
59 |
$(use_enable ssl) \ |
| 62 |
$(use_enable ssl crypto) \ |
60 |
$(use_enable ssl crypto) \ |
|
|
61 |
$(use_enable lzo) \ |
| 63 |
$(use_enable iproute2) \ |
62 |
$(use_enable iproute2) \ |
| 64 |
--docdir="${EPREFIX}/usr/share/doc/${PF}" |
63 |
--docdir="${EPREFIX}/usr/share/doc/${PF}" |
| 65 |
} |
64 |
} |
|
Lines 73-84
src_compile() {
Link Here
|
| 73 |
emake |
72 |
emake |
| 74 |
|
73 |
|
| 75 |
if ! use minimal ; then |
74 |
if ! use minimal ; then |
| 76 |
cd plugin |
75 |
cd src/plugins |
| 77 |
for i in *; do |
76 |
for i in *; do |
| 78 |
[[ ${i} == "README" || ${i} == "examples" || ${i} == "defer" ]] && continue |
77 |
[[ ${i} == "README" || ${i} == "examples" || ${i} == "defer" ]] && continue |
| 79 |
[[ ${i} == "auth-pam" ]] && ! use pam && continue |
78 |
[[ ${i} == "auth-pam" ]] && ! use pam && continue |
| 80 |
einfo "Building ${i} plugin" |
79 |
einfo "Building ${i} plugin" |
| 81 |
emake -C "${i}" CC=$(tc-getCC) |
80 |
emake -C "${i}" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" |
| 82 |
done |
81 |
done |
| 83 |
cd .. |
82 |
cd .. |
| 84 |
fi |
83 |
fi |
|
Lines 87-98
src_compile() {
Link Here
|
| 87 |
src_install() { |
86 |
src_install() { |
| 88 |
emake DESTDIR="${D}" install |
87 |
emake DESTDIR="${D}" install |
| 89 |
|
88 |
|
| 90 |
# install openvpn-plugin.h |
|
|
| 91 |
insinto /usr/include |
| 92 |
doins openvpn-plugin.h |
| 93 |
|
| 94 |
# install documentation |
89 |
# install documentation |
| 95 |
dodoc AUTHORS ChangeLog PORTS README README.IPv6 TODO.IPv6 |
90 |
dodoc AUTHORS ChangeLog PORTS README |
| 96 |
|
91 |
|
| 97 |
# Install some helper scripts |
92 |
# Install some helper scripts |
| 98 |
keepdir /etc/openvpn |
93 |
keepdir /etc/openvpn |
|
Lines 108-125
src_install() {
Link Here
|
| 108 |
if use examples ; then |
103 |
if use examples ; then |
| 109 |
# dodoc does not supportly support directory traversal, #15193 |
104 |
# dodoc does not supportly support directory traversal, #15193 |
| 110 |
insinto /usr/share/doc/${PF}/examples |
105 |
insinto /usr/share/doc/${PF}/examples |
| 111 |
doins -r sample-{config-files,keys,scripts} contrib |
106 |
doins -r sample contrib |
| 112 |
fi |
107 |
fi |
| 113 |
|
108 |
|
| 114 |
# Install plugins and easy-rsa |
|
|
| 115 |
doenvd "${FILESDIR}/65openvpn" # config-protect easy-rsa |
| 116 |
if ! use minimal ; then |
109 |
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}" |
110 |
exeinto "/usr/$(get_libdir)/${PN}" |
| 122 |
doexe plugin/*/*.so |
111 |
doexe src/plugins/*/*.so |
| 123 |
fi |
112 |
fi |
| 124 |
} |
113 |
} |
| 125 |
|
114 |
|