comparison dev-db/libpq/libpq-8.3.1.ebuild @ 0:7985ba427c7d

initial import from svn
author holger@wizards.de
date Sat, 22 Mar 2008 03:58:33 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7985ba427c7d
1 # Copyright 1999-2008 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.2.6.ebuild,v 1.1 2008/01/13 01:38:02 mjolnir Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs
6
7 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
8
9 MY_PV="${PV/_rc/RC}"
10 DESCRIPTION="PostgreSQL libraries."
11 HOMEPAGE="http://www.postgresql.org/"
12 SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
13 LICENSE="POSTGRESQL"
14 SLOT="4"
15 IUSE="kerberos nls pam pg-intdatetime readline ssl threads zlib"
16 RESTRICT="nomirror"
17
18 RDEPEND="!<=dev-db/postgresql-8.1.4
19 kerberos? ( virtual/krb5 )
20 pam? ( virtual/pam )
21 readline? ( >=sys-libs/readline-4.1 )
22 ssl? ( >=dev-libs/openssl-0.9.6-r1 )
23 zlib? ( >=sys-libs/zlib-1.1.3 )"
24 DEPEND="${RDEPEND}
25 sys-devel/autoconf
26 >=sys-devel/bison-1.875
27 nls? ( sys-devel/gettext )"
28
29 S="${WORKDIR}/postgresql-${MY_PV}"
30
31 pkg_preinst() {
32 # Removing wrong symlink created by previous ebuild
33 if [[ -L "${ROOT}/usr/include/libpq" ]] ; then
34 rm -f "${ROOT}/usr/include/libpq"
35 fi
36 }
37
38 src_unpack() {
39 unpack ${A}
40 cd "${S}"
41
42 epatch "${FILESDIR}/${PN}-${PV}-gentoo.patch"
43 }
44
45 src_compile() {
46 filter-flags -ffast-math -feliminate-dwarf2-dups
47
48 econf --prefix=/usr \
49 --includedir=/usr/include/postgresql/libpq-${SLOT} \
50 --sysconfdir=/etc/postgresql \
51 --mandir=/usr/share/man \
52 --host=${CHOST} \
53 --with-docdir=/usr/share/doc/${PF} \
54 --libdir=/usr/$(get_libdir) \
55 --enable-depend \
56 $(use_with kerberos krb5) \
57 $(use_enable nls ) \
58 $(use_with pam) \
59 --without-perl \
60 $(use_enable pg-intdatetime integer-datetimes ) \
61 --without-python \
62 $(use_with readline) \
63 $(use_with ssl openssl) \
64 --without-tcl \
65 $(use_enable threads thread-safety ) \
66 $(use_with zlib) \
67 || die "configure failed"
68
69 cd "${S}/src/interfaces/libpq"
70 emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake libpq failed"
71
72 cd "${S}/src/bin/pg_config"
73 emake -j1 LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake pg_config failed"
74 }
75
76 src_install() {
77 cd "${S}/src/interfaces/libpq"
78 emake DESTDIR="${D}" LIBDIR="${D}/usr/$(get_libdir)" install || die "emake install libpq failed"
79
80 cd "${S}/src/include"
81 emake DESTDIR="${D}" install || die "emake install headers failed"
82
83 cd "${S}/src/bin/pg_config"
84 emake DESTDIR="${D}" install || die "emake install pg_config failed"
85
86 cd "${S}"
87 dodoc README HISTORY
88
89 dosym libpq-${SLOT}.a /usr/$(get_libdir)/libpq.a
90
91 for f in $(ls -1 "${D}"/usr/include/postgresql/libpq-${SLOT}/*.h) ; do
92 dosym postgresql/libpq-${SLOT}/$(basename ${f}) /usr/include/
93 done
94
95 dodir /usr/include/libpq
96 for f in $(ls -1 "${D}"/usr/include/postgresql/libpq-${SLOT}/libpq/*.h) ; do
97 dosym ../postgresql/libpq-${SLOT}/libpq/$(basename ${f}) /usr/include/libpq/
98 done
99
100 cd "${D}/usr/include/postgresql/libpq-${SLOT}"
101 for f in $(find * -name '*.h' -print) ; do
102 destdir=$(dirname ${f})
103 if [[ ! -d "${D}/usr/include/postgresql/${destdir}" ]] ; then
104 dodir "/usr/include/postgresql/${destdir}"
105 fi
106 dosym /usr/include/postgresql/libpq-${SLOT}/${f} "/usr/include/postgresql/${destdir}/"
107 done
108 }
109
110 src_test() {
111 einfo "No tests available for libpq."
112 }