# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info MY_PN=logmein-"${PN}" MY_P="${MY_PN}"-"${PV}" DESCRIPTION="LogMeIn Hamachi VPN tunneling engine" HOMEPAGE="https://secure.logmein.com/products/hamachi2" LICENSE="LogMeIn" SRC_URI="x86? ( https://secure.logmein.com/labs/${MY_P}-x86.tgz ) amd64? ( https://secure.logmein.com/labs/${MY_P}-x64.tgz )" SLOT="0" KEYWORDS="-* ~amd64 ~x86" RESTRICT="mirror" IUSE="" QA_PRESTRIPPED="/opt/${MY_PN}/bin/hamachid" pkg_setup() { einfo "Checking your kernel configuration for TUN/TAP support." CONFIG_CHECK="~TUN" check_extra_config } src_unpack() { unpack "${A}" mv ${MY_P}-$(use x86 && echo x86 || echo x64) "${S}" || die } src_install() { # Hamachi einfo "Installing Hamachi" insinto /opt/${MY_PN}/bin insopts -m0755 doins hamachid dnsup dnsdown || die dosym /opt/${MY_PN}/bin/hamachid /usr/bin/hamachi || die "Couldn't create hamachi symlink" dodir /var/run/${MY_PN} || die # Config and log directory dodir /var/lib/${MY_PN} # Setup files einfo "Installing config files" newconfd "${FILESDIR}"/${MY_PN}.confd ${MY_PN} || die newinitd "${FILESDIR}"/${MY_PN}.initd ${MY_PN} || die # Docs dodoc CHANGES README || die } 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" }