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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Fri May 10 08:21:43 2013 UTC (7 years, 3 months ago) by patrick
Branch: MAIN
Changes since 1.6: +3 -3 lines
Fix inherit

(Portage version: 2.2.0_alpha174/cvs/Linux x86_64, unsigned Manifest commit)

1 patrick 1.7 # Copyright 1999-2013 Gentoo Foundation
2 scarabeus 1.1 # Distributed under the terms of the GNU General Public License v2
3 patrick 1.7 # $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-9999.ebuild,v 1.6 2013/04/02 01:51:48 titanofold Exp $
4 scarabeus 1.1
5     EAPI=4
6    
7 scarabeus 1.3 [[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}"
8    
9 scarabeus 1.1 ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool"
10     ECVS_MODULE="pgpool-II"
11 scarabeus 1.3 [[ ${PV} == 9999 ]] && SCM_ECLASS="cvs"
12 patrick 1.7 inherit base user ${SCM_ECLASS}
13 scarabeus 1.3 unset SCM_ECLASS
14 scarabeus 1.1
15     DESCRIPTION="Connection pool server for PostgreSQL"
16 titanofold 1.5 HOMEPAGE="http://www.pgpool.net/"
17     [[ ${PV} == 9999 ]] || SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
18 scarabeus 1.1 LICENSE="BSD"
19     SLOT="0"
20 titanofold 1.5
21     # Don't move KEYWORDS on the previous line or ekeyword won't work # 399061
22     [[ ${PV} == 9999 ]] || \
23     KEYWORDS="~amd64 ~x86"
24    
25     IUSE="memcached pam ssl static-libs"
26 scarabeus 1.1
27     RDEPEND="
28     dev-db/postgresql-base
29 titanofold 1.5 memcached? ( dev-libs/libmemcached )
30 scarabeus 1.1 pam? ( sys-auth/pambase )
31     ssl? ( dev-libs/openssl )
32     "
33 titanofold 1.5 DEPEND="${RDEPEND}
34 titanofold 1.2 sys-devel/bison
35     !!dev-db/pgpool
36     "
37 scarabeus 1.1
38     AUTOTOOLS_IN_SOURCE_BUILD="1"
39    
40 titanofold 1.5 S=${WORKDIR}/${MY_P}
41 scarabeus 1.1
42 titanofold 1.5 pkg_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 scarabeus 1.1
52     src_prepare() {
53 titanofold 1.5 epatch "${FILESDIR}/pgpool_run_paths.patch"
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" \
61     -i *.conf.sample* pool.h || die
62    
63     sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \
64     -i *.conf.sample* pool.h || die
65 scarabeus 1.1 }
66    
67     src_configure() {
68 titanofold 1.5 local myconf
69     use memcached && \
70     myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\""
71     use pam && myconf+=' --with-pam'
72    
73 scarabeus 1.3 econf \
74     --disable-rpath \
75 titanofold 1.5 --sysconfdir="${EROOT%/}/etc/${PN}" \
76     $(use_with ssl openssl) \
77 scarabeus 1.3 $(use_enable static-libs static) \
78 titanofold 1.5 ${myconf}
79     }
80    
81     src_compile() {
82     emake
83    
84     cd sql
85     emake
86 scarabeus 1.1 }
87    
88     src_install() {
89 titanofold 1.5 emake DESTDIR="${D}" install
90    
91     cd sql
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
102 scarabeus 1.1
103     newinitd "${FILESDIR}/${PN}.initd" ${PN}
104 titanofold 1.5 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 {} +
117 scarabeus 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20