X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-integ%2Frecipes-devtools%2Fpython%2Fpython-barbican_git.bb;fp=meta-starlingx%2Fmeta-stx-integ%2Frecipes-devtools%2Fpython%2Fpython-barbican_git.bb;h=b96d2c870384059f2810edf2d7f0a4e472818228;hb=e0634c6eaf2fe2641a0fb90e84a5defb880b1335;hp=0000000000000000000000000000000000000000;hpb=210d0f78485e760dffcdd3f630f59cec797f3f11;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-integ/recipes-devtools/python/python-barbican_git.bb b/meta-starlingx/meta-stx-integ/recipes-devtools/python/python-barbican_git.bb new file mode 100644 index 0000000..b96d2c8 --- /dev/null +++ b/meta-starlingx/meta-stx-integ/recipes-devtools/python/python-barbican_git.bb @@ -0,0 +1,155 @@ + +DESCRIPTION = "Barbican is a ReST API designed for the secure storage, provisioning and management of secrets." +HOMEPAGE = "https://wiki.openstack.org/wiki/Barbican" +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fc8be9e7dffe97390d1216b01fd0be01" + +PR = "r0" +SRCNAME = "barbican" +BARBICAN_MAX_PACKET_SIZE ?= "65535" + +SRC_URI = " \ + git://github.com/openstack/barbican.git;branch=${BRANCH} \ + file://${BPN}/barbican-fix-path-to-find-configuration-files.patch \ + file://${BPN}/openstack-barbican-api.service \ + file://${BPN}/openstack-barbican-worker.service \ + file://${BPN}/openstack-barbican-keystone-listener.service \ + file://${BPN}/gunicorn-config.py \ + " + +SRCREV = "4c0ddda941289fba8e5ec4341b5d02d155d46162" +BRANCH = "stable/stein" +PV = "8.0.0+git${SRCPV}" +S = "${WORKDIR}/git" + +inherit update-rc.d setuptools identity hosts useradd default_configs monitor systemd + +SYSTEMD_SERVICE_${SRCNAME} = " \ + openstack-barbican-api.service \ + openstack-barbican-worker.service \ + openstack-barbican-keystone-listener.service \ + " + +SYSTEMD_AUTO_ENABLE_${SRCNAME} = "disable" + +SERVICECREATE_PACKAGES = "${SRCNAME}-setup" +KEYSTONE_HOST="${CONTROLLER_IP}" + +# USERCREATE_PARAM and SERVICECREATE_PARAM contain the list of parameters to be set. +# If the flag for a parameter in the list is not set here, the default value will be given to that parameter. +# Parameters not in the list will be set to empty. + +USERCREATE_PARAM_${SRCNAME}-setup = "name pass tenant role email" +SERVICECREATE_PARAM_${SRCNAME}-setup = "name type description region publicurl adminurl internalurl" +python () { + flags = {'type':'keystore',\ + 'description':'Barbican Key Management Service',\ + 'publicurl':"'http://${KEYSTONE_HOST}:9311/v1'",\ + 'adminurl':"'http://${KEYSTONE_HOST}:9312/v1'",\ + 'internalurl':"'http://${KEYSTONE_HOST}:9313/v1'"} + d.setVarFlags("SERVICECREATE_PARAM_%s-setup" % d.getVar('SRCNAME',True), flags) +} +SERVICECREATE_PACKAGES[vardeps] += "KEYSTONE_HOST" + +do_install_append() { + TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} + BARBICAN_CONF_DIR=${D}${sysconfdir}/${SRCNAME} + + install -d ${BARBICAN_CONF_DIR} + cp -r ${TEMPLATE_CONF_DIR}/* ${BARBICAN_CONF_DIR} + + install -d ${D}${localstatedir}/lib/barbican + + # Install the systemd service files + install -d ${D}${systemd_system_unitdir}/ + install -m 644 ${WORKDIR}/${BPN}/*.service ${D}${systemd_system_unitdir} + + # python-gunicorn and gunicorn-config.py are required by openstack-barbican-api.service + install -m 644 ${WORKDIR}/${PN}/gunicorn-config.py ${BARBICAN_CONF_DIR} + + # Modify barbican-api-paste.ini for gunicorn + echo '[server:main]' >> ${BARBICAN_CONF_DIR}/barbican-api-paste.ini + echo 'use = egg:gunicorn#main' >> ${BARBICAN_CONF_DIR}/barbican-api-paste.ini + + sed -e "s:%BARBICAN_CONF_DIR%:${sysconfdir}/${SRCNAME}:g" \ + -i ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/tests/api/test_resources_policy.py + + install -m 0755 -d ${D}/${sysconfdir}/tmpfiles.d + echo "d ${localstatedir}/log/barbican 0750 barbican barbican -" >> ${D}/${sysconfdir}/tmpfiles.d/barbican.conf +} + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system barbican" +USERADD_PARAM_${PN} = "--system --home /var/lib/barbican -g barbican \ + --no-create-home --shell /bin/false barbican" + +PACKAGES += "${SRCNAME} \ + ${SRCNAME}-setup " + +FILES_${PN} = "${libdir}/* \ +" +FILES_${SRCNAME} = "${sysconfdir}/${SRCNAME}/* \ + ${sysconfdir}/init.d/barbican-api \ + ${bindir} \ + ${bindir}/* \ + ${localstatedir}/* \ + ${systemd_system_unitdir} \ +" + +ALLOW_EMPTY_${SRCNAME}-setup = "1" +pkg_postinst_${SRCNAME}-setup () { + if [ -z "$D" ]; then + chown -R barbican:barbican ${sysconfdir}/${SRCNAME} + chown -R barbican:barbican ${localstatedir}/lib/barbican + fi +} + +DEPENDS += " \ + python-pip \ + python-pbr-native \ + " + +RDEPENDS_${SRCNAME} = "${PN} \ + ${SRCNAME}-setup \ + uwsgi \ + python-falcon \ + python-oslo.messaging" + +RDEPENDS_${PN} += " \ + python-pip \ + python-pbr \ + python-alembic \ + python-babel \ + python-eventlet \ + python-falcon \ + python-iso8601 \ + python-jsonschema \ + python-kombu \ + python-netaddr \ + python-pastedeploy \ + python-paste \ + python-pycrypto \ + python-keystoneclient \ + python-sqlalchemy \ + python-stevedore \ + python-webob \ + python-wsgiref \ + python-barbicanclient \ + python-gunicorn \ + python-castellan \ + python-ldap3 \ + " + +INITSCRIPT_PACKAGES = "${SRCNAME}" +INITSCRIPT_NAME_${SRCNAME} = "barbican-api" +INITSCRIPT_PARAMS_${SRCNAME} = "${OS_DEFAULT_INITSCRIPT_PARAMS}" + +MONITOR_SERVICE_PACKAGES = "${SRCNAME}" +MONITOR_SERVICE_${SRCNAME} = "barbican" + + +FILES_${PN}_append = " \ + ${datadir}/ \ + ${sysconfdir}/tmpfiles.d/barbican.conf \ + "