Gentoo Archives: gentoo-commits

From: "Dirkjan Ochtman (djc)" <djc@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/openvpn: ChangeLog openvpn-9999.ebuild
Date: Thu, 01 Mar 2012 12:09:16
Message-Id: 20120301120900.9C3982004B@flycatcher.gentoo.org
1 djc 12/03/01 12:09:00
2
3 Modified: ChangeLog
4 Added: openvpn-9999.ebuild
5 Log:
6 Add live ebuild for openvpn (bug 385375).
7
8 (Portage version: 2.1.10.49/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.224 net-misc/openvpn/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openvpn/ChangeLog?rev=1.224&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openvpn/ChangeLog?rev=1.224&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openvpn/ChangeLog?r1=1.223&r2=1.224
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v
20 retrieving revision 1.223
21 retrieving revision 1.224
22 diff -u -r1.223 -r1.224
23 --- ChangeLog 23 Feb 2012 22:57:50 -0000 1.223
24 +++ ChangeLog 1 Mar 2012 12:09:00 -0000 1.224
25 @@ -1,6 +1,12 @@
26 # ChangeLog for net-misc/openvpn
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.223 2012/02/23 22:57:50 fauli Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.224 2012/03/01 12:09:00 djc Exp $
30 +
31 +*openvpn-9999 (01 Mar 2012)
32 +
33 + 01 Mar 2012; Dirkjan Ochtman <djc@g.o> +openvpn-9999.ebuild,
34 + +files/openvpn-9999-pkcs11.patch:
35 + Add live ebuild (bug 385375). Thanks to Marcel Pennewiß.
36
37 23 Feb 2012; Christian Faulhammer <fauli@g.o>
38 files/openvpn-2.1_rc20-pkcs11.patch, +files/openvpn-2.2.0-pkcs11.patch:
39
40
41
42 1.1 net-misc/openvpn/openvpn-9999.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openvpn/openvpn-9999.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openvpn/openvpn-9999.ebuild?rev=1.1&content-type=text/plain
46
47 Index: openvpn-9999.ebuild
48 ===================================================================
49 # Copyright 1999-2012 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51
52 EAPI=4
53
54 inherit eutils multilib toolchain-funcs autotools flag-o-matic git-2
55
56 DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes."
57 EGIT_REPO_URI="git://${PN}.git.sourceforge.net/gitroot/${PN}/${PN}.git"
58 HOMEPAGE="http://openvpn.net/"
59
60 LICENSE="GPL-2"
61 SLOT="0"
62 KEYWORDS=""
63 IUSE="examples iproute2 minimal pam passwordsave selinux +ssl static pkcs11 userland_BSD"
64
65 DEPEND=">=dev-libs/lzo-1.07
66 kernel_linux? (
67 iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools )
68 )
69 !minimal? ( pam? ( virtual/pam ) )
70 selinux? ( sec-policy/selinux-openvpn )
71 ssl? ( >=dev-libs/openssl-0.9.6 )
72 pkcs11? ( >=dev-libs/pkcs11-helper-1.05 )"
73 RDEPEND="${DEPEND}"
74
75 src_prepare() {
76 epatch "${FILESDIR}/${P}-pkcs11.patch"
77 sed -i \
78 -e "s/gcc \${CC_FLAGS}/\${CC} \${CFLAGS} -Wall/" \
79 -e "s/-shared/-shared \${LDFLAGS}/" \
80 plugin/*/Makefile || die "sed failed"
81
82 # Add GIT commit ID to Product Version
83 sed -i \
84 -e "/^define(PRODUCT_VERSION/s/])/-git-${EGIT_VERSION}])/" \
85 version.m4
86 eautoreconf
87 }
88
89 src_configure() {
90 # basic.h defines a type 'bool' that conflicts with the altivec
91 # keyword bool which has to be fixed upstream, see bugs #293840
92 # and #297854.
93 # For now, filter out -maltivec on ppc and append -mno-altivec, as
94 # -maltivec is enabled implicitly by -mcpu and similar flags.
95 (use ppc || use ppc64) && filter-flags -maltivec && append-flags -mno-altivec
96
97 local myconf=""
98
99 if use minimal ; then
100 myconf="${myconf} --disable-plugins"
101 myconf="${myconf} --disable-pkcs11"
102 else
103 myconf="$(use_enable pkcs11)"
104 fi
105
106 econf ${myconf} \
107 $(use_enable passwordsave password-save) \
108 $(use_enable ssl) \
109 $(use_enable ssl crypto) \
110 $(use_enable iproute2) \
111 --docdir="${EPREFIX}/usr/share/doc/${PF}"
112 }
113
114 src_compile() {
115
116 if use static ; then
117 sed -i -e '/^LIBS/s/LIBS = /LIBS = -static /' Makefile || die "sed failed"
118 fi
119
120 emake
121
122 if ! use minimal ; then
123 cd plugin
124 for i in *; do
125 [[ ${i} == "README" || ${i} == "examples" || ${i} == "defer" ]] && continue
126 [[ ${i} == "auth-pam" ]] && ! use pam && continue
127 einfo "Building ${i} plugin"
128 emake -C "${i}" CC=$(tc-getCC)
129 done
130 cd ..
131 fi
132 }
133
134 src_install() {
135 emake DESTDIR="${D}" install
136
137 # install openvpn-plugin.h
138 insinto /usr/include
139 doins openvpn-plugin.h
140
141 # install documentation
142 dodoc AUTHORS ChangeLog PORTS README README.IPv6 TODO.IPv6
143
144 # Install some helper scripts
145 keepdir /etc/openvpn
146 exeinto /etc/openvpn
147 doexe "${FILESDIR}/up.sh"
148 doexe "${FILESDIR}/down.sh"
149
150 # Install the init script and config file
151 newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
152 newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
153
154 # install examples, controlled by the respective useflag
155 if use examples ; then
156 # dodoc does not supportly support directory traversal, #15193
157 insinto /usr/share/doc/${PF}/examples
158 doins -r sample-{config-files,keys,scripts} contrib
159 fi
160
161 # Install plugins and easy-rsa
162 doenvd "${FILESDIR}/65openvpn" # config-protect easy-rsa
163 if ! use minimal ; then
164 cd easy-rsa/2.0
165 make install "DESTDIR=${D}" "PREFIX=${EPREFIX}/usr/share/${PN}/easy-rsa"
166 cd ../..
167
168 exeinto "/usr/$(get_libdir)/${PN}"
169 doexe plugin/*/*.so
170 fi
171 }
172
173 pkg_postinst() {
174 # Add openvpn user so openvpn servers can drop privs
175 # Clients should run as root so they can change ip addresses,
176 # dns information and other such things.
177 enewgroup openvpn
178 enewuser openvpn "" "" "" openvpn
179
180 if [ path_exists -o "${ROOT}/etc/openvpn/*/local.conf" ] ; then
181 ewarn "WARNING: The openvpn init script has changed"
182 ewarn ""
183 fi
184
185 elog "The openvpn init script expects to find the configuration file"
186 elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
187 elog ""
188 elog "To create more VPNs, simply create a new .conf file for it and"
189 elog "then create a symlink to the openvpn init script from a link called"
190 elog "openvpn.newconfname - like so"
191 elog " cd /etc/openvpn"
192 elog " ${EDITOR##*/} foo.conf"
193 elog " cd /etc/init.d"
194 elog " ln -s openvpn openvpn.foo"
195 elog ""
196 elog "You can then treat openvpn.foo as any other service, so you can"
197 elog "stop one vpn and start another if you need to."
198
199 if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
200 ewarn ""
201 ewarn "WARNING: If you use the remote keyword then you are deemed to be"
202 ewarn "a client by our init script and as such we force up,down scripts."
203 ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
204 ewarn "can move your scripts to."
205 fi
206
207 if ! use minimal ; then
208 einfo ""
209 einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
210 fi
211
212 if [[ ${PV} == "9999" ]]; then
213 ewarn ""
214 ewarn "You are using a live ebuild building from the sources of openvpn"
215 ewarn "repository from http://openvpn.git.sourceforge.net. For reporting"
216 ewarn "bugs please contact: openvpn-devel@×××××××××××××××××.net"
217 fi
218 }