Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-update / cgcs-patch.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 += " cgcs-patch"
17 PACKAGES += " cgcs-patch-agent"
18 PACKAGES += " cgcs-patch-controller"
19
20 inherit setuptools
21
22 RDEPENDS_cgcs-patch_append = " \
23         bash \
24         "
25 RDEPENDS_cgcs-patch-agent_append = " \
26         bash \
27         python \
28         "
29
30 RDEPENDS_cgcs-patch-controller_append = " \
31         bash \
32         python-requests-toolbelt \
33         createrepo-c \
34         "
35
36 do_configure_append () {
37         cd ${S}/cgcs-patch/cgcs-patch
38         distutils_do_configure
39
40
41 do_compile_append () {
42         cd ${S}/cgcs-patch/cgcs-patch
43         distutils_do_compile
44 }
45
46 do_install_append () {
47         cd ${S}/cgcs-patch/cgcs-patch
48         distutils_do_install
49
50         cd ${S}/cgcs-patch/bin
51
52         install -m 755 -d ${D}/${sbindir}
53         install -m 755 -d ${D}/${sysconfdir}/bash_completion.d
54         install -m 755 -d ${D}/${sysconfdir}/goenabled.d
55         install -m 755 -d ${D}/${sysconfdir}/init.d
56         install -m 755 -d ${D}/${sysconfdir}/logrotate.d
57         install -m 755 -d ${D}/${sysconfdir}/patching
58         install -m 700 -d ${D}/${sysconfdir}/patching/patch-scripts
59         install -m 755 -d ${D}/${sysconfdir}/pmon.d
60         install -m 755 -d ${D}/${systemd_system_unitdir}
61
62         install -m 500 sw-patch-agent  ${D}/${sbindir}/sw-patch-agent
63         install -m 500 sw-patch-controller-daemon ${D}/${sbindir}/sw-patch-controller-daemon
64         install -m 555 sw-patch ${D}/${sbindir}/sw-patch
65         install -m 555 rpm-audit ${D}/${sbindir}/rpm-audit
66         
67         install -m 500 sw-patch-controller-daemon-init.sh ${D}/${sysconfdir}/init.d/sw-patch-controller-daemon
68         install -m 500 sw-patch-agent-init.sh ${D}/${sysconfdir}/init.d/sw-patch-agent
69         
70         install -m 600 patching.conf ${D}/${sysconfdir}/patching/patching.conf
71         
72         install -m 644 policy.json ${D}/${sysconfdir}/patching/policy.json 
73         
74         install -m 444 pmon-sw-patch-controller-daemon.conf ${D}/${sysconfdir}/pmon.d/sw-patch-controller-daemon.conf
75         install -m 444 pmon-sw-patch-agent.conf ${D}/${sysconfdir}/pmon.d/sw-patch-agent.conf 
76         install -m 444 *.service ${D}/${systemd_system_unitdir} 
77         install -m 444 sw-patch.completion ${D}/${sysconfdir}/bash_completion.d/sw-patch 
78         install -m 400 patch-functions ${D}/${sysconfdir}/patching/patch-functions 
79
80         install -D -m 444 patch-tmpdirs.conf ${D}/${sysconfdir}/tempfiles.d/patch-tmpdirs.conf
81
82         install -m 500 run-patch-scripts ${D}/${sbindir}/run-patch-scripts 
83         install -m 500 sw-patch-controller-daemon-restart ${D}/${sbindir}/sw-patch-controller-daemon-restart
84         install -m 500 sw-patch-agent-restart ${D}/${sbindir}/sw-patch-agent-restart
85
86
87         install -m 500 run-patch-scripts ${D}/${sbindir}/run-patch-scripts
88         install -m 500 sw-patch-controller-daemon-restart ${D}/${sbindir}/sw-patch-controller-daemon-restart
89         install -m 500 sw-patch-agent-restart ${D}/${sbindir}/sw-patch-agent-restart 
90         install -m 500 sw-patch-init.sh ${D}/${sysconfdir}/init.d/sw-patch
91         install -m 500 sw-patch-controller-init.sh ${D}/${sysconfdir}/init.d/sw-patch-controller 
92         install -m 555 patch_check_goenabled.sh ${D}/${sysconfdir}/goenabled.d/patch_check_goenabled.sh 
93         install -m 444 patching.logrotate ${D}/${sysconfdir}/logrotate.d/patching 
94         
95         install -m 500 upgrade-start-pkg-extract ${D}/${sbindir}/upgrade-start-pkg-extract
96
97 }
98
99 FILES_cgcs-patch = " \
100         ${libdir}/python2.7/site-packages/cgcs_patch \
101         ${libdir}/python2.7/site-packages/cgcs_patch-1.0-py2.7.egg-info \
102         ${libdir}/python2.7/site-packages/cgcs_make_patch \
103         ${libdir}/python2.7/site-packages/cgcs_patch-1.0-py2.7.egg-info/top_level.txt \
104         ${sbindir}/rpm-audit \
105         ${sysconfdir}/patching/policy.json \
106         ${sysconfdir}/patching/patching.conf \
107         ${sysconfdir}/patching/patch-scripts \
108         ${sysconfdir}/init.d/sw-patch \
109         ${systemd_system_unitdir}/sw-patch.service \
110         ${sysconfdir}/goenabled.d/patch_check_goenabled.sh \
111         ${sysconfdir}/logrotate.d/patching \
112         ${sysconfdir}/tempfiles.d/patch-tmpdirs.conf \
113         ${sysconfdir}/patching/patch-functions \
114 "
115
116 FILES_cgcs-patch-agent = " \
117         ${sbindir}/sw-patch-agent \
118         ${sbindir}/sw-patch-agent-restart \
119         ${sysconfdir}/pmon.d/sw-patch-agent.conf \
120         ${sbindir}/run-patch-scripts \
121         ${sysconfdir}/init.d/sw-patch-agent \
122         ${systemd_system_unitdir}/sw-patch-agent.service \
123         ${sysconfdir}/bash_completion.d/sw-patch \
124         "
125
126 FILES_cgcs-patch-controller = " \
127         ${sbindir}/sw-patch-controller-daemon-restart \
128         ${sysconfdir}/init.d/sw-patch-controller-daemon \
129         ${sbindir}/sw-patch-controller-daemon \
130         ${sbindir}/upgrade-start-pkg-extract \
131         ${sysconfdir}/pmon.d/sw-patch-controller-daemon.conf \
132         ${systemd_system_unitdir}/sw-patch-controller-daemon.service \
133         ${sbindir}/sw-patch \
134         ${sysconfdir}/init.d/sw-patch-controller \
135         ${systemd_system_unitdir}/sw-patch-controller.service \
136         "