summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/postgresql/postgresql.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/postgresql/postgresql.inc')
-rw-r--r--meta-oe/recipes-support/postgresql/postgresql.inc22
1 files changed, 21 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/postgresql/postgresql.inc b/meta-oe/recipes-support/postgresql/postgresql.inc
index 774c8fd0c9..d45f4b5edf 100644
--- a/meta-oe/recipes-support/postgresql/postgresql.inc
+++ b/meta-oe/recipes-support/postgresql/postgresql.inc
@@ -30,6 +30,7 @@ SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \
30 file://postgresql.pam \ 30 file://postgresql.pam \
31 file://0001-Use-pkg-config-for-libxml2-detection.patch \ 31 file://0001-Use-pkg-config-for-libxml2-detection.patch \
32 file://postgresql-setup \ 32 file://postgresql-setup \
33 file://postgresql.service \
33" 34"
34 35
35LEAD_SONAME = "libpq.so" 36LEAD_SONAME = "libpq.so"
@@ -37,7 +38,20 @@ LEAD_SONAME = "libpq.so"
37# LDFLAGS for shared libraries 38# LDFLAGS for shared libraries
38export LDFLAGS_SL = "${LDFLAGS}" 39export LDFLAGS_SL = "${LDFLAGS}"
39 40
40inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d 41inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
42
43SYSTEMD_SERVICE_${PN} = "postgresql.service"
44SYSTEMD_AUTO_ENABLE_${PN} = "disable"
45
46DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}"
47pkg_postinst_${PN} () {
48 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then
49 if [ -n "$D" ]; then
50 OPTS="--root=$D"
51 fi
52 systemctl $OPTS mask postgresql-server.service
53 fi
54}
41 55
42enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" 56enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
43PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" 57PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl"
@@ -184,6 +198,12 @@ do_install_append() {
184 install -d ${D}${sysconfdir}/pam.d 198 install -d ${D}${sysconfdir}/pam.d
185 install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql 199 install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql
186 fi 200 fi
201
202 # Install systemd unit files
203 install -d ${D}${systemd_unitdir}/system
204 install -m 0644 ${WORKDIR}/postgresql.service ${D}${systemd_unitdir}/system
205 sed -i -e 's,@BINDIR@,${bindir},g' \
206 ${D}${systemd_unitdir}/system/postgresql.service
187} 207}
188 208
189SSTATE_SCAN_FILES += "Makefile.global" 209SSTATE_SCAN_FILES += "Makefile.global"