From 394fc6e834d6f5fa49595579102a26a2271e44a3 Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 7 Nov 2005 03:09:23 +0000 Subject: [PATCH] Separated scripts from modules directory. git-svn-id: http://yate.null.ro/svn/yate/trunk@563 acf43c95-373e-0410-b603-e72c3f656dc1 --- ChangeLog | 6 ++++++ Makefile.in | 10 +++++++--- conf.d/extmodule.conf.sample | 3 ++- engine/Engine.cpp | 3 ++- modules/Makefile.in | 4 +++- modules/cdrbuild.cpp | 3 ++- modules/extmodule.cpp | 6 +++++- modules/skin/Makefile.in | 6 +++++- scripts/Makefile.in | 16 +++++++++------- yate-config.in | 11 +++++++++-- yate.spec.in | 17 ++++++++++++----- 11 files changed, 62 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55fffe45..aaef3235 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Nov 05 2005 Paul Chitescu +- Modified the PHP libraries to work with PHP 5, breaks PHP 4 +- Added pre-answer timeout in channels +- Fixed bugs in disconnecting wave sources +- Added option settings for external modules + Wed Nov 02 2005 Paul Chitescu - TOS setting support and configuration improvments in RTP - Fixed time parsing of messages from external modules diff --git a/Makefile.in b/Makefile.in index a6239f51..9d489d36 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,14 +34,16 @@ LINK = $(CXX) $(LDFLAGS) prefix = @prefix@ exec_prefix = @exec_prefix@ +basedir = @libdir@/yate +confdir = @sysconfdir@/yate bindir = @bindir@ libdir = @libdir@ incdir = @includedir@/yate mandir = @mandir@ docdir = $(prefix)/share/doc/yate-@PACKAGE_VERSION@ vardir = @localstatedir@/lib/yate -moddir = @libdir@/yate -confdir = @sysconfdir@/yate +moddir = $(basedir)/modules +scrdir = $(basedir)/scripts .PHONY: all everything all: engine modules clients @@ -120,6 +122,7 @@ tables: @srcdir@/tables/all.h yatepaths.h: $(MKDEPS) @echo '#define MOD_PATH "$(DESTDIR)$(moddir)"' > $@ + @echo '#define SCR_PATH "$(DESTDIR)$(scrdir)"' >> $@ @echo '#define CFG_PATH "$(DESTDIR)$(confdir)"' >> $@ windows: check-topdir @@ -171,7 +174,7 @@ uninstall uninstall-root: rm "$(DESTDIR)$(libdir)/$$i" ; \ done; \ $(MAKE) -C ./clients uninstall - $(LDCONFIG) + @$(LDCONFIG) @-for i in $(PROGS) yate-config ; do \ rm "$(DESTDIR)$(bindir)/$$i" ; \ done @@ -188,6 +191,7 @@ uninstall uninstall-root: $(MAKE) -C ./modules uninstall $(MAKE) -C ./scripts uninstall $(MAKE) -C ./conf.d uninstall + @-rmdir "$(DESTDIR)$(basedir)" install-root uninstall-root: LDCONFIG:=ldconfig diff --git a/conf.d/extmodule.conf.sample b/conf.d/extmodule.conf.sample index 63087a71..f0b76fb7 100644 --- a/conf.d/extmodule.conf.sample +++ b/conf.d/extmodule.conf.sample @@ -3,7 +3,8 @@ ; scripts_dir: string: The absolute or relative path used by default to load ; scripts if no full path is specified -; Note that a trailing path separator MUST be added +; Note that a trailing path separator should be added +; Uncomment the following line when running in the sources directory ;scripts_dir=scripts/ diff --git a/engine/Engine.cpp b/engine/Engine.cpp index 017d9e80..402517c2 100644 --- a/engine/Engine.cpp +++ b/engine/Engine.cpp @@ -475,6 +475,8 @@ int Engine::run() Debug(DebugGoOn,"Failed to initialize the Windows Sockets library, error code %d",errc); return errc & 127; } +#else + ::signal(SIGPIPE,SIG_IGN); #endif s_cfg = configFile(s_cfgfile); s_cfg.load(); @@ -502,7 +504,6 @@ int Engine::run() #ifndef _WINDOWS ::signal(SIGHUP,sighandler); ::signal(SIGQUIT,sighandler); - ::signal(SIGPIPE,SIG_IGN); ::signal(SIGCHLD,sighandler); ::signal(SIGUSR1,sighandler); ::signal(SIGUSR2,sighandler); diff --git a/modules/Makefile.in b/modules/Makefile.in index 520feeb4..683da130 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -66,9 +66,10 @@ LINK = $(CXX) $(LDFLAGS) MODLINK = $(CXX) $(MODFLAGS) $(MODSTRIP) $(LDFLAGS) MODCOMP = $(COMPILE) $(MODFLAGS) $(MODSTRIP) $(LDFLAGS) +basedir = @libdir@/yate prefix = @prefix@ exec_prefix = @exec_prefix@ -moddir = @libdir@/yate +moddir = $(basedir)/modules .PHONY: all all: do-all $(LIBS) $(PROGS) @@ -99,6 +100,7 @@ uninstall: do-uninstall done; \ ) @-rmdir "$(DESTDIR)$(moddir)" + @-rmdir "$(DESTDIR)$(basedir)" %.o: @srcdir@/%.cpp $(MKDEPS) $(INCFILES) $(COMPILE) -c $< diff --git a/modules/cdrbuild.cpp b/modules/cdrbuild.cpp index d50427f0..311bf71a 100644 --- a/modules/cdrbuild.cpp +++ b/modules/cdrbuild.cpp @@ -206,7 +206,8 @@ void CdrBuilder::update(const Message& msg, int type, u_int64_t val) m_ringing = val; break; case CdrAnswer: - m_answer = val; + if (!m_answer) + m_answer = val; break; case CdrHangup: m_hangup = val; diff --git a/modules/extmodule.cpp b/modules/extmodule.cpp index b84f226c..3eb13f1e 100644 --- a/modules/extmodule.cpp +++ b/modules/extmodule.cpp @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -580,7 +581,10 @@ bool ExtModReceiver::create(const char *script, const char *args) HANDLE yate2ext[2]; int x; if (script[0] != '/') { - tmp = s_cfg.getValue("general","scripts_dir","scripts/") + tmp; + tmp = s_cfg.getValue("general","scripts_dir",SCR_PATH); + if (!tmp.endsWith(Engine::pathSeparator())) + tmp += Engine::pathSeparator(); + tmp += script; } script = tmp.c_str(); if (::pipe(ext2yate)) { diff --git a/modules/skin/Makefile.in b/modules/skin/Makefile.in index 6962f2ce..043f0d53 100644 --- a/modules/skin/Makefile.in +++ b/modules/skin/Makefile.in @@ -10,9 +10,11 @@ DEBUG := SUBDIRS := gtk2 MKDEPS := ../../config.status +basedir = @libdir@/yate prefix = @prefix@ exec_prefix = @exec_prefix@ -skindir = @libdir@/yate/skin +moddir = $(basedir)/modules +skindir = $(moddir)/skin .PHONY: all clean install uninstall all clean: @@ -34,6 +36,8 @@ uninstall: rmdir "$(DESTDIR)$(skindir)/$$i" ; \ done; @-rmdir "$(DESTDIR)$(skindir)" + @-rmdir "$(DESTDIR)$(moddir)" + @-rmdir "$(DESTDIR)$(basedir)" Makefile: @srcdir@/Makefile.in $(MKDEPS) cd ../.. && ./config.status diff --git a/scripts/Makefile.in b/scripts/Makefile.in index e6314fae..3b96bdbf 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -7,26 +7,28 @@ DESTDIR := SCRIPTS := SCRLIBS := libyate.php libyatechan.php libyate.py Yate.pm +basedir = @libdir@/yate prefix = @prefix@ exec_prefix = @exec_prefix@ -moddir = @libdir@/yate +scrdir = $(basedir)/scripts .PHONY: all all: .PHONY: install install: - @mkdir -p "$(DESTDIR)$(moddir)/" && \ - install -m 0644 $(SCRLIBS) "$(DESTDIR)$(moddir)/" && \ + @mkdir -p "$(DESTDIR)$(scrdir)/" && \ + install -m 0644 $(SCRLIBS) "$(DESTDIR)$(scrdir)/" && \ test -z "$(SCRIPTS)" || \ - install $(SCRIPTS) "$(DESTDIR)$(moddir)/" + install $(SCRIPTS) "$(DESTDIR)$(scrdir)/" .PHONY: uninstall uninstall: @-for i in $(SCRIPTS) $(SCRLIBS) ; do \ - rm "$(DESTDIR)$(moddir)/$$i" ; \ - done; \ - rmdir "$(DESTDIR)$(moddir)" + rm "$(DESTDIR)$(scrdir)/$$i" ; \ + done; + @-rmdir "$(DESTDIR)$(scrdir)" + @-rmdir "$(DESTDIR)$(basedir)" Makefile: @srcdir@/Makefile.in ../config.status cd .. && ./config.status diff --git a/yate-config.in b/yate-config.in index f4640142..a727fb96 100644 --- a/yate-config.in +++ b/yate-config.in @@ -2,7 +2,8 @@ ustr='Usage: yate-config [--cflags] [--includes] [--c-all] [--ldflags] [--libs] [--ld-all] - [--config] [--modules] [--version]' + [--config] [--modules] [--scripts] [--skins] + [--version]' if [ "$#" = 0 ]; then echo "$ustr" exit 0 @@ -42,8 +43,14 @@ while [ "$#" != 0 ]; do --config) echo "$confdir" ;; + --skins) + echo "$moddir/modules/skins" + ;; --modules) - echo "$moddir" + echo "$moddir/modules" + ;; + --scripts) + echo "$moddir/scripts" ;; *) echo "I didn't understand: $1" >&2 diff --git a/yate.spec.in b/yate.spec.in index 0806e95f..e159cf4f 100644 --- a/yate.spec.in +++ b/yate.spec.in @@ -34,7 +34,10 @@ for small to large scale projects. /usr/share/man/*/yate.* /etc/rc.d/init.d/yate %dir /usr/lib/yate -/usr/lib/yate/*.* +%dir /usr/lib/yate/modules +/usr/lib/yate/modules/*.* +%dir /usr/lib/yate/scripts +/usr/lib/yate/scripts/*.* %post ldconfig @@ -53,10 +56,10 @@ The yate-client package includes the files needed to use YATE as a VoIP client %files client %defattr(-, root, root) /usr/bin/yate-gtk2 -%dir /usr/lib/yate/skin -/usr/lib/yate/skin/* -%dir /usr/lib/yate/gtk2 -/usr/lib/yate/gtk2/* +%dir /usr/lib/yate/modules/skin +/usr/lib/yate/modules/skin/* +%dir /usr/lib/yate/modules/gtk2 +/usr/lib/yate/modules/gtk2/* %package devel Summary: Development package for yate @@ -116,6 +119,10 @@ cp -p %{_builddir}/%{name}/yate.init %{buildroot}/etc/rc.d/init.d/yate rm -rf %{buildroot} %changelog +* Mon Nov 07 2005 Paul Chitescu +- Version 0.9.0-pre4 +- Separated modules and scripts directories + * Mon Oct 24 2005 Paul Chitescu - Version 0.9.0-pre3 - Changed obsolete Copyright: tag to License: to keep newer RPMs happy