1 |
# Copyright 1999-2005 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/pwlib/pwlib-1.5.2-r3.ebuild,v 1.9 2005/01/08 20:12:42 stkn Exp $ |
4 |
|
5 |
inherit eutils |
6 |
|
7 |
DESCRIPTION="Portable Multiplatform Class Libraries for OpenH323" |
8 |
HOMEPAGE="http://www.openh323.org/" |
9 |
SRC_URI="http://www.openh323.org/bin/${PN}_${PV}.tar.gz" |
10 |
|
11 |
LICENSE="MPL-1.1" |
12 |
SLOT="0" |
13 |
KEYWORDS="x86 ppc sparc alpha amd64" |
14 |
IUSE="ssl sdl ldap" |
15 |
|
16 |
DEPEND=">=sys-devel/bison-1.28 |
17 |
>=sys-devel/flex-2.5.4a |
18 |
dev-libs/expat |
19 |
>=sys-apps/sed-4 |
20 |
ldap? ( net-nds/openldap ) |
21 |
sdl? ( media-libs/libsdl ) |
22 |
ssl? ( dev-libs/openssl )" |
23 |
|
24 |
S=${WORKDIR}/${PN} |
25 |
|
26 |
src_unpack() { |
27 |
unpack ${A} |
28 |
cd ${S} |
29 |
|
30 |
# fix #45846 / CAN-2004-0097 |
31 |
epatch ${FILESDIR}/${P}-asnparser-secfix.diff |
32 |
|
33 |
cd ${S}/make |
34 |
|
35 |
# filter out -O3 and -mcpu embedded compiler flags |
36 |
sed -i \ |
37 |
-e "s:-mcpu=\$(CPUTYPE)::" \ |
38 |
-e "s:-O3 -DNDEBUG:-DNDEBUG:" \ |
39 |
unix.mak |
40 |
} |
41 |
|
42 |
src_compile() { |
43 |
if use ssl ; then |
44 |
export OPENSSLFLAG=1 |
45 |
export OPENSSLDIR="/usr" |
46 |
export OPENSSLLIBS="-lssl -lcrypt" |
47 |
fi |
48 |
|
49 |
econf || die "configure failed" |
50 |
|
51 |
# Horrible hack to strip out -L/usr/lib to allow upgrades |
52 |
# problem is it adds -L/usr/lib before -L${S} when SSL is |
53 |
# enabled. Same thing for -I/usr/include. |
54 |
sed -i -e "s:^\(LDFLAGS.*\)-L/usr/lib:\1:" \ |
55 |
-e "s:^\(STDCCFLAGS.*\)-I/usr/include:\1:" \ |
56 |
${S}/make/ptbuildopts.mak |
57 |
sed -i -e "s:^\(LDFLAGS[\s]*=.*\) -L/usr/lib:\1:" \ |
58 |
-e "s:^\(LDFLAGS[\s]*=.*\) -I/usr/include:\1:" \ |
59 |
-e "s:^\(CCFLAGS[\s]*=.*\) -I/usr/include:\1:" \ |
60 |
${S}/make/ptlib-config |
61 |
|
62 |
emake -j1 opt || die "make failed" |
63 |
} |
64 |
|
65 |
src_install() { |
66 |
# make these because the makefile isn't smart enough |
67 |
dodir /usr/bin /usr/lib /usr/share /usr/include |
68 |
make PREFIX=${D}/usr install || die "install failed" |
69 |
|
70 |
# these are for compiling openh323 |
71 |
# NOTE: symlinks don't work when upgrading |
72 |
# FIXME: probably should fix this with ptlib-config |
73 |
dodir /usr/share/pwlib/include |
74 |
cp -r ${D}/usr/include/* ${D}/usr/share/pwlib/include |
75 |
|
76 |
dodir /usr/share/pwlib/lib |
77 |
for x in ${D}/usr/lib/*; do |
78 |
dosym /usr/lib/`basename ${x}` /usr/share/pwlib/lib/`basename ${x}` |
79 |
done |
80 |
|
81 |
# remove CVS dirs |
82 |
find ${D} -name CVS -type d | xargs rm -rf |
83 |
|
84 |
# fix symlink |
85 |
# only amd64 needs special care, afaiks |
86 |
rm ${D}/usr/lib/libpt.so |
87 |
if [ ${ARCH} = "amd64" ] ; then |
88 |
dosym /usr/lib/libpt_linux_x86_64_r.so.${PV} /usr/lib/libpt.so |
89 |
else |
90 |
dosym /usr/lib/libpt_linux_${ARCH}_r.so.${PV} /usr/lib/libpt.so |
91 |
fi |
92 |
|
93 |
# strip ${S} stuff |
94 |
dosed "s:^PWLIBDIR.*:PWLIBDIR=/usr/share/pwlib:" /usr/bin/ptlib-config |
95 |
dosed "s:^PWLIBDIR.*:PWLIBDIR=/usr/share/pwlib:" /usr/share/pwlib/make/ptbuildopts.mak |
96 |
|
97 |
# dodgy configure/makefiles forget to expand this |
98 |
dosed 's:${exec_prefix}:/usr:' /usr/bin/ptlib-config |
99 |
|
100 |
# satisfy ptlib.mak's weird definition (should check if true for future versions) |
101 |
cp ${D}/usr/bin/ptlib-config ${D}/usr/share/pwlib/make/ptlib-config |
102 |
|
103 |
# copy version.h |
104 |
insinto /usr/share/pwlib |
105 |
doins version.h |
106 |
|
107 |
dodoc ReadMe.txt History.txt |
108 |
} |