freeswitch-stable: move hotplug into main pkg
authorSebastian Kemper <sebastian_ml@gmx.net>
Mon, 12 Nov 2018 20:55:21 +0000 (21:55 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Mon, 12 Nov 2018 21:00:40 +0000 (22:00 +0100)
There is no point in keeping the hotplug script in an extra package.
Move it to the main package.

The priority of the script is changed from 99 to 90 as the freeswitch
init script uses the same.

The postinstall script will check if 99-freeswitch exists. If it does a
warning is displayed with the suggestion to uninstall the hotplug
package.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/freeswitch-stable/Makefile

index 6c3d8f06aa19f6f085d2c2c290545b08292075b1..0dd4dcffaf2e3a8b9f99d4ff72bae083bcb7dd28 100644 (file)
@@ -414,10 +414,13 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(PRG_NAME))
        $(INSTALL_DIR) $(1)$(FS_STABLE_SCRIPTS_DIR)
        $(INSTALL_DIR) $(1)$(FS_STABLE_SOUNDS_DIR)
        $(INSTALL_DIR) $(1)$(FS_STABLE_SYSCONF_DIR)/config
+       $(INSTALL_DIR) $(1)$(FS_STABLE_SYSCONF_DIR)/hotplug.d/iface
        $(INSTALL_DIR) $(1)$(FS_STABLE_SYSCONF_DIR)/init.d
        $(INSTALL_DIR) $(1)$(FS_STABLE_TLS_DIR)
        $(INSTALL_BIN) ./files/$(PRG_NAME).init \
                $(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME)
+       $(INSTALL_BIN) ./files/$(PRG_NAME).hotplug \
+               $(1)$(FS_STABLE_SYSCONF_DIR)/hotplug.d/iface/90-$(PRG_NAME)
        $(INSTALL_CONF) ./files/$(PRG_NAME).config \
                $(1)$(FS_STABLE_SYSCONF_DIR)/config/$(PRG_NAME)
 endef
@@ -437,37 +440,17 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
   echo "| Edit /etc/config/freeswitch to change basic init configuration.   |"
   echo "o-------------------------------------------------------------=^_^=-o"
   echo
-fi
-exit 0
-endef
-
-define Package/$(PKG_NAME)-misc-hotplug
-$(call Package/$(PKG_NAME)/Default)
-  TITLE:=Hotplug script
-  DEPENDS:=$(PKG_NAME)
-  PKGARCH:=all
-endef
-
-define Package/$(PKG_NAME)-misc-hotplug/description
-This package includes a hotplug script for FreeSWITCH.
-endef
-
-define Package/$(PKG_NAME)-misc-hotplug/install
-       $(INSTALL_DIR) $(1)$(FS_STABLE_SYSCONF_DIR)/hotplug.d/iface
-       $(INSTALL_BIN) ./files/$(PRG_NAME).hotplug \
-               $(1)$(FS_STABLE_SYSCONF_DIR)/hotplug.d/iface/99-$(PRG_NAME)
-endef
-
-define Package/$(PKG_NAME)-misc-hotplug/postinst
-#!/bin/sh
-if [ -z "$${IPKG_INSTROOT}" ]; then
-  echo
-  echo "o-------------------------------------------------------------------o"
-  echo "| FreeSWITCH hotplug note                                           |"
-  echo "o-------------------------------------------------------------------o"
-  echo "| See /etc/config/freeswitch for hotplug hints.                     |"
-  echo "o-------------------------------------------------------------=^_^=-o"
-  echo
+  [ -f /etc/hotplug.d/iface/99-freeswitch ] && {
+    echo "o-------------------------------------------------------------------o"
+    echo "| WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING   |"
+    echo "o-------------------------------------------------------------------o"
+    echo "| Please remove freeswitch-stable-misc-hotplug. The hotplug script  |"
+    echo "| is now part of the main freeswitch-stable package. Please run:    |"
+    echo "|                                                                   |"
+    echo "| opkg remove freeswitch-stable-misc-hotplug                        |"
+    echo "o-------------------------------------------------------------=^_^=-o"
+    echo
+  }
 fi
 exit 0
 endef
@@ -939,7 +922,6 @@ endef
 
 $(eval $(call BuildPackage,$(PKG_LIBFTDM)))
 $(eval $(call BuildPackage,$(PKG_NAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)-misc-hotplug))
 $(eval $(call BuildPackage,$(PKG_NAME)-misc-perl-esl))
 $(eval $(call BuildPackage,$(PKG_NAME)-misc-python-esl))
 $(eval $(call BuildPackage,$(PKG_NAME)-misc-timezones))