summaryrefslogtreecommitdiff
blob: 5b2f678467d99b3139ca0451944d22004fa62cf9 (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
68
69
70
71
72
73
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/openh323/openh323-1.11.7.ebuild,v 1.9 2004/06/10 20:22:26 agriffis Exp $

IUSE="ssl"

S=${WORKDIR}/${PN}
DESCRIPTION="Open Source implementation of the ITU H.323 teleconferencing protocol"
HOMEPAGE="http://www.openh323.org"
SRC_URI="http://www.openh323.org/bin/${PN}_${PV}.tar.gz"

SLOT="0"
LICENSE="MPL-1.1"
KEYWORDS="x86 ~ppc -sparc "

DEPEND=">=sys-apps/sed-4
	=dev-libs/pwlib-1.4.11*
	ssl? ( dev-libs/openssl )"

pkg_setup() {
	# to prevent merge problems with broken makefiles from old
	# pwlib versions, we double-check here.

	if [ "` fgrep '\$(OPENSSLDIR)/include' /usr/share/pwlib/make/unix.mak`" ]
	then
		# patch unix.mak so it doesn't require annoying
		# unmerge/merge cycle to upgrade
		einfo "Fixing broken pwlib makefile."
		cd /usr/share/pwlib/make
		sed -i \
		-e "s:-DP_SSL -I\$(OPENSSLDIR)/include -I\$(OPENSSLDIR)/crypto:-DP_SSL:" \
		-e "s:^LDFLAGS.*\+= -L\$(OPENSSLDIR)/lib -L\$(OPENSSLDIR):LDFLAGS +=:" \
		unix.mak
	fi
}

src_compile() {
	export PWLIBDIR=/usr/share/pwlib
	export OPENH323DIR=${S}
	if use ssl; then
		export OPENSSLFLAG=1
		export OPENSSLDIR=/usr
		export OPENSSLLIBS="-lssl -lcrypt"
	fi
	make optshared || die
}

src_install() {

	dodir /usr/lib /usr/share/openh323

	cd ${S}/lib
	mv lib* ${D}/usr/lib

	cd ${S}
	find ./ -name 'CVS' -type d | xargs rm -rf
	cp -a * ${D}/usr/share/openh323

	# mod to keep gnugk happy
	insinto /usr/share/openh323/src
	newins ${FILESDIR}/openh323-1.11.2-emptyMakefile Makefile

	rm -f ${D}/usr/lib/libopenh323.so
	if [ ${ARCH} = "ppc" ] ; then
		dosym /usr/lib/libh323_linux_ppc_r.so.${PV} /usr/lib/libopenh323.so
	else
		dosym /usr/lib/libh323_linux_x86_r.so.${PV} /usr/lib/libopenh323.so
	fi


}