6a667abfe38acc1e768685b1be4f13bfaec6775b
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-config-files / mlx4-init.bb
1 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3 SRCREV_FORMAT = "opendev"
4 SRCREV_opendev = "d778e862571957ece3c404c0c37d325769772fde"
5 SUBPATH0 = "mlx4-config"
6 DSTSUFX0 = "stx-configfiles"
7
8 LICENSE = "Apache-2.0"
9 LIC_FILES_CHKSUM += "\
10         file://stx-configfiles-LICENSE;beginline=1;endline=10;md5=b791daf2e53077e3acb71428524a356d \
11         file://LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10 \
12         "
13
14 SRC_URI += " \
15         git://opendev.org/starlingx/config-files.git;protocol=https;destsuffix=${DSTSUFX0};branch="r/stx.3.0";subpath=${SUBPATH0};name=opendev \
16                 file://APACHE-2.0.LICENSE \
17         "
18
19 RDEPENDS_${PN}_append = " bash"
20
21 inherit systemd
22 SYSTEMD_PACKAGES += "${PN}"
23 SYSETMD_SERVICE_${PN}_append = "mlx4-config.service"
24 SYSTEMD_AUTO_ENABLE_${PN} = "enable"
25 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
26
27
28 do_configure[noexec] = "1"
29 do_patch[noexec] = "1"
30
31 do_unpack_append() {
32     bb.build.exec_func('do_copy_config_files', d)
33 }
34
35 do_copy_config_files () {
36     cp -pf ${WORKDIR}/stx-configfiles/centos/mlx4-config.spec ${S}/stx-configfiles-LICENSE
37     cp -pf ${WORKDIR}/APACHE-2.0.LICENSE  ${S}/LICENSE
38 }
39
40 do_install() {
41         install -d -m 0755 ${D}/${sysconfdir}/init.d/
42         install -d -m 0755 ${D}/${systemd_system_unitdir}/
43         install -d -m 0755 ${D}/${sysconfdir}/goenabled.d/
44         install -d -m 0755 ${D}/${bindir}/
45
46         install -m 755 ${WORKDIR}/${DSTSUFX0}/files/mlx4-configure.sh ${D}/${sysconfdir}/init.d/
47         install -m 644 ${WORKDIR}/${DSTSUFX0}/files/mlx4-config.service ${D}/${systemd_system_unitdir}/
48         install -m 555 ${WORKDIR}/${DSTSUFX0}/files/mlx4_core_goenabled.sh ${D}/${sysconfdir}/goenabled.d/
49         install -m 755 ${WORKDIR}/${DSTSUFX0}/files/mlx4_core_config.sh ${D}/${bindir}/
50 }
51
52 FILES_${PN}_append = " ${systemd_system_unitdir}"
53