I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
then I run: # ser
and got: ERROR: loading config file(/usr/local/etc/ser/ser.cfg): No such file or directory
The ERROR message is expected (there is no /usr/local/etc/ser directory at all), but why is sip-router (ser) trying to find configuration file on the default directory if I explicitly compile it pointing to another one? From what I looked on Makefile.defs the config directory is gived by the "cfg_dir" variable... "prefix" is honor, since "ser" binary is installed correctly:
# which ser /sbin/ser
Edson.
I forgot to mention that the message is consistent:
# ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) -L path Modules search path (default: //lib/ser/modules://lib/ser/modules_s://lib/ser/modules_k) ....
but shouldn't it be changed also in this help message?
Edson.
Edson - Lists escreveu:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
then I run: # ser
and got: ERROR: loading config file(/usr/local/etc/ser/ser.cfg): No such file or directory
The ERROR message is expected (there is no /usr/local/etc/ser directory at all), but why is sip-router (ser) trying to find configuration file on the default directory if I explicitly compile it pointing to another one? From what I looked on Makefile.defs the config directory is gived by the "cfg_dir" variable... "prefix" is honor, since "ser" binary is installed correctly:
# which ser /sbin/ser
Edson.
At the moment, compiling with Your sugestion...
But isn't this a workaround, since, in Makefile.defs (lines 234-235) is: # target dirs for various stuff cfg_target = $(prefix)/$(cfg_dir)
I'm not sure if it's the correct approach... at lines 1713-1727 both variables (cfg_dir and cfg_target) are exported... maybe only cfg_target is used, but as pointed before, it's derived from cfg_dir. I don't expect it to work...
Edson.
Juha Heinanen escreveu:
Edson - Lists writes:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
instead of cfg_dir, try
cfg_target=/etc/sip-router
-- juha
As I suspected:
# ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) -L path Modules search path (default: //lib/ser/modules://lib/ser/modules_s://lib/ser/modules_k)
and compilation done through: # make clean; make prefix=/ mandir=/usr/local/man cfg_target=/etc/sip-router install
How to fix it? Should I open a bug report?
Edson.
Edson - Lists escreveu:
At the moment, compiling with Your sugestion...
But isn't this a workaround, since, in Makefile.defs (lines 234-235) is: # target dirs for various stuff cfg_target = $(prefix)/$(cfg_dir)
I'm not sure if it's the correct approach... at lines 1713-1727 both variables (cfg_dir and cfg_target) are exported... maybe only cfg_target is used, but as pointed before, it's derived from cfg_dir. I don't expect it to work...
Edson.
Juha Heinanen escreveu:
Edson - Lists writes:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
instead of cfg_dir, try
cfg_target=/etc/sip-router
-- juha
Hello,
the make system is quite different than what we had in previous kamailio version (which is based on old ser makefile system), using config files for make.
You can try: - make PREFIX=/your/path cfg - check config.mak and tune it as you wish
The just to make; make install...
Of course, anything you test and contribute to wiki is very appreciated: http://sip-router.org/wiki/tutorials/makefile-system
Cheers, Daniel
On 06/10/2009 11:41 PM, Edson - Lists wrote:
As I suspected:
# ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) -L path Modules search path (default: //lib/ser/modules://lib/ser/modules_s://lib/ser/modules_k)
and compilation done through: # make clean; make prefix=/ mandir=/usr/local/man cfg_target=/etc/sip-router install
How to fix it? Should I open a bug report?
Edson.
Edson - Lists escreveu:
At the moment, compiling with Your sugestion...
But isn't this a workaround, since, in Makefile.defs (lines 234-235) is: # target dirs for various stuff cfg_target = $(prefix)/$(cfg_dir)
I'm not sure if it's the correct approach... at lines 1713-1727 both variables (cfg_dir and cfg_target) are exported... maybe only cfg_target is used, but as pointed before, it's derived from cfg_dir. I don't expect it to work...
Edson.
Juha Heinanen escreveu:
Edson - Lists writes:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router
install
instead of cfg_dir, try
cfg_target=/etc/sip-router
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Hi, Daniel
Just returning... # make clean; make PREFIX=/ install .... # ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) ... # ser ERROR: loading config file(/usr/local/etc/ser/ser.cfg): No such file or directory
In other words: nothing changed... still ignoring external settings when compiling...
Next step it to take a look on "config.mak" and see if something pops-up...
Edson.
Daniel-Constantin Mierla escreveu:
Hello,
the make system is quite different than what we had in previous kamailio version (which is based on old ser makefile system), using config files for make.
You can try:
- make PREFIX=/your/path cfg
- check config.mak and tune it as you wish
The just to make; make install...
Of course, anything you test and contribute to wiki is very appreciated: http://sip-router.org/wiki/tutorials/makefile-system
Cheers, Daniel
On 06/10/2009 11:41 PM, Edson - Lists wrote:
As I suspected:
# ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) -L path Modules search path (default: //lib/ser/modules://lib/ser/modules_s://lib/ser/modules_k)
and compilation done through: # make clean; make prefix=/ mandir=/usr/local/man cfg_target=/etc/sip-router install
How to fix it? Should I open a bug report?
Edson.
Edson - Lists escreveu:
At the moment, compiling with Your sugestion...
But isn't this a workaround, since, in Makefile.defs (lines 234-235) is: # target dirs for various stuff cfg_target = $(prefix)/$(cfg_dir)
I'm not sure if it's the correct approach... at lines 1713-1727 both variables (cfg_dir and cfg_target) are exported... maybe only cfg_target is used, but as pointed before, it's derived from cfg_dir. I don't expect it to work...
Edson.
Juha Heinanen escreveu:
Edson - Lists writes:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router
install
instead of cfg_dir, try
cfg_target=/etc/sip-router
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Edson - Lists writes:
As I suspected:
# ser -h version: ser 2.1.0-dev23-make (i386/linux) Usage: ser [options] Options: -f file Configuration file (default: /usr/local/etc/ser/ser.cfg) -L path Modules search path (default: //lib/ser/modules://lib/ser/modules_s://lib/ser/modules_k)
edson,
i had taken the parameter from my debian rules file. the whole rules file is attached below. it can be used to generate sip-router debian package that includes the modules you want to use.
-- juha
#!/usr/bin/make -f
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEBVERSION:=$(shell head -n 1 debian/changelog \ | sed -e 's/^[^(]*(([^)]*)).*/\1/') UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
MAIN_NAME=sip-router
FILENAME := $(MAIN_NAME)_$(UPVERSION).orig.tar.gz UPFILENAME := $(MAIN_NAME)-$(UPVERSION)-tls_src.tar.gz
# Uncomment this to turn on verbose mode. # export DH_VERBOSE=1
# Include dpatch rules include /usr/share/dpatch/dpatch.make
# Do we want SCTP version ? SCTP=1
# Enable K stats KMSTATS=1
BASEDIR=$(CURDIR)/debian/$(MAIN_NAME)
# Modules (list here what you want to use) MODULES = modules/auth_radius modules/db_mysql modules/dialplan \ modules/enum modules/lcr modules/mediaproxy modules/misc_radius \ modules/peering modules/tls modules/tm modules/utils
MODULES_K = modules_k/acc modules_k/auth modules_k/avpops modules_k/cfgutils \ modules_k/domain modules_k/htable modules_k/kex \ modules_k/maxfwd modules_k/mi_fifo \ modules_k/mi_xmlrpc modules_k/msilo modules_k/nathelper \ modules_k/permissions modules_k/pike modules_k/pv modules_k/registrar \ modules_k/rr \ modules_k/siputils modules_k/sl modules_k/textops modules_k/uac \ modules_k/uac_redirect modules_k/usrloc modules_k/xlog
MODULES_S =
ALL_MODULES = $(MODULES) $(MODULES_K) $(MODULES_S)
ifeq (cc, $(CC)) CC = gcc endif
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif
configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package.
touch configure-stamp
build: build-stamp build-stamp: patch-stamp configure-stamp dh_testdir
# Add here commands to compile the package.
# Configure and compile sip-router $(MAKE) cfg CC=$(CC) CFLAGS="$(CFLAGS)" SCTP=$(SCTP) KMSTATS=$(KMSTATS) MAIN_NAME=$(MAIN_NAME) basedir=$(BASEDIR) prefix=/usr cfg_prefix=$(BASEDIR) cfg_target=/etc/sip-router modules="$(MODULES)" modules_s="" modules_k="$(MODULES_K)" $(MAKE) all
# generate the db schemas (not available yet) # $(MAKE) dbschema
touch build-stamp
clean: real-clean unpatch real-clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process. -$(MAKE) include_modules="$(ALL_MODULES)" proper rm -f cfg.tab.h rm -f utils/kamunix/kamunix.o utils/kamunix/kamunix.d utils/kamunix/kamunix
dh_clean
install: build dh_testdir dh_testroot dh_clean -k dh_installdirs
# Add here commands to install the package into debian/$(MAIN_NAME)
$(MAKE) install
find $(BASEDIR)/etc/$(MAIN_NAME) -type f -exec chmod -x {} ;
# This single target is used to build all the packages, all at once, or # one at a time. So keep in mind: any options passed to commands here will # affect _all_ packages. Anything you want to only affect one package # should be put in another target, such as the install target.
binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installlogrotate dh_installinit -p$(MAIN_NAME) --name=$(MAIN_NAME) -- defaults 23 dh_installcron dh_installman dh_installchangelogs dh_link # dh_strip --dbg-package=$(MAIN_NAME)-dbg dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb
# Build architecture-independent packages using the common target binary-indep: build install # We have nothing to do by default.
binary: binary-indep binary-arch
print-version: @@echo "Debian version: $(DEBVERSION)" @@echo "Upstream version: $(UPVERSION)"
get-orig-source: @@dh_testdir @@[ -d ../tarballs/. ]||mkdir -p ../tarballs @@echo Downloading $(FILENAME) from $(URL) ... @@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL)
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch real-clean
On Jun 10, 2009 at 17:30, Edson - Lists 4lists@gmail.com wrote:
At the moment, compiling with Your sugestion...
But isn't this a workaround, since, in Makefile.defs (lines 234-235) is: # target dirs for various stuff cfg_target = $(prefix)/$(cfg_dir)
I'm not sure if it's the correct approach... at lines 1713-1727 both variables (cfg_dir and cfg_target) are exported... maybe only cfg_target is used, but as pointed before, it's derived from cfg_dir. I don't expect it to work...
cfg_dir = config dir without the common prefix = etc/$(MAIN_NAME)
cfg_prefix = config install prefix = $(basedir)$(prefix) cfg_target = where ser thinks the config is = $(prefix)/$(cfg_dir)
The ideea is that you might want to install into some tmp. directory (e.g. for creating a binary archive, a .deb a.s.o), but have the binary search the config in the final install path, e.g.:
make install BASEDIR=/tmp/sr prefix=/usr/local cfg_target=/usr/local/etc
(will install in /tmp/sr/usr/local, but the config. path will be set to /usrlocal/etc => we could create a binary package from /tmp/sr that will use the proper config file).
What should probably be done at some point is to split cfg_prefix (and all the other *_prefix) into cfg_install_prefix and cfg_target_prefix. This way we'll have even more flexibility and we could have better default choices.
Andrei
On Jun 10, 2009 at 16:43, Edson - Lists 4lists@gmail.com wrote:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
then I run: # ser
and got: ERROR: loading config file(/usr/local/etc/ser/ser.cfg): No such file or directory
The ERROR message is expected (there is no /usr/local/etc/ser directory at all), but why is sip-router (ser) trying to find configuration file on the default directory if I explicitly compile it pointing to another one? From what I looked on Makefile.defs the config directory is gived by the "cfg_dir" variable... "prefix" is honor, since "ser" binary is installed correctly:
# which ser /sbin/ser
You have to run make cfg prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router and then make install.
You could override most saved config vars on the command line, but the problem with the built-in config dir is that is part of C_DEFS (-DCFG_DIR=....) and C_DEFS is evaluated before is saved in config.mak => even if you later override cfg_target, prefix or cfg_dir, C_DEFS won't change.
I could make this override work (either by moving -DCFG_DIR out of C_DEFS or by saving C_DEFS without evaluating it first), but on any change to prefix, cfg_dir or cfg_target you'll get a full recompilation any way, since -DCFG_DIR will change (so the only gain would be not having to run make cfg).
Andrei