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-06-16 14:31:25 +0200 |
commit | ad0b7b00c5bc90a19095889b5889749b2a360920 (patch) | |
tree | bf1ad13d4163d231627d41570363f7322249914b | |
parent | 6b7d673f9b6debd961337d33533ce4e411465cea (diff) | |
download | meta-tizen-ad0b7b00c5bc90a19095889b5889749b2a360920.tar.gz meta-tizen-ad0b7b00c5bc90a19095889b5889749b2a360920.tar.bz2 meta-tizen-ad0b7b00c5bc90a19095889b5889749b2a360920.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 d507b068..7520f133 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 + } |