osmo-bts: handle systemd and cfg files through autotools

This commit is contained in:
Pau Espin 2018-09-14 15:33:43 +02:00
parent 96105ded43
commit 1fea555cc9
1 changed files with 9 additions and 32 deletions

View File

@ -24,6 +24,11 @@ EXTRA_OECONF_sysmobts2100 += "--enable-litecell15"
inherit autotools pkgconfig systemd
PACKAGECONFIG ??= "\
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
"
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_AUTO_ENABLE_${PN}="enable"
@ -31,39 +36,11 @@ SYSTEMD_AUTO_ENABLE_${PN}="enable"
inherit femtobts_api
CPPFLAGS_append_sysmobts-v2 = " ${BTS_HW_VERSION} "
do_install_append() {
install -d ${D}${sysconfdir}/osmocom
install -d ${D}/${systemd_system_unitdir}
}
SYSTEMD_SERVICE_${PN}_append_sysmobts-v2 = " sysmobts-mgr.service osmo-bts-sysmo.service"
SYSTEMD_SERVICE_${PN}_append_sysmobts2100 = " lc15bts-mgr.service osmo-bts-lc15.service"
do_install_append_sysmobts-v2() {
install -m 0660 ${S}/doc/examples/sysmo/osmo-bts.cfg ${D}${sysconfdir}/osmocom
# Install systemd and enable on sysinit
install -m 0660 ${S}/doc/examples/sysmo/sysmobts-mgr.cfg ${D}${sysconfdir}/osmocom
install -m 0644 ${S}/contrib/sysmobts-mgr.service ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/contrib/osmo-bts-sysmo.service ${D}${systemd_system_unitdir}/
}
do_install_append_sysmobts2100() {
install -m 0660 ${S}/doc/examples/litecell15/osmo-bts.cfg ${D}${sysconfdir}/osmocom
# ensure consistent naming
cp ${D}/${bindir}/lc15bts-util ${D}/${bindir}/sysmobts-util
cp ${D}/${bindir}/lc15bts-mgr ${D}/${bindir}/sysmobts-mgr
# Install systemd and enable on sysinit
install -m 0644 ${S}/contrib/lc15bts-mgr.service ${D}${systemd_system_unitdir}/lc15bts-mgr.service
install -m 0660 ${S}/doc/examples/litecell15/lc15bts-mgr.cfg ${D}${sysconfdir}/osmocom/
install -m 0644 ${S}/contrib/osmo-bts-lc15.service ${D}${systemd_system_unitdir}/
}
SYSTEMD_SERVICE_${PN}_append_sysmobts-v2 = "sysmobts-mgr.service osmo-bts-sysmo.service"
SYSTEMD_SERVICE_${PN}_append_sysmobts2100 = "lc15bts-mgr.service osmo-bts-lc15.service"
CONFFILES_${PN} = "${sysconfdir}/osmocom/osmo-bts.cfg"
CONFFILES_${PN}_append_sysmobts-v2 = " ${sysconfdir}/osmocom/sysmobts-mgr.cfg"
CONFFILES_${PN}_append_sysmobts-v2 = " ${sysconfdir}/osmocom/sysmobts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts-sysmo.cfg"
CONFFILES_${PN}_append_sysmobts2100 = " ${sysconfdir}/osmocom/lc15bts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts-lc15.cfg"
# somehow it seems not posible to use _append constructs on PACKAGES
#PACKAGES_append_sysmobts-v2 = " osmo-bts-remote sysmobts-calib sysmobts-util"