You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.5 KiB

  1. #
  2. # Copyright (C) 2016 Velocloud Inc.
  3. # Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=modemmanager
  9. PKG_SOURCE_VERSION:=1.18.6
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
  13. PKG_MIRROR_HASH:=72f1a865153745d05c482ed3a77f2045d24387f1f9a37177fe7bc35ab7663765
  14. PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
  15. PKG_LICENSE:=GPL-2.0-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_INSTALL:=1
  18. PKG_BUILD_DEPENDS:=glib2/host libxslt/host
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/nls.mk
  21. include $(INCLUDE_DIR)/meson.mk
  22. TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
  23. TARGET_LDFLAGS += -Wl,--gc-sections
  24. define Package/modemmanager/config
  25. source "$(SOURCE)/Config.in"
  26. endef
  27. define Package/modemmanager
  28. SECTION:=net
  29. CATEGORY:=Network
  30. TITLE:=Control utility for any kind of mobile broadband modem
  31. URL:=https://www.freedesktop.org/wiki/Software/ModemManager
  32. DEPENDS:= \
  33. $(INTL_DEPENDS) \
  34. +glib2 \
  35. +dbus \
  36. +ppp \
  37. +MODEMMANAGER_WITH_MBIM:libmbim \
  38. +MODEMMANAGER_WITH_QMI:libqmi \
  39. +MODEMMANAGER_WITH_QRTR:libqrtr-glib
  40. endef
  41. define Package/modemmanager/description
  42. ModemManager is a D-Bus-activated service which allows controlling mobile
  43. broadband modems. Add kernel modules for your modems as needed.
  44. Select Utilities/usb-modeswitch if needed.
  45. endef
  46. MESON_ARGS += \
  47. -Dudev=false \
  48. -Dudevdir=/lib/udev \
  49. -Dsystemdsystemunitdir=no \
  50. -Dsystemd_suspend_resume=false \
  51. -Dsystemd_journal=false \
  52. -Dpolkit=no \
  53. -Dintrospection=false \
  54. -Dman=false \
  55. -Dbash_completion=false \
  56. -Db_lto=true \
  57. -Dmbim=$(if $(CONFIG_MODEMMANAGER_WITH_MBIM),true,false) \
  58. -Dqmi=$(if $(CONFIG_MODEMMANAGER_WITH_QMI),true,false) \
  59. -Dqrtr=$(if $(CONFIG_MODEMMANAGER_WITH_QRTR),true,false) \
  60. -Dat_command_via_dbus=$(if $(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),true,false)
  61. define Build/InstallDev
  62. $(INSTALL_DIR) $(1)/usr/include/ModemManager
  63. $(CP) $(PKG_INSTALL_DIR)/usr/include/ModemManager/*.h $(1)/usr/include/ModemManager
  64. $(INSTALL_DIR) $(1)/usr/include/libmm-glib
  65. $(CP) $(PKG_INSTALL_DIR)/usr/include/libmm-glib/*.h $(1)/usr/include/libmm-glib
  66. $(INSTALL_DIR) $(1)/usr/lib
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmm-glib.so* $(1)/usr/lib
  68. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/ModemManager.pc $(1)/usr/lib/pkgconfig
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mm-glib.pc $(1)/usr/lib/pkgconfig
  71. endef
  72. define Package/modemmanager/install
  73. $(INSTALL_DIR) $(1)/lib/udev/rules.d
  74. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/udev/rules.d/*.rules $(1)/lib/udev/rules.d
  75. $(INSTALL_DIR) $(1)/usr/sbin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ModemManager $(1)/usr/sbin
  77. $(INSTALL_BIN) ./files/usr/sbin/ModemManager-wrapper $(1)/usr/sbin
  78. $(INSTALL_DIR) $(1)/usr/bin
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mmcli $(1)/usr/bin
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmm-glib.so.* $(1)/usr/lib
  82. $(INSTALL_DIR) $(1)/usr/lib/ModemManager
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ModemManager/libmm-shared-*.so* $(1)/usr/lib/ModemManager
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ModemManager/libmm-plugin-*.so* $(1)/usr/lib/ModemManager
  85. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  86. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf $(1)/etc/dbus-1/system.d
  87. $(INSTALL_DIR) $(1)/usr/share/dbus-1/system-services
  88. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/dbus-1/system-services/org.freedesktop.ModemManager1.service $(1)/usr/share/dbus-1/system-services
  89. $(INSTALL_DIR) $(1)/usr/share/ModemManager
  90. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ModemManager/*.conf $(1)/usr/share/ModemManager
  91. $(INSTALL_DATA) ./files/modemmanager.common $(1)/usr/share/ModemManager
  92. $(INSTALL_DIR) $(1)/etc/init.d
  93. $(INSTALL_BIN) ./files/modemmanager.init $(1)/etc/init.d/modemmanager
  94. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  95. $(INSTALL_DATA) ./files/25-modemmanager-usb $(1)/etc/hotplug.d/usb
  96. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  97. $(INSTALL_DATA) ./files/25-modemmanager-net $(1)/etc/hotplug.d/net
  98. $(INSTALL_DIR) $(1)/etc/hotplug.d/tty
  99. $(INSTALL_DATA) ./files/25-modemmanager-tty $(1)/etc/hotplug.d/tty
  100. $(INSTALL_DIR) $(1)/etc/hotplug.d/wwan
  101. $(INSTALL_DATA) ./files/25-modemmanager-wwan $(1)/etc/hotplug.d/wwan
  102. $(INSTALL_DIR) $(1)/lib/netifd/proto
  103. $(INSTALL_BIN) ./files/modemmanager.proto $(1)/lib/netifd/proto/modemmanager.sh
  104. endef
  105. $(eval $(call BuildPackage,modemmanager))