diff options
author | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2015-05-05 16:14:22 +0200 |
---|---|---|
committer | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2015-05-05 16:14:22 +0200 |
commit | 772af2f85dba93675063f96e98cac4375ad19975 (patch) | |
tree | b19bf6a5ec43edd5f55a3a225a6c8d873ec3e404 | |
parent | b0be223afe3f3415648ad45da99dada7cf4c26a8 (diff) | |
download | meta-tizen-772af2f85dba93675063f96e98cac4375ad19975.tar.gz meta-tizen-772af2f85dba93675063f96e98cac4375ad19975.tar.bz2 meta-tizen-772af2f85dba93675063f96e98cac4375ad19975.zip |
Add user cynara and fix post install
Change-Id: I98ae0aff0684c04d8e4191808dc8c1e9209a29fb
Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
-rw-r--r-- | meta-tizen-common-base/recipes-security/cynara/cynara.inc | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/meta-tizen-common-base/recipes-security/cynara/cynara.inc b/meta-tizen-common-base/recipes-security/cynara/cynara.inc index cbaeac5c..45a2a780 100644 --- a/meta-tizen-common-base/recipes-security/cynara/cynara.inc +++ b/meta-tizen-common-base/recipes-security/cynara/cynara.inc @@ -8,13 +8,18 @@ SRC_URI = "" S = "${WORKDIR}/git" -inherit manifest autotools-brokensep +inherit manifest autotools-brokensep useradd systemd BBCLASSEXTEND = "" PROVIDES = "" +SYSTEMD_SERVICE_${PN} = "cynara.service" + CXXFLAGS_prepend = " -DCYNARA_STATE_PATH='\"${localstatedir}/cynara/\"' -DCYNARA_LIB_PATH='\"${prefix}/lib/cynara/\"' -DCYNARA_TESTS_DIR='\"${prefix}/share/cynara/tests/\"' -DCYNARA_CONFIGURATION_DIR='\"${sysconfdir}/cynara/\"' -DCYNARA_VERSION='\"0.6.1\"'" +USERADD_PACKAGES = "cynara" + +USERADD_PARAM_${PN} = " -u 9996 -d /var/lib/empty -s /sbin/nologin -r cynara" #PROVIDES by libcynara-creds-socket PROVIDES += "libcynara-creds-socket" @@ -225,19 +230,13 @@ do_install() { pkg_preinst_${PN}() { #!/bin/sh -e - id -g cynara > /dev/null 2>&1 - if [ $? -eq 1 ]; then - groupadd cynara -r > /dev/null 2>&1 - fi - id -u cynara > /dev/null 2>&1 - if [ $? -eq 1 ]; then - useradd -d /var/lib/empty -s /sbin/nologin -r -g cynara cynara > /dev/null 2>&1 - fi + [ "x$D" != "x" ] && exit 1 + if [ $1 -gt 1 ] ; then OLDVERSION="$(rpm -q --qf '%{version}' cynara)" - $D${prefix}/sbin/cynara/cynara-db-migration upgrade -f 0.0.0 -t ${PV} + sh $D${prefix}/sbin/cynara-db-migration upgrade -f 0.0.0 -t ${PV} else - $D${prefix}/sbin/cynara/cynara-db-migration install -t ${PV} + sh $D${prefix}/sbin/cynara-db-migration install -t ${PV} fi } @@ -251,15 +250,8 @@ pkg_postinst_libcynara-agent() { pkg_postinst_${PN}() { #!/bin/sh -e - ### Add file capabilities if needed - ### setcap/getcap binary are useful. To use them you must install libcap and libcap-tools packages - ### In such case uncomment Requires with those packages - systemctl daemon-reload - if [ $1 == 1 ]; then - systemctl enable cynara.service - fi chsmack -a System ${localstatedir}/cynara/ - systemctl restart cynara.service + } |