2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
18 LICENSE = "Apache-2.0"
19 LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
23 file://barbican.conf \
24 file://gunicorn-config.py \
25 file://barbican-api-paste.ini \
26 file://openstack-barbican-api.service \
41 install -m 0755 -d ${D}/${datadir}/starlingx/barbican/
42 install -m 0755 -d ${D}/${datadir}/starlingx/barbican/backup/
43 install -m 0755 -d ${D}/${systemd_system_unitdir}/
44 install -m 0644 ${WORKDIR}/barbican.conf ${D}/${datadir}/starlingx/barbican
45 install -m 0644 ${WORKDIR}/barbican-api-paste.ini ${D}/${datadir}/starlingx/barbican
46 install -m 0644 ${WORKDIR}/gunicorn-config.py ${D}/${datadir}/starlingx/barbican
47 install -m 0644 ${WORKDIR}/openstack-barbican-api.service ${D}/${systemd_system_unitdir}/openstack-barbican-api.service
50 pkg_postinst_ontarget_${PN}() {
52 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.$(date +%s).tar.gz ./etc/barbican
54 if [ ! -f /usr/share/starlingx/barbican/backup/barbican.default.tar.gz ]; then
55 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz ./etc/barbican
60 # Restore to default settings
61 tar -C / -xzpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz
63 cp /usr/share/starlingx/barbican/barbican-api-paste.ini /etc/barbican/
64 cp /usr/share/starlingx/barbican/barbican.conf /etc/barbican/
65 cp /usr/share/starlingx/barbican/gunicorn-config.py /etc/barbican/
66 systemctl daemon-reload
69 pkg_prerm_ontarget_${PN}() {
70 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.$(date +%s).tar.gz ./etc/barbican
73 # Restore to default settings
74 tar -C / -xzpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz
78 ${datadir}/starlingx/barbican/ \
79 ${systemd_system_unitdir}/openstack-barbican-api.service \