2 DESCRIPTION = "Barbican is a ReST API designed for the secure storage, provisioning and management of secrets."
3 HOMEPAGE = "https://wiki.openstack.org/wiki/Barbican"
4 SECTION = "devel/python"
6 LIC_FILES_CHKSUM = "file://LICENSE;md5=fc8be9e7dffe97390d1216b01fd0be01"
10 BARBICAN_MAX_PACKET_SIZE ?= "65535"
13 git://github.com/openstack/barbican.git;branch=${BRANCH} \
14 file://${BPN}/barbican-fix-path-to-find-configuration-files.patch \
15 file://${BPN}/openstack-barbican-api.service \
16 file://${BPN}/openstack-barbican-worker.service \
17 file://${BPN}/openstack-barbican-keystone-listener.service \
18 file://${BPN}/gunicorn-config.py \
21 SRCREV = "4c0ddda941289fba8e5ec4341b5d02d155d46162"
22 BRANCH = "stable/stein"
23 PV = "8.0.0+git${SRCPV}"
26 inherit update-rc.d setuptools identity hosts useradd default_configs monitor systemd
28 SYSTEMD_SERVICE_${SRCNAME} = " \
29 openstack-barbican-api.service \
30 openstack-barbican-worker.service \
31 openstack-barbican-keystone-listener.service \
34 SYSTEMD_AUTO_ENABLE_${SRCNAME} = "disable"
36 SERVICECREATE_PACKAGES = "${SRCNAME}-setup"
37 KEYSTONE_HOST="${CONTROLLER_IP}"
39 # USERCREATE_PARAM and SERVICECREATE_PARAM contain the list of parameters to be set.
40 # If the flag for a parameter in the list is not set here, the default value will be given to that parameter.
41 # Parameters not in the list will be set to empty.
43 USERCREATE_PARAM_${SRCNAME}-setup = "name pass tenant role email"
44 SERVICECREATE_PARAM_${SRCNAME}-setup = "name type description region publicurl adminurl internalurl"
46 flags = {'type':'keystore',\
47 'description':'Barbican Key Management Service',\
48 'publicurl':"'http://${KEYSTONE_HOST}:9311/v1'",\
49 'adminurl':"'http://${KEYSTONE_HOST}:9312/v1'",\
50 'internalurl':"'http://${KEYSTONE_HOST}:9313/v1'"}
51 d.setVarFlags("SERVICECREATE_PARAM_%s-setup" % d.getVar('SRCNAME',True), flags)
53 SERVICECREATE_PACKAGES[vardeps] += "KEYSTONE_HOST"
56 TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
57 BARBICAN_CONF_DIR=${D}${sysconfdir}/${SRCNAME}
59 install -d ${BARBICAN_CONF_DIR}
60 cp -r ${TEMPLATE_CONF_DIR}/* ${BARBICAN_CONF_DIR}
62 install -d ${D}${localstatedir}/lib/barbican
64 # Install the systemd service files
65 install -d ${D}${systemd_system_unitdir}/
66 install -m 644 ${WORKDIR}/${BPN}/*.service ${D}${systemd_system_unitdir}
68 # python-gunicorn and gunicorn-config.py are required by openstack-barbican-api.service
69 install -m 644 ${WORKDIR}/${PN}/gunicorn-config.py ${BARBICAN_CONF_DIR}
71 # Modify barbican-api-paste.ini for gunicorn
72 echo '[server:main]' >> ${BARBICAN_CONF_DIR}/barbican-api-paste.ini
73 echo 'use = egg:gunicorn#main' >> ${BARBICAN_CONF_DIR}/barbican-api-paste.ini
75 sed -e "s:%BARBICAN_CONF_DIR%:${sysconfdir}/${SRCNAME}:g" \
76 -i ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/tests/api/test_resources_policy.py
78 install -m 0755 -d ${D}/${sysconfdir}/tmpfiles.d
79 echo "d ${localstatedir}/log/barbican 0750 barbican barbican -" >> ${D}/${sysconfdir}/tmpfiles.d/barbican.conf
82 USERADD_PACKAGES = "${PN}"
83 GROUPADD_PARAM_${PN} = "--system barbican"
84 USERADD_PARAM_${PN} = "--system --home /var/lib/barbican -g barbican \
85 --no-create-home --shell /bin/false barbican"
87 PACKAGES += "${SRCNAME} \
90 FILES_${PN} = "${libdir}/* \
92 FILES_${SRCNAME} = "${sysconfdir}/${SRCNAME}/* \
93 ${sysconfdir}/init.d/barbican-api \
97 ${systemd_system_unitdir} \
100 ALLOW_EMPTY_${SRCNAME}-setup = "1"
101 pkg_postinst_${SRCNAME}-setup () {
103 chown -R barbican:barbican ${sysconfdir}/${SRCNAME}
104 chown -R barbican:barbican ${localstatedir}/lib/barbican
113 RDEPENDS_${SRCNAME} = "${PN} \
117 python-oslo.messaging"
119 RDEPENDS_${PN} += " \
133 python-keystoneclient \
138 python-barbicanclient \
144 INITSCRIPT_PACKAGES = "${SRCNAME}"
145 INITSCRIPT_NAME_${SRCNAME} = "barbican-api"
146 INITSCRIPT_PARAMS_${SRCNAME} = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
148 MONITOR_SERVICE_PACKAGES = "${SRCNAME}"
149 MONITOR_SERVICE_${SRCNAME} = "barbican"
152 FILES_${PN}_append = " \
154 ${sysconfdir}/tmpfiles.d/barbican.conf \