Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-metal / inventory.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
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
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15
16 PACKAGES += " inventory"
17
18 #DEPENDS = " \
19 #       python \
20 #       python-pbr-native \
21 #       "
22
23 #python-futurist >= 0.11.0
24 #python-keystoneauth1 >= 3.1.0
25 #python-keystonemiddleware >= 4.12.0
26 #python-neutronclient >= 6.3.0
27 #python-oslo-concurrency >= 3.8.0
28 #python-oslo-config >= 2:4.0.0
29 #python-oslo-context >= 2.14.0
30 #python-oslo-db >= 4.24.0
31 #python-oslo-i18n >= 2.1.0
32 #python-oslo-log >= 3.22.0
33 #python-oslo-messaging >= 5.24.2
34 #python-oslo-middleware >= 3.27.0
35 #python-oslo-policy >= 1.23.0
36 #python-oslo-rootwrap >= 5.0.0
37 #python-oslo-serialization >= 1.10.0
38 #python-oslo-service >= 1.10.0
39 #python-oslo-utils >= 3.20.0
40 #python-oslo-versionedobjects >= 1.17.0
41 #python-osprofiler >= 1.4.0
42 #python-stevedore >= 1.20.0
43 #python-webob >= 1.7.1
44
45 RDEPENDS_inventory += " \
46                 bash \
47                 python-anyjson \
48                 python-amqplib \
49                 python-pyudev \
50                 python-pyparted \
51                 python-ipaddr \
52                 python-paste \
53                 python-eventlet \
54                 python-futurist \
55                 python-jsonpatch \
56                 python-keystoneauth1 \
57                 python-keystonemiddleware \
58                 python-neutronclient \
59                 python-oslo.concurrency \
60                 python-oslo.config \
61                 python-oslo.context \
62                 python-oslo.db \
63                 python-oslo.i18n \
64                 python-oslo.log \
65                 python-oslo.messaging \
66                 python-oslo.middleware \
67                 python-oslo.policy \
68                 python-oslo.rootwrap \
69                 python-oslo.serialization \
70                 python-oslo.service \
71                 python-oslo.utils \
72                 python-oslo.versionedobjects \
73                 python-osprofiler \
74                 python-pbr \
75                 python-pecan \
76                 python-psutil \
77                 python-requests \
78                 python-retrying \
79                 python-six \
80                 python-sqlalchemy \
81                 python-stevedore \
82                 python-webob \
83                 python-wsme \
84                 "
85
86
87
88 do_configure_prepend () {
89         cd ${S}/inventory/inventory
90         distutils_do_configure
91
92
93 do_compile_prepend () {
94         cd ${S}/inventory/inventory
95         distutils_do_compile
96 }
97
98 do_install_prepend () {
99         cd ${S}/inventory/inventory
100         distutils_do_install
101         
102         install -d -m 755 ${D}/${sysconfdir}/goenabled.d
103         install -p -D -m 755 etc/inventory/inventory_goenabled_check.sh ${D}/${sysconfdir}/goenabled.d/inventory_goenabled_check.sh
104
105         install -d -m 755 ${D}/${sysconfdir}/inventory
106         install -p -D -m 755 etc/inventory/policy.json ${D}/${sysconfdir}/inventory/policy.json
107
108         install -d -m 755 ${D}/${sysconfdir}/motd.d
109         install -p -D -m 755 etc/inventory/motd-system ${D}/${sysconfdir}/motd.d/10-system-config
110
111         install -m 755 -p -D scripts/inventory-api ${D}/${libdir}/ocf/resource.d/platform/inventory-api
112         install -m 755 -p -D scripts/inventory-conductor ${D}/${libdir}/ocf/resource.d/platform/inventory-conductor
113
114         install -d -m 0755 ${D}/${systemd_system_unitdir}/
115         install -m 644 -p -D scripts/inventory-api.service ${D}/${systemd_system_unitdir}/
116         install -m 644 -p -D scripts/inventory-conductor.service ${D}/${systemd_system_unitdir}/
117
118         # Install sql migration
119         # install -m 644 inventory/db/sqlalchemy/migrate_repo/migrate.cfg ${D}/${libdir}/inventory/db/sqlalchemy/migrate_repo/migrate.cfg
120
121 }
122
123 #pkg_postinst_ontarget-inventory () {
124 # install default config files
125 #cd ${_builddir}/${name}-${version} && oslo-config-generator --config-file inventory/config-generator.conf --output-file ${_builddir}/${name}-${version}/inventory.conf.sample
126 #}
127
128 FILES_inventory = " \
129         ${systemd_system_unitdir}/inventory-api.service \
130         ${systemd_system_unitdir}/inventory-conductor.service \
131         ${bindir}/inventory-api \
132         ${bindir}/inventory-conductor \
133         ${bindir}/inventory-dnsmasq-lease-update \
134         ${bindir}/inventory-agent \
135         ${bindir}/inventory-dbsync \
136         ${libdir}/ocf/resource.d/platform/inventory-api \
137         ${libdir}/ocf/resource.d/platform/inventory-conductor \
138         ${libdir}/python2.7/site-packages/inventory*.egg-info/ \
139         ${libdir}/python2.7/site-packages/inventory/ \
140         ${sysconfdir}/goenabled.d/inventory_goenabled_check.sh \
141         ${sysconfdir}/motd.d/10-system-config \
142         ${sysconfdir}/inventory/policy.json \
143         "