[net] Telephony: Yate: Added conffiles. Fixes overwriting of configuration on reinst...
authorcshore <cshore@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 16 Mar 2011 00:16:19 +0000 (00:16 +0000)
committercshore <cshore@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 16 Mar 2011 00:16:19 +0000 (00:16 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@26184 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/yate/Makefile

index 2b95a14..04d4d83 100644 (file)
@@ -11,7 +11,7 @@ RELEASEVER:=3.2.0
 
 PKG_NAME:=yate
 PKG_VERSION:=$(RELEASEVER)-1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate3/
@@ -37,6 +37,10 @@ define Package/$(PKG_NAME)
   MENU:=1
 endef
 
+define Package/$(PKG_NAME)/conffiles
+/etc/yate/yate.conf
+endef
+
 define Package/$(PKG_NAME)/Default/description
   Is a next-generation telephony engine focused on the VoIP and PSTN.  It does
   SIP, H.323, IAX, PSTN, and more.
@@ -85,17 +89,23 @@ define BuildPlugin
     DEPENDS:= $(PKG_NAME) $(4)
     TITLE:=$(3)
   endef
+
+  $(if $(PKG_BUILD_DIR)/conf.d/$(1).conf.sample,
+  define Package/$(PKG_NAME)-mod-$(1)/conffiles
+    /etc/yate/$(1).conf
+  endef
+  ,)
   
   define Package/$(PKG_NAME)-mod-$(1)/description
     $(3) module for $(PKG_NAME)
   endef
   
   define Package/$(PKG_NAME)-mod-$(1)/install
-       $$(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME)/$(2)
+       $$(INSTALL_DIR) $$(1)/usr/lib/yate/$(2)
        $$(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/$(2)/$(1).yate $$(1)/usr/lib/yate/$(2)/$(1).yate
        if [ -f $$(PKG_BUILD_DIR)/conf.d/$(1).conf.sample ]; then \
-               $$(INSTALL_DIR) $$(1)/etc/$(PKG_NAME) ;\
-               $$(INSTALL_DATA) $$(PKG_BUILD_DIR)/conf.d/$(1).conf.sample $$(1)/etc/$(PKG_NAME)/$(1).conf ;\
+               $$(INSTALL_DIR) $$(1)/etc/yate ;\
+               $$(INSTALL_DATA) $$(PKG_BUILD_DIR)/conf.d/$(1).conf.sample $$(1)/etc/yate/$(1).conf ;\
        fi
   endef