1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib toolchain-funcs
8 DESCRIPTION="Automatic open port forwarder using UPnP"
9 HOMEPAGE="http://github.com/mgorny/autoupnp/"
10 SRC_URI="http://github.com/downloads/mgorny/${PN}/${P}.tar.bz2"
15 IUSE="libnotify multilib suid"
17 RDEPEND="net-misc/miniupnpc
18 libnotify? ( x11-libs/libnotify )"
24 WANT_LIBNOTIFY=$(use libnotify && echo true || echo false) \
25 all $(use suid || echo dummy) || die
27 if has_multilib_profile && use multilib; then
29 for abi in $(get_install_abis); do
30 multilib_toolchain_setup ${abi}
31 if ! is_final_abi; then
32 einfo "Building the dummy lib for ${abi}"
33 mkdir "${S}"/${abi} || die
34 cd "${S}"/${abi} || die
35 emake -f ../Makefile DUMMYLIB=${PN}.so dummy || die
42 emake LIBPREFIX= DESTDIR="${D}" LIBDIRNAME=$(get_libdir) \
43 $(use suid && echo install-suid || echo install-dummy) || die
45 if has_multilib_profile && use multilib; then
47 for abi in $(get_install_abis); do
49 is_final_abi || dolib ${abi}/${PN}.so || die
53 dodoc NEWS README || die
57 elog "Please notice that AutoUPnP was rewritten in the form of a C LD_PRELOAD"
58 elog "library, and thus it has to be enabled for a particular program to have"
59 elog "its ports redirected. To enable it for the current user, call:"
60 elog " $ autoupnp install"
63 ewarn "You have chosen to install ${PN}.so setuid & setgid. Please notice that this"
64 ewarn "is discouraged in the terms of security. You have been warned."
66 # need to work-around Portage behavior to make ld.so happy (bug #334473)
67 chmod o+r "${ROOT}"usr/$(get_libdir)/${PN}.so || die
69 chmod o+r "${ROOT}"$(get_libdir)/${PN}.so || die
72 if has_multilib_profile && use multilib; then
74 elog "A dummy libraries were installed for your additional ABIs. They will"
75 elog "silence the ld.so complaints when running alternate ABI applications"
76 elog "but won't bring real UPnP support to them."