148
|
1 # Copyright 1999-2009 Gentoo Foundation
|
|
2 # Distributed under the terms of the GNU General Public License v2
|
|
3 # $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-base/postgresql-base-8.3.7.ebuild,v 1.2 2009/05/03 11:53:53 armin76 Exp $
|
|
4
|
|
5 EAPI="1"
|
|
6
|
|
7 WANT_AUTOCONF="latest"
|
|
8 WANT_AUTOMAKE="none"
|
|
9
|
|
10 inherit eutils multilib toolchain-funcs versionator autotools
|
|
11
|
|
12 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
|
|
13
|
|
14 DESCRIPTION="PostgreSQL libraries and clients"
|
|
15 HOMEPAGE="http://www.postgresql.org/"
|
|
16 SRC_URI="mirror://postgresql/source/v${PV}/postgresql-${PV}.tar.bz2"
|
|
17 LICENSE="POSTGRESQL"
|
|
18 SLOT="$(get_version_component_range 1-2)"
|
|
19 IUSE_LINGUAS="
|
|
20 linguas_af linguas_cs linguas_de linguas_es linguas_fa linguas_fr
|
|
21 linguas_hr linguas_hu linguas_it linguas_ko linguas_nb linguas_pl
|
|
22 linguas_pt_BR linguas_ro linguas_ru linguas_sk linguas_sl linguas_sv
|
|
23 linguas_tr linguas_zh_CN linguas_zh_TW"
|
|
24 IUSE="doc kerberos nls pam pg-intdatetime readline ssl threads zlib ldap ${IUSE_LINGUAS}"
|
|
25 RESTRICT="test"
|
|
26
|
|
27 wanted_languages() {
|
|
28 for u in ${IUSE_LINGUAS} ; do
|
|
29 use $u && echo -n "${u#linguas_} "
|
|
30 done
|
|
31 }
|
|
32
|
|
33 RDEPEND="kerberos? ( virtual/krb5 )
|
|
34 pam? ( virtual/pam )
|
|
35 readline? ( >=sys-libs/readline-4.1 )
|
|
36 ssl? ( >=dev-libs/openssl-0.9.6-r1 )
|
|
37 zlib? ( >=sys-libs/zlib-1.1.3 )
|
|
38 >=app-admin/eselect-postgresql-0.3
|
|
39 !dev-db/postgresql-libs
|
|
40 !dev-db/postgresql-client
|
|
41 !dev-db/libpq
|
|
42 !dev-db/postgresql
|
|
43 ldap? ( net-nds/openldap )"
|
|
44 DEPEND="${RDEPEND}
|
|
45 sys-devel/flex
|
|
46 >=sys-devel/bison-1.875
|
|
47 nls? ( sys-devel/gettext )"
|
|
48 PDEPEND="doc? ( dev-db/postgresql-docs:${SLOT} )"
|
|
49
|
|
50 S="${WORKDIR}/postgresql-${PV}"
|
|
51
|
|
52 src_unpack() {
|
|
53 unpack ${A}
|
|
54 cd "${S}"
|
|
55
|
|
56 epatch "${FILESDIR}/postgresql-${SLOT}-common.patch" \
|
|
57 "${FILESDIR}/postgresql-${SLOT}-base.patch"
|
|
58
|
|
59 # to avoid collision - it only should be installed by server
|
|
60 rm "${S}/src/backend/nls.mk"
|
|
61
|
|
62 # because psql/help.c includes the file
|
|
63 ln -s "${S}/src/include/libpq/pqsignal.h" "${S}/src/bin/psql/"
|
|
64
|
|
65 eautoconf
|
|
66 }
|
|
67
|
|
68 src_compile() {
|
|
69 econf --prefix=/usr/$(get_libdir)/postgresql-${SLOT} \
|
|
70 --datadir=/usr/share/postgresql-${SLOT} \
|
|
71 --sysconfdir=/etc/postgresql-${SLOT} \
|
|
72 --includedir=/usr/include/postgresql-${SLOT} \
|
|
73 --with-locale-dir=/usr/share/postgresql-${SLOT}/locale \
|
|
74 --mandir=/usr/share/postgresql-${SLOT}/man \
|
|
75 --without-docdir \
|
|
76 --enable-depend \
|
|
77 --without-tcl \
|
|
78 --without-perl \
|
|
79 --without-python \
|
|
80 $(use_with readline) \
|
|
81 $(use_with kerberos krb5) \
|
|
82 $(use_with kerberos gssapi) \
|
|
83 "$(use_enable nls nls "$(wanted_languages)")" \
|
|
84 $(use_with pam) \
|
|
85 $(use_enable pg-intdatetime integer-datetimes ) \
|
|
86 $(use_with ssl openssl) \
|
|
87 $(use_enable threads thread-safety) \
|
|
88 $(use_enable threads thread-safety-force) \
|
|
89 $(use_with zlib) \
|
|
90 $(use_with ldap) \
|
|
91 ${myconf} \
|
|
92 || die "configure failed"
|
|
93
|
|
94 emake LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake failed"
|
|
95
|
|
96 cd "${S}/contrib"
|
|
97 emake LD="$(tc-getLD) $(get_abi_LDFLAGS)" || die "emake failed"
|
|
98 }
|
|
99
|
|
100 src_install() {
|
|
101 emake DESTDIR="${D}" install || die "emake install failed"
|
|
102 insinto /usr/include/postgresql-${SLOT}/postmaster
|
|
103 doins "${S}"/src/include/postmaster/*.h
|
|
104 dodir /usr/share/postgresql-${SLOT}/man/man1
|
|
105 tar -zxf "${S}/doc/man.tar.gz" -C "${D}"/usr/share/postgresql-${SLOT}/man man1/{ecpg,pg_config}.1
|
|
106
|
|
107 rm "${D}/usr/share/postgresql-${SLOT}/man/man1"/{initdb,ipcclean,pg_controldata,pg_ctl,pg_resetxlog,pg_restore,postgres,postmaster}.1
|
|
108 dodoc README HISTORY doc/{README.*,TODO,bug.template}
|
|
109
|
|
110 cd "${S}/contrib"
|
|
111 emake DESTDIR="${D}" install || die "emake install failed"
|
|
112 cd "${S}"
|
|
113
|
|
114 dodir /etc/eselect/postgresql/slots/${SLOT}
|
|
115
|
|
116 IDIR="/usr/include/postgresql-${SLOT}"
|
|
117 cat > "${D}/etc/eselect/postgresql/slots/${SLOT}/base" <<-__EOF__
|
|
118 postgres_ebuilds="\${postgres_ebuilds} ${PF}"
|
|
119 postgres_prefix=/usr/$(get_libdir)/postgresql-${SLOT}
|
|
120 postgres_datadir=/usr/share/postgresql-${SLOT}
|
|
121 postgres_bindir=/usr/$(get_libdir)/postgresql-${SLOT}/bin
|
|
122 postgres_symlinks=(
|
|
123 ${IDIR} /usr/include/postgresql
|
|
124 ${IDIR}/libpq-fe.h /usr/include/libpq-fe.h
|
|
125 ${IDIR}/libpq /usr/include/libpq
|
|
126 ${IDIR}/postgres_ext.h /usr/include/postgres_ext.h
|
|
127 )
|
|
128 __EOF__
|
|
129
|
|
130 cat >"${T}/50postgresql-94-${SLOT}" <<-__EOF__
|
|
131 LDPATH=/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)
|
|
132 MANPATH=/usr/share/postgresql-${SLOT}/man
|
|
133 __EOF__
|
|
134 doenvd "${T}/50postgresql-94-${SLOT}"
|
|
135
|
|
136 keepdir /etc/postgresql-${SLOT}
|
|
137 }
|
|
138
|
|
139 pkg_postinst() {
|
|
140 eselect postgresql update
|
|
141 [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
|
|
142 elog "If you need a global psqlrc-file, you can place it in '${ROOT}/etc/postgresql-${SLOT}/'."
|
|
143 }
|
|
144
|
|
145 pkg_postrm() {
|
|
146 eselect postgresql update
|
|
147 }
|