asterisk-13.x: change some default file locations
authorSebastian Kemper <sebastian_ml@gmx.net>
Wed, 10 Jan 2018 22:04:41 +0000 (23:04 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Wed, 10 Jan 2018 22:04:43 +0000 (23:04 +0100)
- Set data dir to /usr/share/asterisk and use default locations for
  everything else.
- This is more in line with FHS. Database files are now written to tmpfs
  (/var is mounted there). This prevents the rootfs from filling up. It
  also prevents the flash to degrade during constant database rewriting.
- As the data dir changes, so does the location of the sound files. This
  commit also takes care of that.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk-13.x/Makefile
net/asterisk-13.x/files/asterisk.init

index f800b0b6e7a8ca0cba795d5ff4d113e56ec706d6..c487c99d0c28f67f3e8463d8d3e3592a5da494e7 100644 (file)
@@ -46,8 +46,8 @@ define Package/asterisk13/install/sbin
 endef
 
 define Package/asterisk13/install/sounds
-       $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) $(1)/usr/lib/asterisk/sounds/
+       $(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/$(2) $(1)/usr/share/asterisk/sounds/
 endef
 
 define BuildAsterisk13Module
@@ -146,7 +146,7 @@ $(call Package/asterisk13/install/sbin,$(1),safe_asterisk)
 $(call Package/asterisk13/install/sbin,$(1),astgenkey)
 $(foreach m,$(AST_CFG_FILES),$(call Package/asterisk13/install/conffile,$(1),$(m));)
 $(foreach m,$(AST_EMB_MODULES),$(call Package/asterisk13/install/module,$(1),$(m));)
-       $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
+       $(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
        $(INSTALL_DIR) $(1)/etc/default
        $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
        $(INSTALL_DIR) $(1)/etc/init.d
@@ -164,9 +164,9 @@ This package provides the sound-files for Asterisk-13.
 endef
 
 define Package/asterisk13-sounds/install
-       $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
-       rm -f $(1)/usr/lib/asterisk/sounds/vm-*
+       $(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/* $(1)/usr/share/asterisk/sounds/
+       rm -f $(1)/usr/share/asterisk/sounds/vm-*
 endef
 
 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk13-chan-dahdi),)
@@ -264,10 +264,7 @@ define Build/Compile
        ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY"
        ASTLDFLAGS="$(EXTRA_LDFLAGS)"
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
-               ASTVARLIBDIR="/usr/lib/asterisk" \
-               ASTDATADIR="/usr/lib/asterisk" \
-               ASTKEYDIR="/usr/lib/asterisk" \
-               ASTDBDIR="/usr/lib/asterisk" \
+               ASTDATADIR="/usr/share/asterisk" \
                NOISY_BUILD="yes" \
                DEBUG="" \
                OPTIMIZE="" \
index 78e891383c2ae9073cd1b17a13b8ecac72137570..aa413fc350217e3333e4edc16edef90d0fd8d441 100644 (file)
@@ -14,8 +14,7 @@ start() {
        [ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
        [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
        [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
-       [ -d $DEST/var/lib ] || mkdir -p $DEST/var/lib
-       [ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk
+       [ -d $DEST/var/lib/asterisk ] || mkdir -p $DEST/var/lib/asterisk
        [ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
        [ -d $DEST/var/log/asterisk/cdr-csv ] || mkdir -p $DEST/var/log/asterisk/cdr-csv