stx-utilities: inherit systemd to enable services
[pti/rtp.git] / meta-stx / recipes-core / stx-utilities / utilities / pci-irq-affinity.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 += " pci-irq-affinity"
17
18 RDEPENDS_pci-irq-affinity  += " python-novaclient"
19 DESCRIPTION_pci-irq-affinity  = "StarlingX PCI Interrupt Affinity Agent Package"
20 SUMMARY_pci-irq-affinity  = "StarlingX PCI Interrupt Affinity Agent Package"
21
22 inherit setuptools distutils
23
24 do_configure_append() {
25         cd ${S}/utilities/pci-irq-affinity-agent/pci_irq_affinity
26         distutils_do_configure
27 }
28 do_compile_append() {
29         cd ${S}/utilities/pci-irq-affinity-agent/pci_irq_affinity
30         distutils_do_compile
31 }
32
33 do_install_append() {
34         cd ${S}/utilities/pci-irq-affinity-agent/pci_irq_affinity
35         distutils_do_install
36
37         cd ${S}/utilities/pci-irq-affinity-agent/files
38
39         install -p -d -m0755 ${D}/${sysconfdir}/init.d
40         install -p -d -m0755 ${D}/${sysconfdir}/pmon.d
41         install -p -d -m0755 ${D}/${sysconfdir}/pci_irq_affinity
42         install -p -d -m0755 ${D}/${systemd_system_unitdir}
43         install -p -d -m0755 ${D}/${bindir}
44
45         install -m0755 pci-irq-affinity-agent ${D}/${sysconfdir}/init.d/pci-irq-affinity-agent
46         install -m0644 pci-irq-affinity-agent.service ${D}/${systemd_system_unitdir}/pci-irq-affinity-agent.service
47
48         install -m0755 nova-sriov ${D}/${bindir}/nova-sriov
49         install -m0755 config.ini ${D}/${sysconfdir}/pci_irq_affinity/config.ini
50 }
51
52 FILES_pci-irq-affinity = "  \
53         ${bindir}/pci-irq-affinity-agent \
54         ${sysconfdir}/pci_irq_affinity/config.ini \
55         ${bindir}/nova-sriov \
56         ${sysconfdir}/init.d/pci-irq-affinity-agent \
57         ${systemd_system_unitdir}/pci-irq-affinity-agent.service \
58         ${PYTHON_SITEPACKAGES_DIR}/pci_irq_affinity/ \
59         ${PYTHON_SITEPACKAGES_DIR}/pci_irq_affinity_agent-${PV}-py${PYTHON_BASEVERSION}.egg-info/ \
60         "
61
62 SYSTEMD_PACKAGES += "pci-irq-affinity"
63 SYSTEMD_SERVICE_pci-irq-affinity = "pci-irq-affinity-agent.service"
64 SYSTEMD_AUTO_ENABLE_pci-irq-affinity = "enable"