diff options
author | Chong.Lu@windriver.com <Chong.Lu@windriver.com> | 2014-04-22 15:07:25 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-05-03 20:45:02 +0200 |
commit | ee8a6c23712aa5f267b881e62f1cda3812f56bde (patch) | |
tree | bbed943265a973a8bab9f80cec2fa774d9d3a74c /meta-oe/recipes-support/postgresql/postgresql.inc | |
parent | 846ab65cfed72c1cdba465e51ed40d3a9fb6b690 (diff) | |
download | meta-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.inc | 63 |
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 @@ | |||
1 | DESCRIPTION = "PostgreSQL is a powerful, open source relational database system." | 1 | SUMMARY = "PostgreSQL is a powerful, open source relational database system." |
2 | DESCRIPTION = "\ | ||
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 | " | ||
2 | HOMEPAGE = "http://www.postgresql.com" | 20 | HOMEPAGE = "http://www.postgresql.com" |
3 | LICENSE = "BSD" | 21 | LICENSE = "BSD" |
4 | DEPENDS = "zlib readline tzcode-native" | 22 | DEPENDS = "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 | ||
11 | SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2" | 29 | SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \ |
30 | file://postgresql.init \ | ||
31 | file://postgresql-bashprofile \ | ||
32 | " | ||
12 | 33 | ||
13 | LEAD_SONAME = "libpq.so" | 34 | LEAD_SONAME = "libpq.so" |
14 | 35 | ||
15 | # LDFLAGS for shared libraries | 36 | # LDFLAGS for shared libraries |
16 | export LDFLAGS_SL = "${LDFLAGS}" | 37 | export LDFLAGS_SL = "${LDFLAGS}" |
17 | 38 | ||
18 | inherit autotools pkgconfig | 39 | inherit autotools pkgconfig useradd |
19 | 40 | ||
20 | EXTRA_OECONF = "--disable-rpath" | 41 | EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ |
21 | EXTRA_OECONF_sh4 = "--disable-spinlocks --disable-rpath" | 42 | --datadir=${datadir}/${BPN} \ |
43 | --sysconfdir=${sysconfdir}/${BPN} \ | ||
44 | --without-krb5 \ | ||
45 | " | ||
46 | EXTRA_OECONF_sh4 += "--disable-spinlocks" | ||
22 | EXTRA_OECONF_aarch64 += "--disable-spinlocks" | 47 | EXTRA_OECONF_aarch64 += "--disable-spinlocks" |
23 | 48 | ||
24 | do_compile_append() { | 49 | do_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 | ||
54 | usernum = "28" | ||
55 | groupnum = "28" | ||
56 | USERADD_PACKAGES = "${PN}" | ||
57 | USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \ | ||
58 | -s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres" | ||
59 | GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres" | ||
60 | |||
61 | INITSCRIPT_PACKAGES = "${PN}" | ||
62 | INITSCRIPT_NAME = "${BPN}-server" | ||
63 | INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ." | ||
64 | |||
65 | do_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 | |||
28 | SSTATE_SCAN_FILES += "Makefile.global" | 81 | SSTATE_SCAN_FILES += "Makefile.global" |
29 | 82 | ||
30 | PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ | 83 | PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ |