summaryrefslogtreecommitdiff
blob: db1282492a52a020f1f6acb1ce9aacbf6c59d97b (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
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ada/adasockets/adasockets-1.8.4.4.ebuild,v 1.1 2005/02/23 17:49:56 dholm Exp $

inherit eutils gnat

DESCRIPTION="An Interface to BSD sockets from Ada (TCP, UDP and multicast)."
SRC_URI="http://www.rfc1149.net/download/adasockets/${P}.tar.gz"
HOMEPAGE="http://www.rfc1149.net/devel/adasockets/"
LICENSE="GMGPL"

DEPEND="dev-lang/gnat
	>=sys-apps/sed-4"
RDEPEND=""
SLOT="0"
IUSE=""
KEYWORDS="~x86 ~ppc"

src_compile() {
	econf --libdir=/usr/lib/ada/adalib \
		--includedir=/usr/lib/ada/adainclude || die "./configure failed"
	sed -i -e "s|-I\$libdir|-I/usr/lib/ada/adainclude|" src/adasockets-config.in

	unset ADA_INCLUDE_PATH
	unset ADA_OBJECTS_PATH
	emake || die
}

src_install () {
	cd ${S}
	#doins copies symlinks as regular files, resorting to manual cp
	dodir /usr/lib/ada/adalib/adasockets
	cp -d src/.libs/lib*.so* ${D}/usr/lib/ada/adalib/adasockets
	chmod 0755 ${D}/usr/lib/ada/adalib/adasockets/lib*.so*
	dosym /usr/lib/ada/adalib/adasockets/libadasockets.so /usr/lib
	dosym /usr/lib/ada/adalib/adasockets/libadasockets.so.0 /usr/lib
	dosym /usr/lib/ada/adalib/adasockets/libadasockets.so.0.0.0 /usr/lib
	insinto /usr/lib/ada/adalib/adasockets
	doins src/.libs/lib*.a
	chmod 0644 ${D}/usr/lib/ada/adalib/adasockets/lib*.a
	doins src/sockets*.ali
	chmod 0444 ${D}/usr/lib/ada/adalib/adasockets/sockets*.ali

	insinto /usr/lib/ada/adainclude/adasockets
	doins src/sockets*.ad[sb]

	dodoc AUTHORS COPYING INSTALL NEWS README
	dodoc doc/adasockets.pdf doc/adasockets.ps
	doinfo doc/adasockets.info
	doman man/adasockets-config.1
	dobin src/adasockets-config

	#set up environment
	dodir /etc/env.d
	echo "ADA_OBJECTS_PATH=/usr/lib/ada/adalib/${PN}" \
		> ${D}/etc/env.d/55adasockets
	echo "ADA_INCLUDE_PATH=/usr/lib/ada/adainclude/${PN}" \
		>> ${D}/etc/env.d/55adasockets
}

pkg_postinst() {
	einfo "The envaironment has been set up to make gnat automatically find files for"
	einfo "AdaSockets. In order to immediately activate these settings please do:"
	einfo "env-update"
	einfo "source /etc/profile"
	einfo "Otherwise the settings will become active next time you login"
}