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>
This commit is contained in:
Chong.Lu@windriver.com
2014-04-22 15:07:25 +08:00
committed by Martin Jansa
parent 846ab65cfe
commit ee8a6c2371
3 changed files with 303 additions and 5 deletions
@@ -1,4 +1,22 @@
DESCRIPTION = "PostgreSQL is a powerful, open source relational database system."
SUMMARY = "PostgreSQL is a powerful, open source relational database system."
DESCRIPTION = "\
PostgreSQL is an advanced Object-Relational database management system \
(DBMS) that supports almost all SQL constructs (including \
transactions, subselects and user-defined types and functions). The \
postgresql package includes the client programs and libraries that \
you'll need to access a PostgreSQL DBMS server. These PostgreSQL \
client programs are programs that directly manipulate the internal \
structure of PostgreSQL databases on a PostgreSQL server. These client \
programs can be located on the same machine with the PostgreSQL \
server, or may be on a remote machine which accesses a PostgreSQL \
server over a network connection. This package contains the docs \
in HTML for the whole package, as well as command-line utilities for \
managing PostgreSQL databases on a PostgreSQL server. \
\
If you want to manipulate a PostgreSQL database on a local or remote \
PostgreSQL server, you need this package. You also need to install \
this package if you're installing the postgresql-server package. \
"
HOMEPAGE = "http://www.postgresql.com"
LICENSE = "BSD"
DEPENDS = "zlib readline tzcode-native"
@@ -8,23 +26,58 @@ ARM_INSTRUCTION_SET = "arm"
#WARNING: this recipe assumes you have the timezone compiler present in /usr/sbin/zic
SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2"
SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \
file://postgresql.init \
file://postgresql-bashprofile \
"
LEAD_SONAME = "libpq.so"
# LDFLAGS for shared libraries
export LDFLAGS_SL = "${LDFLAGS}"
inherit autotools pkgconfig
inherit autotools pkgconfig useradd
EXTRA_OECONF = "--disable-rpath"
EXTRA_OECONF_sh4 = "--disable-spinlocks --disable-rpath"
EXTRA_OECONF += "--enable-thread-safety --disable-rpath \
--datadir=${datadir}/${BPN} \
--sysconfdir=${sysconfdir}/${BPN} \
--without-krb5 \
"
EXTRA_OECONF_sh4 += "--disable-spinlocks"
EXTRA_OECONF_aarch64 += "--disable-spinlocks"
do_compile_append() {
cp /usr/sbin/zic ${S}/src/timezone/
}
# server needs to configure user and group
usernum = "28"
groupnum = "28"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \
-s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres"
GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "${BPN}-server"
INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
do_install_append() {
# install dirs and server init
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/${BPN}.init \
${D}${sysconfdir}/init.d/${BPN}-server
sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" \
${D}${sysconfdir}/init.d/${BPN}-server
install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data
install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups
install -m 644 ${WORKDIR}/${BPN}-bashprofile \
${D}${localstatedir}/lib/${BPN}/.bash_profile
chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN}
# multiple server config directory
install -d -m 700 ${D}${sysconfdir}/default/${BPN}
}
SSTATE_SCAN_FILES += "Makefile.global"
PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \