/[gentoo-x86]/dev-db/pgpool2/pgpool2-9999.ebuild
Gentoo

Diff of /dev-db/pgpool2/pgpool2-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-9999.ebuild,v 1.4 2012/04/23 15:00:45 titanofold Exp $ 3# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-9999.ebuild,v 1.5 2012/12/27 11:37:58 titanofold Exp $
4 4
5EAPI=4 5EAPI=4
6 6
7[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" 7[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}"
8 8
11[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" 11[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs"
12inherit base autotools ${SCM_ECLASS} 12inherit base autotools ${SCM_ECLASS}
13unset SCM_ECLASS 13unset SCM_ECLASS
14 14
15DESCRIPTION="Connection pool server for PostgreSQL" 15DESCRIPTION="Connection pool server for PostgreSQL"
16HOMEPAGE="http://pgpool.projects.postgresql.org/" 16HOMEPAGE="http://www.pgpool.net/"
17[[ ${PV} == 9999 ]] || SRC_URI="http://pgfoundry.org/frs/download.php/3076/${MY_P}.tar.gz" 17[[ ${PV} == 9999 ]] || SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
18
19LICENSE="BSD" 18LICENSE="BSD"
20SLOT="0" 19SLOT="0"
21[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" 20
21# Don't move KEYWORDS on the previous line or ekeyword won't work # 399061
22[[ ${PV} == 9999 ]] || \
23KEYWORDS="~amd64 ~x86"
24
22IUSE="pam ssl static-libs" 25IUSE="memcached pam ssl static-libs"
23 26
24RDEPEND=" 27RDEPEND="
25 dev-db/postgresql-base 28 dev-db/postgresql-base
29 memcached? ( dev-libs/libmemcached )
26 pam? ( sys-auth/pambase ) 30 pam? ( sys-auth/pambase )
27 ssl? ( dev-libs/openssl ) 31 ssl? ( dev-libs/openssl )
28" 32"
29DEPEND="${DEPEND} 33DEPEND="${RDEPEND}
30 sys-devel/bison 34 sys-devel/bison
31 !!dev-db/pgpool 35 !!dev-db/pgpool
32" 36"
33 37
34AUTOTOOLS_IN_SOURCE_BUILD="1" 38AUTOTOOLS_IN_SOURCE_BUILD="1"
35 39
36DOCS=(
37 "NEWS"
38 "doc/where_to_send_queries.pdf"
39)
40HTML_DOCS=(
41 "doc/pgpool-en.html"
42 "doc/pgpool.css"
43 "doc/tutorial-en.html"
44)
45
46S=${WORKDIR}/${MY_P} 40S=${WORKDIR}/${MY_P}
47 41
42pkg_setup() {
43 enewgroup postgres 70
44 enewuser pgpool -1 -1 -1 postgres
45
46 # We need the postgres user as well so we can set the proper
47 # permissions on the sockets without getting into fights with
48 # PostgreSQL's initialization scripts.
49 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
50}
51
48src_prepare() { 52src_prepare() {
49 sed -i \ 53 epatch "${FILESDIR}/pgpool_run_paths.patch"
50 -e 's:/tmp/:/var/run/postgresql:g' \ 54
55 local pg_config_manual="$(pg_config --includedir)/pg_config_manual.h"
56 local pgsql_socket_dir=$(grep DEFAULT_PGSOCKET_DIR "${pg_config_manual}" | \
57 sed 's|.*\"\(.*\)\"|\1|g')
58 local pgpool_socket_dir="$(dirname $pgsql_socket_dir)/pgpool"
59
60 sed "s|@PGSQL_SOCKETDIR@|${pgsql_socket_dir}|g" \
51 pgpool.conf.sample pool.h || die 61 -i *.conf.sample* pool.h || die
52 sed -i \ 62
53 -e '/ACLOCAL_AMFLAGS/ d' \ 63 sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \
54 Makefile.am || die 64 -i *.conf.sample* pool.h || die
55 base_src_prepare
56 eautoreconf
57} 65}
58 66
59src_configure() { 67src_configure() {
68 local myconf
69 use memcached && \
70 myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
71 use pam && myconf+=' --with-pam'
72
60 econf \ 73 econf \
61 --sysconfdir="${EROOT}/etc/${PN}" \
62 --disable-rpath \ 74 --disable-rpath \
75 --sysconfdir="${EROOT%/}/etc/${PN}" \
76 $(use_with ssl openssl) \
63 $(use_enable static-libs static) \ 77 $(use_enable static-libs static) \
64 $(use_with ssl openssl) \ 78 ${myconf}
65 $(use_with pam) 79}
80
81src_compile() {
82 emake
83
84 cd sql
85 emake
66} 86}
67 87
68src_install() { 88src_install() {
69 base_src_install 89 emake DESTDIR="${D}" install
70 find "${ED}" -name '*.la' -exec rm -f {} + 90
71 # move misc data to proper folder 91 cd sql
72 mv "${ED}/usr/share/${PN/2/-II}" "${ED}/usr/share/${PN}" || die 92 emake DESTDIR="${D}" install
93 cd "${S}"
94
95 # `contrib' moved to `extension' with PostgreSQL 9.1
96 local pgslot=$(postgresql-config show)
97 if [[ ${pgslot//.} > 90 ]] ; then
98 cd "${ED%/}$(pg_config --sharedir)"
99 mv contrib extension || die
100 cd "${S}"
101 fi
73 102
74 newinitd "${FILESDIR}/${PN}.initd" ${PN} 103 newinitd "${FILESDIR}/${PN}.initd" ${PN}
104 newconfd "${FILESDIR}/${PN}.confd" ${PN}
105
106 # Documentation
107 dodoc NEWS TODO doc/where_to_send_queries.{pdf,odg}
108 dohtml -r doc
109
110 # Examples and extras
111 insinto "/usr/share/${PN}"
112 doins doc/{pgpool_remote_start,basebackup.sh,recovery.conf.sample}
113 mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
114
115 # One more thing: Evil la files!
116 find "${ED}" -name '*.la' -exec rm -f {} +
75} 117}

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20