Installing config file

I have my own package that installs a config file. Is there any way not to overwrite existing config file when upgrading? The nicest was if the installer did a blabla.conf_new or blabla.conf_pkg if file existed.

Any idea how to do this?

I use $(INSTALL_CONF) $(PKG_BUILD_DIR)/sdmd.conf $(1)/etc/ statement in my makefile to install the config file.

Thanks,
Levente

im trying to automate the process in python what do you use for the newest snapshot images with latest binutils and gcc for all languages as well?

I have LEDE 17.01.1. I'm compiling LEDE on Debian stable.
I don't think this problem shall be solved at compile time. There must be some active process at install time.

is that not already handled by opkg?

If it does, the question is how to do it.