summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/postgresql/postgresql.inc
diff options
context:
space:
mode:
authorChong.Lu@windriver.com <Chong.Lu@windriver.com>2014-04-22 15:07:25 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-05-03 20:45:02 +0200
commitee8a6c23712aa5f267b881e62f1cda3812f56bde (patch)
treebbed943265a973a8bab9f80cec2fa774d9d3a74c /meta-oe/recipes-support/postgresql/postgresql.inc
parent846ab65cfed72c1cdba465e51ed40d3a9fb6b690 (diff)
downloadmeta-openembedded-ee8a6c23712aa5f267b881e62f1cda3812f56bde.tar.gz
postgresql: add init script and DESCRIPTION
1. Add DESCRIPTION 2. Add init script for starting up the PostgreSQL server. 3. Disable krb5 by default Signed-off-by: Chong Lu <Chong.Lu@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/postgresql/postgresql.inc')
-rw-r--r--meta-oe/recipes-support/postgresql/postgresql.inc63
1 files changed, 58 insertions, 5 deletions
diff --git a/meta-oe/recipes-support/postgresql/postgresql.inc b/meta-oe/recipes-support/postgresql/postgresql.inc
index 5f2088e99..db425e765 100644
--- a/meta-oe/recipes-support/postgresql/postgresql.inc
+++ b/meta-oe/recipes-support/postgresql/postgresql.inc
@@ -1,4 +1,22 @@
1DESCRIPTION = "PostgreSQL is a powerful, open source relational database system." 1SUMMARY = "PostgreSQL is a powerful, open source relational database system."
2DESCRIPTION = "\
3 PostgreSQL is an advanced Object-Relational database management system \
4 (DBMS) that supports almost all SQL constructs (including \
5 transactions, subselects and user-defined types and functions). The \
6 postgresql package includes the client programs and libraries that \
7 you'll need to access a PostgreSQL DBMS server. These PostgreSQL \
8 client programs are programs that directly manipulate the internal \
9 structure of PostgreSQL databases on a PostgreSQL server. These client \
10 programs can be located on the same machine with the PostgreSQL \
11 server, or may be on a remote machine which accesses a PostgreSQL \
12 server over a network connection. This package contains the docs \
13 in HTML for the whole package, as well as command-line utilities for \
14 managing PostgreSQL databases on a PostgreSQL server. \
15 \
16 If you want to manipulate a PostgreSQL database on a local or remote \
17 PostgreSQL server, you need this package. You also need to install \
18 this package if you're installing the postgresql-server package. \
19 "
2HOMEPAGE = "http://www.postgresql.com" 20HOMEPAGE = "http://www.postgresql.com"
3LICENSE = "BSD" 21LICENSE = "BSD"
4DEPENDS = "zlib readline tzcode-native" 22DEPENDS = "zlib readline tzcode-native"
@@ -8,23 +26,58 @@ ARM_INSTRUCTION_SET = "arm"
8 26
9#WARNING: this recipe assumes you have the timezone compiler present in /usr/sbin/zic 27#WARNING: this recipe assumes you have the timezone compiler present in /usr/sbin/zic
10 28
11SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2" 29SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \
30 file://postgresql.init \
31 file://postgresql-bashprofile \
32"
12 33
13LEAD_SONAME = "libpq.so" 34LEAD_SONAME = "libpq.so"
14 35
15# LDFLAGS for shared libraries 36# LDFLAGS for shared libraries
16export LDFLAGS_SL = "${LDFLAGS}" 37export LDFLAGS_SL = "${LDFLAGS}"
17 38
18inherit autotools pkgconfig 39inherit autotools pkgconfig useradd
19 40
20EXTRA_OECONF = "--disable-rpath" 41EXTRA_OECONF += "--enable-thread-safety --disable-rpath \
21EXTRA_OECONF_sh4 = "--disable-spinlocks --disable-rpath" 42 --datadir=${datadir}/${BPN} \
43 --sysconfdir=${sysconfdir}/${BPN} \
44 --without-krb5 \
45"
46EXTRA_OECONF_sh4 += "--disable-spinlocks"
22EXTRA_OECONF_aarch64 += "--disable-spinlocks" 47EXTRA_OECONF_aarch64 += "--disable-spinlocks"
23 48
24do_compile_append() { 49do_compile_append() {
25 cp /usr/sbin/zic ${S}/src/timezone/ 50 cp /usr/sbin/zic ${S}/src/timezone/
26} 51}
27 52
53# server needs to configure user and group
54usernum = "28"
55groupnum = "28"
56USERADD_PACKAGES = "${PN}"
57USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \
58 -s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres"
59GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres"
60
61INITSCRIPT_PACKAGES = "${PN}"
62INITSCRIPT_NAME = "${BPN}-server"
63INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
64
65do_install_append() {
66 # install dirs and server init
67 install -d ${D}${sysconfdir}/init.d
68 install -m 0755 ${WORKDIR}/${BPN}.init \
69 ${D}${sysconfdir}/init.d/${BPN}-server
70 sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" \
71 ${D}${sysconfdir}/init.d/${BPN}-server
72 install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data
73 install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups
74 install -m 644 ${WORKDIR}/${BPN}-bashprofile \
75 ${D}${localstatedir}/lib/${BPN}/.bash_profile
76 chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN}
77 # multiple server config directory
78 install -d -m 700 ${D}${sysconfdir}/default/${BPN}
79}
80
28SSTATE_SCAN_FILES += "Makefile.global" 81SSTATE_SCAN_FILES += "Makefile.global"
29 82
30PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ 83PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \