summaryrefslogtreecommitdiff
blob: 8f47899cbb8adba2eebe9de3018dc9980c63543b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit toolchain-funcs

DESCRIPTION="UT-VPN"
HOMEPAGE="http://utvpn.tsukuba.ac.jp/ja/"
SRC_URI="http://utvpn.tsukuba.ac.jp/files/utvpn/v${PV}-7101-public-2010.06.27/Source%20Code%20(Win32%20and%20Unix)/utvpn-src-unix-v101-7101-public-2010.06.27.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~x86-fbsd"
IUSE="elibc_FreeBSD"

DEPEND="
	dev-libs/openssl:0=
	sys-libs/ncurses:0=
	sys-libs/readline:0=
	sys-libs/zlib
	elibc_FreeBSD? ( sys-libs/freebsd-lib dev-libs/libiconv )"
RDEPEND="${DEPEND}"

S="${WORKDIR}"/utvpn-unix-v101-7101-public

src_prepare() {
	default

	local makefile=""
	if use x86 ;then
		makefile="linux_32bit_ja.mak"
	elif use amd64 ;then
		makefile="linux_64bit_ja.mak"
	elif use x86-fbsd ;then
		makefile="freebsd_32bit_ja.mak"
	fi
	cp makefiles/${makefile} Makefile || die

	sed -i \
		-e "s/-O2/${CFLAGS} ${myflag}/g" \
		-e "/^CC=/s:gcc:$(tc-getCC):" \
		-e "/^INSTALL_/s:=/:=${D}/:" Makefile || die
}

src_install() {
	local x
	dodir /usr/bin
	emake install || die

	for x in utvpnserver utvpnclient utvpncmd; do
		sed -i -e "s:${D}:${EROOT}:" "${D}"/usr/bin/$x || die
	done
}