--- /usr/portage/net-misc/openvpn/openvpn-2.2.0-r1.ebuild 2011-07-29 11:01:21.000000000 +0200 +++ openvpn-9999.ebuild 2011-10-02 12:44:44.314314458 +0200 @@ -4,14 +4,21 @@ EAPI=4 -inherit eutils multilib toolchain-funcs autotools flag-o-matic +[[ ${PV} == "9999" ]] && GIT_ECLASS="git-2" +inherit eutils multilib toolchain-funcs autotools flag-o-matic ${GIT_ECLASS} +unset GIT_ECLASS IPV6_VERSION="2.2RC2-ipv6-20110424-2" DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes." -SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz - ipv6? ( - http://www.greenie.net/ipv6/openvpn-${IPV6_VERSION}.patch.gz - )" +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="git://${PN}.git.sourceforge.net/gitroot/${PN}/${PN}.git" +else + SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz + ipv6? ( + http://www.greenie.net/ipv6/openvpn-${IPV6_VERSION}.patch.gz + )" +fi + HOMEPAGE="http://openvpn.net/" LICENSE="GPL-2" @@ -30,15 +37,26 @@ RDEPEND="${DEPEND}" src_prepare() { - epatch "${FILESDIR}/${PN}-2.1_rc20-pkcs11.patch" - use ipv6 && epatch "${WORKDIR}/${PN}-${IPV6_VERSION}.patch" + if [[ ${PV} == "9999" ]]; then + epatch "${FILESDIR}/${PN}-9999-pkcs11.patch" + else + epatch "${FILESDIR}/${PN}-2.1_rc20-pkcs11.patch" + use ipv6 && epatch "${WORKDIR}/${PN}-${IPV6_VERSION}.patch" + fi + sed -i \ -e "s/gcc \${CC_FLAGS}/\${CC} \${CFLAGS} -Wall/" \ -e "s/-shared/-shared \${LDFLAGS}/" \ plugin/*/Makefile || die "sed failed" - if use ipv6; then - eautoreconf + + if [[ ${PV} == "9999" ]]; then + # Add GIT commit ID to Product Version + sed -i \ + -e "/^define(PRODUCT_VERSION/s/])/-git-${EGIT_VERSION}])/" \ + version.m4 fi + + (use ipv6 || [[ ${PV} == "9999" ]]) && eautoreconf } src_configure() { @@ -91,6 +109,7 @@ # install documentation dodoc AUTHORS ChangeLog PORTS README + [[ ${PV} == "9999" ]] && dodoc README.IPv6 TODO.IPv6 # Install some helper scripts keepdir /etc/openvpn @@ -166,4 +185,11 @@ einfo "For more information please visit:" einfo "http://www.greenie.net/ipv6/openvpn.html" fi + + if [[ ${PV} == "9999" ]]; then + ewarn "" + ewarn "You are using a live ebuild building from the sources of openvpn" + ewarn "repository from http://openvpn.git.sourceforge.net. For reporting" + ewarn "bugs please contact: openvpn-devel@lists.sourceforge.net" + fi }