# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info DESCRIPTION="LogMeIn Hamachi VPN tunneling engine" HOMEPAGE="https://secure.logmein.com/products/hamachi2" LICENSE="free-noncomm" SRC_URI="x86? ( ${P}-x86.tgz ) amd64? ( ${P}-x64.tgz )" SLOT="0" KEYWORDS="-* ~amd64 ~x86" RESTRICT="fetch" IUSE="" QA_PRESTRIPPED="/opt/${PN}/bin/hamachid" pkg_setup() { einfo "Checking your kernel configuration for TUN/TAP support." CONFIG_CHECK="~TUN" check_extra_config # x86 S=${WORKDIR}/${P}-x86 # amd64 S=${WORKDIR}/${P}-x64 } pkg_nofetch() { eerror "Please go to:" eerror " https://secure.logmein.com/labs" eerror "And download :" eerror " ${P}-x86.tgz or ${P}-x64.tgz" eerror "Then after downloading put it in:" eerror " ${DISTDIR}" } src_install() { # Hamachi einfo "Installing Hamachi" dodir /opt/${PN}/bin insinto /opt/${PN}/bin insopts -m0755 doins hamachid || die "Couldn't install hamachid" doins dnsup || die "Couldn't install dnsup" doins dnsdown || die "Couldn't install dnsdown" dosym /opt/${PN}/bin/hamachid /usr/bin/hamachi || die "Couldn't create hamachi symlink" dodir /var/run/${PN} # Config and log directory dodir /var/lib/${PN} # Setup files einfo "Installing config files" newconfd "${FILESDIR}"/${PN}.confd ${PN} newinitd "${FILESDIR}"/${PN}.initd ${PN} # Docs dodoc CHANGES README LICENSE } pkg_postinst() { einfo "LogMeIn Hamachi2 is installed. See README for what to do next." einfo "You can run the client 'hamachi' as root," einfo "or as a user if you add a line:" einfo "Ipc.User " einfo "to the file '/var/lib/logmein-hamachi/h2-engine-override.cfg'" einfo "and restart the daemon with" einfo "/etc/init.d/logmein-hamachi restart" }