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 0755 -d ${D}/var/log/barbican/
45 install -m 0644 ${WORKDIR}/barbican.conf ${D}/${datadir}/starlingx/barbican
46 install -m 0644 ${WORKDIR}/barbican-api-paste.ini ${D}/${datadir}/starlingx/barbican
47 install -m 0644 ${WORKDIR}/gunicorn-config.py ${D}/${datadir}/starlingx/barbican
48 install -m 0644 ${WORKDIR}/openstack-barbican-api.service ${D}/${systemd_system_unitdir}/openstack-barbican-api.service
51 pkg_postinst_ontarget_${PN}() {
53 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.$(date +%s).tar.gz ./etc/barbican
55 if [ ! -f /usr/share/starlingx/barbican/backup/barbican.default.tar.gz ]; then
56 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz ./etc/barbican
61 # Restore to default settings
62 tar -C / -xzpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz
64 cp /usr/share/starlingx/barbican/barbican-api-paste.ini /etc/barbican/
65 cp /usr/share/starlingx/barbican/barbican.conf /etc/barbican/
66 cp /usr/share/starlingx/barbican/gunicorn-config.py /etc/barbican/
67 systemctl daemon-reload
70 pkg_prerm_ontarget_${PN}() {
71 tar -C / -czpf /usr/share/starlingx/barbican/backup/barbican.$(date +%s).tar.gz ./etc/barbican
74 # Restore to default settings
75 tar -C / -xzpf /usr/share/starlingx/barbican/backup/barbican.default.tar.gz
79 ${datadir}/starlingx/barbican/ \
80 ${systemd_system_unitdir}/openstack-barbican-api.service \