modemmanager: make rpcd integration optional 24732/head
authorChristian Svensson <blue@cmd.nu>
Sat, 3 Aug 2024 13:30:39 +0000 (15:30 +0200)
committerChristian Svensson <blue@cmd.nu>
Wed, 7 Aug 2024 13:27:33 +0000 (15:27 +0200)
ModemManager does not depend on Lua by its own, so make it possible to
not have a requirement on Lua if the rpcd integration is not needed.

Signed-off-by: Christian Svensson <blue@cmd.nu>
net/modemmanager/Makefile

index 30d86e3ad9c2dd347c24417f174abdc1a2d727a2..69df258b5d469856f7730846d0eb1472985f0099 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_VERSION:=1.22.0
-PKG_RELEASE:=17
+PKG_RELEASE:=18
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
@@ -43,7 +43,6 @@ define Package/modemmanager
        +glib2 \
        +dbus \
        +ppp \
-       +lua-cjson \
        +MODEMMANAGER_WITH_MBIM:libmbim \
        +MODEMMANAGER_WITH_QMI:libqmi \
        +MODEMMANAGER_WITH_QRTR:libqrtr-glib
@@ -55,6 +54,24 @@ define Package/modemmanager/description
   Select Utilities/usb-modeswitch if needed.
 endef
 
+define Package/modemmanager-rpcd
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=RPC interface for ModemManager for rpcd
+  URL:=https://www.freedesktop.org/wiki/Software/ModemManager
+  DEPENDS:= \
+       modemmanager \
+       +lua-cjson
+endef
+
+define Package/modemmanager-rpcd/description
+  ModemManager is a D-Bus-activated service which allows controlling mobile
+  broadband modems.
+
+  This package enables an rpcd interface for getting information from
+  ModemManager using e.g. ubus.
+endef
+
 MESON_ARGS += \
        -Dudev=false \
        -Dudevdir=/lib/udev \
@@ -96,10 +113,6 @@ define Package/modemmanager/install
        $(INSTALL_BIN) ./files/usr/sbin/ModemManager-wrapper $(1)/usr/sbin
        $(INSTALL_BIN) ./files/usr/sbin/ModemManager-monitor $(1)/usr/sbin
 
-       $(INSTALL_DIR) $(1)/usr/libexec/rpcd
-       $(INSTALL_BIN) ./files/usr/libexec/rpcd/modemmanager \
-               $(1)/usr/libexec/rpcd/
-
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mmcli $(1)/usr/bin
 
@@ -145,4 +158,11 @@ define Package/modemmanager/install
                $(1)/lib/netifd/proto
 endef
 
+define Package/modemmanager-rpcd/install
+       $(INSTALL_DIR) $(1)/usr/libexec/rpcd
+       $(INSTALL_BIN) ./files/usr/libexec/rpcd/modemmanager \
+               $(1)/usr/libexec/rpcd/
+endef
+
 $(eval $(call BuildPackage,modemmanager))
+$(eval $(call BuildPackage,modemmanager-rpcd))