1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils systemd versionator toolchain-funcs
9 MY_P=${PN}-$(replace_all_version_separators "_")
10 if [[ ${MY_P/_beta/} != ${MY_P} ]]; then
11 MY_P=${MY_P/_beta/-BETA}
16 DESCRIPTION="Client to connect to a tunnel broker using the TSP protocol (freenet6 for example)"
17 HOMEPAGE="http://gogonet.gogo6.com/page/download-1"
18 SRC_URI="http://gogo6.com/downloads/${MY_P}.tar.gz"
20 # GPL-2 for Gentoo init script
23 KEYWORDS="amd64 hppa sparc x86"
26 DEPEND="dev-libs/openssl"
29 >=sys-apps/net-tools-1.60_p20120127084908"
31 S="${WORKDIR}/${MY_P}"
34 epatch "${FILESDIR}"/${P}-overflow.patch
35 epatch "${FILESDIR}"/${P}+gcc-4.6.patch
37 # Make the makefile handle linking correctly
38 find . -name Makefile -exec sed -i \
39 -e 's:LDFLAGS:LDLIBS:g' \
40 -e '/\$(LDLIBS)/s:-o:$(LDFLAGS) -o:' \
41 {} + || die "multised failed"
43 sed -i -e 's:/usr/local/etc/gogoc:/etc/gogoc:' \
44 gogoc-tsp/platform/*/tsp_local.c \
45 || die "path sed failed"
47 # Newer net-tools use /bin
48 sed -i -e "/^\(route\|ifconfig\)=/s/sbin/bin/" \
49 gogoc-tsp/template/linux.sh \
50 || die "net-tools sed failed"
53 src_configure() { :; }
56 # parallel make fails as inter-directory dependecies are missing.
58 AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
59 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getCXX)" \
60 EXTRA_CFLAGS="${CFLAGS}" EXTRA_CXXFLAGS="${CXXFLAGS}" \
61 $(use debug && echo DEBUG=1) \
64 emake -C gogoc-tsp/conf \
65 PLATFORM=linux PLATFORM_DIR=../platform BIN_DIR=../bin \
75 dodoc bin/gogoc.conf.sample
77 exeinto /etc/gogoc/template
78 doexe template/linux.sh
80 newinitd "${FILESDIR}"/gogoc.rc gogoc
81 systemd_dounit "${FILESDIR}"/${PN}.service
83 doman man/{man5/gogoc.conf.5,man8/gogoc.8}
84 keepdir /var/lib/gogoc
91 elog "You should create an /etc/gogoc/gogoc.conf file starting from"
92 elog "the sample configuration in /usr/share/doc/${PF}/gogoc.conf.sample.*"
94 elog "To add support for a TSP IPv6 connection at startup,"
95 elog "remember to run:"
96 elog "# rc-update add gogoc default"