summaryrefslogtreecommitdiff
blob: bb34e711fbabbd352ff68f5c5ff3fb81521c619c (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
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.0.3-r3.ebuild,v 1.3 2002/07/11 06:30:19 drobbins Exp $

S=${WORKDIR}/${P}/src
DESCRIPTION="PostgreSQL is a sophisticated Object-Relational DBMS"
SRC_URI="ftp://ftp.postgresql.org/pub/v7.0.3/${P}.tar.gz"
HOMEPAGE="http://postgresql.readysetnet.com/"
LICENSE="POSTGRESQL"

DEPEND=">=dev-lang/tk-8"

src_unpack() {
  unpack ${A}
  cd ${S}/backend/catalog
  cp genbki.sh.in genbki.sh.orig
  sed -e 's:\\name:name:' genbki.sh.orig > genbki.sh.in
}

src_compile() {

    cd ${S}
    try ./configure --prefix=/usr --host=${CHOST} \
	--enable-locale --with-tcl --enable-syslog
    cp Makefile.global Makefile.orig
    sed -e "s:^TEMPLATEDIR=.*:TEMPLATEDIR=\$(POSTGRESDIR)/lib/pgsql:" \
	-e "s:^HEADERDIR=.*:HEADERDIR=\$(POSTGRESDIR)/include/pgsql:" \
	-e "s:-O2:${CFLAGS}:" \
	Makefile.orig > Makefile.global
    try make

}

src_install () {

    cd ${S}
    dodir /usr/include/pgsql
    try make POSTGRESDIR=${D}/usr install
    dosed "s:/usr/pgaccess:/usr/lib/pgaccess:" /usr/bin/pgaccess
    cd ${D}/usr
    mv pgaccess lib
    cd lib/postgres
    cd ${S}/../doc
    dodoc FAQ* KNOWN_BUGS MISSING_FEATURES README*
    dodoc TODO* internals.ps bug.template
    dodoc *.tar.gz
	 exeinto /usr/bin
    doexe ${FILESDIR}/postmaster-wrapper
    exeinto /etc/rc.d/init.d/
    doexe ${FILESDIR}/pgsql
}


pkg_config() {
   mkdir -p /var/db/pgsql/data
   chown -R postgres /var/db/pgsql/data
   su - postgres -c "/usr/bin/initdb -D /var/db/pgsql/data"
}