kamailio-5.x: update configuration file handling

- add install/conffile routine
- use it for main package
- setup BuildKamailio5Module to allow inclusion of configuration files
  on a per-module basis (mod-tls is currently the only user)

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-02-10 15:12:48 +01:00
parent 000b984212
commit 606fe5f10e

View file

@ -51,6 +51,7 @@ define Package/kamailio5/conffiles
endef endef
define Package/kamailio5/install define Package/kamailio5/install
$(foreach c,kamailio.cfg kamctlrc,$(call Package/kamailio5/install/conffile,$(1),$(c));)
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) \ $(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,cmd,ctl,dbctl} \ $(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,cmd,ctl,dbctl} \
@ -59,10 +60,6 @@ define Package/kamailio5/install
$(CP) \ $(CP) \
$(PKG_INSTALL_DIR)/usr/lib/kamailio/lib*.so* \ $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib*.so* \
$(1)/usr/lib/kamailio/ $(1)/usr/lib/kamailio/
$(INSTALL_DIR) $(1)/etc/kamailio
$(INSTALL_CONF) \
$(PKG_INSTALL_DIR)/etc/kamailio/{kamailio.cfg,kamctlrc} \
$(1)/etc/kamailio/
$(INSTALL_DIR) $(1)/etc/default $(INSTALL_DIR) $(1)/etc/default
$(INSTALL_CONF) \ $(INSTALL_CONF) \
./files/kamailio.default \ ./files/kamailio.default \
@ -76,6 +73,11 @@ define Package/kamailio5/install
$(1)/usr/lib/kamailio/ $(1)/usr/lib/kamailio/
endef endef
define Package/kamailio5/install/conffile
$(INSTALL_DIR) $(1)/etc/kamailio
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/kamailio/$(2) $(1)/etc/kamailio
endef
define Package/kamailio5/install/dbfiles define Package/kamailio5/install/dbfiles
$(INSTALL_DIR) $(1)/usr/share/kamailio/$(2) $(INSTALL_DIR) $(1)/usr/share/kamailio/$(2)
$(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/ $(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/
@ -95,9 +97,12 @@ define BuildKamailio5Module
INCL_MODULES+=$(1) INCL_MODULES+=$(1)
endif endif
endef endef
define Package/kamailio5-mod-$(subst _,-,$(1))/conffiles
$(subst $(space),$(newline),$(foreach c,$(6),/etc/kamailio/$(c)))
endef
define Package/kamailio5-mod-$(subst _,-,$(1))/install define Package/kamailio5-mod-$(subst _,-,$(1))/install
$(call Package/kamailio5/install/module,$$(1),$(1)) $(call Package/kamailio5/install/module,$$(1),$(1))
$(foreach c,$(6),$(call Package/kamailio5/install/conffile,$$(1),$(c));)
$(foreach d,$(5),$(call Package/kamailio5/install/dbfiles,$$(1),$(d));) $(foreach d,$(5),$(call Package/kamailio5/install/dbfiles,$$(1),$(d));)
endef endef
$$(eval $$(call BuildPackage,kamailio5-mod-$(subst _,-,$(1)))) $$(eval $$(call BuildPackage,kamailio5-mod-$(subst _,-,$(1))))
@ -138,6 +143,7 @@ $(eval $(call BuildPackage,kamailio5))
# 3 - Module description # 3 - Module description
# 4 - Dependencies # 4 - Dependencies
# 5 - Kamailio DB files # 5 - Kamailio DB files
# 6 - Configuration files
################################ ################################
$(eval $(call BuildKamailio5Module,acc,Accounting,,+kamailio5-mod-tm)) $(eval $(call BuildKamailio5Module,acc,Accounting,,+kamailio5-mod-tm))
@ -232,7 +238,7 @@ $(eval $(call BuildKamailio5Module,stun,STUN server support,,))
$(eval $(call BuildKamailio5Module,sst,SIP Session Timer,,+kamailio5-mod-dialog +kamailio5-mod-sl)) $(eval $(call BuildKamailio5Module,sst,SIP Session Timer,,+kamailio5-mod-dialog +kamailio5-mod-sl))
$(eval $(call BuildKamailio5Module,tcpops,TCP options tweaking operations,,)) $(eval $(call BuildKamailio5Module,tcpops,TCP options tweaking operations,,))
$(eval $(call BuildKamailio5Module,textops,Text operations,,)) $(eval $(call BuildKamailio5Module,textops,Text operations,,))
$(eval $(call BuildKamailio5Module,tls,TLS operations,,+libopenssl)) $(eval $(call BuildKamailio5Module,tls,TLS operations,,+libopenssl,,tls.cfg))
$(eval $(call BuildKamailio5Module,topoh,Topology hiding,,+kamailio5-mod-rr)) $(eval $(call BuildKamailio5Module,topoh,Topology hiding,,+kamailio5-mod-rr))
$(eval $(call BuildKamailio5Module,tm,Transaction,,)) $(eval $(call BuildKamailio5Module,tm,Transaction,,))
$(eval $(call BuildKamailio5Module,tmx,Transaction module extensions,,)) $(eval $(call BuildKamailio5Module,tmx,Transaction module extensions,,))