| 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-db/libpq/libpq-8.1.0.ebuild,v 1.2 2005/11/12 22:46:07 nakano Exp $
|
| 4 |
|
| 5 |
EAPI="prefix"
|
| 6 |
|
| 7 |
inherit eutils gnuconfig flag-o-matic toolchain-funcs
|
| 8 |
|
| 9 |
DESCRIPTION="Libraries of postgresql"
|
| 10 |
HOMEPAGE="http://www.postgresql.org/"
|
| 11 |
MY_P="postgresql-${PV}"
|
| 12 |
SRC_URI="mirror://postgresql/source/v${PV}/postgresql-base-${PV}.tar.bz2"
|
| 13 |
|
| 14 |
LICENSE="POSTGRESQL"
|
| 15 |
SLOT="4"
|
| 16 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~ppc-macos ~s390 ~sh ~sparc ~x86"
|
| 17 |
IUSE="ssl nls pam readline zlib kerberos"
|
| 18 |
|
| 19 |
S=${WORKDIR}/${MY_P}
|
| 20 |
DEPEND="virtual/libc
|
| 21 |
sys-devel/autoconf
|
| 22 |
>=sys-libs/ncurses-5.2
|
| 23 |
>=sys-devel/bison-1.875
|
| 24 |
zlib? ( >=sys-libs/zlib-1.1.3 )
|
| 25 |
readline? ( >=sys-libs/readline-4.1 )
|
| 26 |
ssl? ( >=dev-libs/openssl-0.9.6-r1 )
|
| 27 |
nls? ( sys-devel/gettext )
|
| 28 |
kerberos? ( virtual/krb5 )"
|
| 29 |
RDEPEND="virtual/libc
|
| 30 |
zlib? ( >=sys-libs/zlib-1.1.3 )
|
| 31 |
ssl? ( >=dev-libs/openssl-0.9.6-r1 )
|
| 32 |
kerberos? ( virtual/krb5 )"
|
| 33 |
|
| 34 |
MAKEOPTS="${MAKEOPTS} -j1"
|
| 35 |
|
| 36 |
pkg_preinst() {
|
| 37 |
# removing wrong symlink which is created by previous ebuild.
|
| 38 |
if [ -L ${ROOT}/usr/include/libpq ]; then
|
| 39 |
rm ${ROOT}/usr/include/libpq
|
| 40 |
fi
|
| 41 |
}
|
| 42 |
|
| 43 |
src_unpack() {
|
| 44 |
unpack ${A}
|
| 45 |
epatch ${FILESDIR}/${P}-gentoo.patch
|
| 46 |
}
|
| 47 |
|
| 48 |
src_compile() {
|
| 49 |
filter-flags -ffast-math -feliminate-dwarf2-dups
|
| 50 |
|
| 51 |
local myconf
|
| 52 |
use ssl && myconf="$myconf --with-openssl"
|
| 53 |
use nls && myconf="$myconf --enable-nls"
|
| 54 |
use pam && myconf="$myconf --with-pam"
|
| 55 |
use readline || myconf="$myconf --without-readline"
|
| 56 |
use zlib || myconf="$myconf --without-zlib"
|
| 57 |
use kerberos && myconf="$myconf --with-krb5"
|
| 58 |
|
| 59 |
# these are the only working CFLAGS I could get on ppc, so locking them
|
| 60 |
# down, anything more aggressive fails (i.e. -mcpu or -Ox)
|
| 61 |
# Gerk - Nov 26, 2002
|
| 62 |
use ppc && CFLAGS="-pipe -fsigned-char"
|
| 63 |
|
| 64 |
# Detect mips systems properly
|
| 65 |
gnuconfig_update
|
| 66 |
|
| 67 |
./configure \
|
| 68 |
$(with_prefix) \
|
| 69 |
--include=${PREFIX}/usr/include/postgresql/libpq-${SLOT} \
|
| 70 |
$(with_mandir) \
|
| 71 |
--host=${CHOST} \
|
| 72 |
--with-docdir=${PREFIX}/usr/share/doc/${PF} \
|
| 73 |
--libdir=${PREFIX}/usr/$(get_libdir) \
|
| 74 |
--enable-depend \
|
| 75 |
$myconf || die
|
| 76 |
|
| 77 |
cd ${S}/src/interfaces/libpq
|
| 78 |
emake LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die
|
| 79 |
}
|
| 80 |
|
| 81 |
src_install() {
|
| 82 |
cd ${S}/src/interfaces/libpq
|
| 83 |
make DESTDIR=${DEST} LIBDIR=${D}/usr/$(get_libdir) install || die
|
| 84 |
|
| 85 |
cd ${S}/src/include
|
| 86 |
make DESTDIR=${DEST} install || die
|
| 87 |
|
| 88 |
cd ${S}
|
| 89 |
dodoc README HISTORY COPYRIGHT INSTALL
|
| 90 |
|
| 91 |
dosym libpq-${SLOT}.a /usr/$(get_libdir)/libpq.a
|
| 92 |
|
| 93 |
for f in ${D}/usr/include/postgresql/libpq-${SLOT}/*.h
|
| 94 |
do
|
| 95 |
dosym postgresql/libpq-${SLOT}/$(basename $f) /usr/include/
|
| 96 |
done
|
| 97 |
|
| 98 |
dodir /usr/include/libpq
|
| 99 |
for f in ${D}/usr/include/postgresql/libpq-${SLOT}/libpq/*.h
|
| 100 |
do
|
| 101 |
dosym ../postgresql/libpq-${SLOT}/libpq/$(basename $f) /usr/include/libpq/
|
| 102 |
done
|
| 103 |
|
| 104 |
cd ${D}/usr/include/postgresql/libpq-${SLOT}
|
| 105 |
for f in $(find * -name '*.h' -print) ; do
|
| 106 |
destdir=$(dirname $f)
|
| 107 |
if [ ! -d "${D}/usr/include/postgresql/${destdir}" ]; then
|
| 108 |
dodir /usr/include/postgresql/${destdir}
|
| 109 |
fi
|
| 110 |
dosym /usr/include/postgresql/libpq-${SLOT}/${f} /usr/include/postgresql/${destdir}/
|
| 111 |
done
|
| 112 |
}
|