269
|
1 # Copyright 1999-2010 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-9.0.1.ebuild,v 1.1 2010/10/06 14:57:13 patrick Exp $
|
|
4
|
|
5 EAPI="2"
|
|
6
|
|
7 WANT_AUTOMAKE="none"
|
|
8
|
|
9 inherit eutils multilib versionator autotools
|
|
10
|
|
11 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
|
|
12
|
|
13 DESCRIPTION="PostgreSQL libraries and clients"
|
|
14 HOMEPAGE="http://www.postgresql.org/"
|
|
15
|
|
16 MY_PV=${PV/_/}
|
|
17 SRC_URI="mirror://postgresql/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
|
|
18 S=${WORKDIR}/postgresql-${MY_PV}
|
|
19
|
|
20 LICENSE="POSTGRESQL"
|
|
21 SLOT="$(get_version_component_range 1-2)"
|
|
22 LINGUAS="af cs de es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW"
|
|
23 IUSE="doc kerberos ldap nls pam pg_legacytimestamp readline ssl threads zlib"
|
|
24
|
|
25 for lingua in ${LINGUAS}; do
|
|
26 IUSE+=" linguas_${lingua}"
|
|
27 done
|
|
28
|
|
29 RESTRICT="test"
|
|
30
|
|
31 wanted_languages() {
|
|
32 local enable_langs
|
|
33
|
|
34 for lingua in ${LINGUAS} ; do
|
|
35 use linguas_${lingua} && enable_langs+="${lingua} "
|
|
36 done
|
|
37
|
|
38 echo -n ${enable_langs}
|
|
39 }
|
|
40
|
|
41 RDEPEND="!!dev-db/postgresql-libs
|
|
42 !!dev-db/postgresql-client
|
|
43 !!dev-db/libpq
|
|
44 !!dev-db/postgresql
|
|
45 >=app-admin/eselect-postgresql-0.3
|
|
46 virtual/libintl
|
|
47 kerberos? ( virtual/krb5 )
|
|
48 ldap? ( net-nds/openldap )
|
|
49 pam? ( virtual/pam )
|
|
50 readline? ( sys-libs/readline )
|
|
51 ssl? ( >=dev-libs/openssl-0.9.6-r1 )
|
|
52 zlib? ( sys-libs/zlib )"
|
|
53 DEPEND="${RDEPEND}
|
|
54 sys-devel/bison
|
|
55 sys-devel/flex
|
|
56 nls? ( sys-devel/gettext )"
|
|
57 PDEPEND="doc? ( ~dev-db/postgresql-docs-${PV} )"
|
|
58
|
|
59 src_prepare() {
|
|
60 epatch "${FILESDIR}/postgresql-9.0-common.3.patch" \
|
|
61 "${FILESDIR}/postgresql-${SLOT}-base.3.patch"
|
|
62
|
|
63 # to avoid collision - it only should be installed by server
|
|
64 rm "${S}/src/backend/nls.mk"
|
|
65
|
|
66 # because psql/help.c includes the file
|
|
67 ln -s "${S}/src/include/libpq/pqsignal.h" "${S}/src/bin/psql/" || die
|
|
68
|
|
69 eautoconf
|
|
70 }
|
|
71
|
|
72 src_configure() {
|
|
73 export LDFLAGS_SL="${LDFLAGS}"
|
|
74 econf \
|
|
75 --prefix=/usr/$(get_libdir)/postgresql-${SLOT} \
|
|
76 --datadir=/usr/share/postgresql-${SLOT} \
|
|
77 --docdir=/usr/share/doc/postgresql-${SLOT} \
|
|
78 --sysconfdir=/etc/postgresql-${SLOT} \
|
|
79 --includedir=/usr/include/postgresql-${SLOT} \
|
|
80 --mandir=/usr/share/postgresql-${SLOT}/man \
|
|
81 --enable-depend \
|
|
82 --without-tcl \
|
|
83 --without-perl \
|
|
84 --without-python \
|
|
85 $(use_with readline) \
|
|
86 $(use_with kerberos krb5) \
|
|
87 $(use_with kerberos gssapi) \
|
|
88 "$(use_enable nls nls "$(wanted_languages)")" \
|
|
89 $(use_with pam) \
|
|
90 $(use_enable !pg_legacytimestamp integer-datetimes) \
|
|
91 $(use_with ssl openssl) \
|
|
92 $(use_enable threads thread-safety) \
|
|
93 $(use_with zlib) \
|
|
94 $(use_with ldap)
|
|
95 }
|
|
96
|
|
97 src_compile() {
|
|
98 emake || die "emake failed"
|
|
99
|
|
100 cd "${S}/contrib"
|
|
101 emake || die "emake failed"
|
|
102 }
|
|
103
|
|
104 src_install() {
|
|
105 emake DESTDIR="${D}" install || die "emake install failed"
|
|
106 insinto /usr/include/postgresql-${SLOT}/postmaster
|
|
107 doins "${S}"/src/include/postmaster/*.h || die
|
|
108
|
|
109 dodir /usr/share/postgresql-${SLOT}/man/man1/ || die
|
|
110 cp "${S}"/doc/src/sgml/man1/* "${D}"/usr/share/postgresql-${SLOT}/man/man1/ || die
|
|
111
|
|
112 rm "${D}/usr/share/postgresql-${SLOT}/man/man1"/{initdb,ipcclean,pg_controldata,pg_ctl,pg_resetxlog,pg_restore,postgres,postmaster}.1
|
|
113 dodoc README HISTORY doc/{README.*,TODO,bug.template} || die
|
|
114
|
|
115 cd "${S}/contrib"
|
|
116 emake DESTDIR="${D}" install || die "emake install failed"
|
|
117 cd "${S}"
|
|
118
|
|
119 dodir /etc/eselect/postgresql/slots/${SLOT} || die
|
|
120
|
|
121 IDIR="/usr/include/postgresql-${SLOT}"
|
|
122 cat > "${D}/etc/eselect/postgresql/slots/${SLOT}/base" <<-__EOF__
|
|
123 postgres_ebuilds="\${postgres_ebuilds} ${PF}"
|
|
124 postgres_prefix=/usr/$(get_libdir)/postgresql-${SLOT}
|
|
125 postgres_datadir=/usr/share/postgresql-${SLOT}
|
|
126 postgres_bindir=/usr/$(get_libdir)/postgresql-${SLOT}/bin
|
|
127 postgres_symlinks=(
|
|
128 ${IDIR} /usr/include/postgresql
|
|
129 ${IDIR}/libpq-fe.h /usr/include/libpq-fe.h
|
|
130 ${IDIR}/pg_config_manual.h /usr/include/pg_config_manual.h
|
|
131 ${IDIR}/libpq /usr/include/libpq
|
|
132 ${IDIR}/postgres_ext.h /usr/include/postgres_ext.h
|
|
133 )
|
|
134 __EOF__
|
|
135
|
|
136 cat >"${T}/50postgresql-94-${SLOT}" <<-__EOF__
|
|
137 LDPATH=/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)
|
|
138 MANPATH=/usr/share/postgresql-${SLOT}/man
|
|
139 __EOF__
|
|
140 doenvd "${T}/50postgresql-94-${SLOT}" || die
|
|
141
|
|
142 keepdir /etc/postgresql-${SLOT} || die
|
|
143 }
|
|
144
|
|
145 pkg_postinst() {
|
|
146 eselect postgresql update
|
|
147 [[ "$(eselect postgresql show)" = "(none)" ]] && eselect postgresql set ${SLOT}
|
|
148 elog "If you need a global psqlrc-file, you can place it in:"
|
|
149 elog " '${ROOT}/etc/postgresql-${SLOT}/'"
|
|
150 elog
|
|
151 }
|
|
152
|
|
153 pkg_postrm() {
|
|
154 eselect postgresql update
|
|
155 }
|