[asterisk-addons-commits] eliel: trunk r685 - in /trunk: ./ build_tools/

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Thu Nov 6 11:44:05 CST 2008


Author: eliel
Date: Thu Nov  6 11:44:05 2008
New Revision: 685

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=685
Log:
Introduce the install process for the XML documentation.
One target (validate-docs) was added to check if the generated
xml (addons-en_US.xml) is valid.

Added:
    trunk/build_tools/get_documentation   (with props)
Modified:
    trunk/Makefile
    trunk/configure
    trunk/configure.ac
    trunk/makeopts.in

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk-addons/trunk/Makefile?view=diff&rev=685&r1=684&r2=685
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Nov  6 11:44:05 2008
@@ -58,10 +58,20 @@
 ifeq ($(OSARCH),SunOS)
   ASTETCDIR=/var/etc/asterisk
   ASTLIBDIR=/opt/asterisk/lib
+  ASTVARLIBDIR=/var/opt/asterisk
 else
   ASTETCDIR=$(sysconfdir)/asterisk
   ASTLIBDIR=$(libdir)/asterisk
-endif
+ifneq ($(findstring BSD,$(OSARCH)),)
+  ASTVARLIBDIR=$(prefix)/share/asterisk
+else
+  ASTVARLIBDIR=$(localstatedir)/lib/asterisk
+endif
+endif
+ifeq ($(ASTDATADIR),)
+  ASTDATADIR:=$(ASTVARLIBDIR)
+endif
+
 MODULES_DIR=$(ASTLIBDIR)/modules
 
 #MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs tests main res $(LOCAL_MOD_SUBDIRS)
@@ -114,7 +124,7 @@
 	@echo " +               $(mK) install               +"  
 	@echo " +-------------------------------------------+"  
 
-_all: cleantest makeopts $(SUBDIRS)
+_all: cleantest makeopts $(SUBDIRS) doc/addons-en_US.xml
 
 makeopts: configure
 	@echo "****"
@@ -162,7 +172,7 @@
 	@echo "****"
 	@exit 1
 
-install: _all $(SUBDIRS_INSTALL)
+install: _all $(SUBDIRS_INSTALL) install-xmldoc 
 	@echo " +---- Asterisk-Addons Installation Complete ----+"
 	@echo " +                                               +"
 	@echo " +    Addons has successfully been installed.    +"
@@ -172,6 +182,10 @@
 	@echo " +                                               +"
 	@echo " +               $(MAKE) samples                    +"
 	@echo " +-----------------------------------------------+"
+
+install-xmldoc: doc/addons-en_US.xml
+	@echo "Installing XML documentation"
+	@$(INSTALL) -m 644 doc/addons-*.xml $(ASTDATADIR)/documentation
 
 cleantest:
 
@@ -218,6 +232,29 @@
 		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
 	done
 
+doc/addons-en_US.xml: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc))
+	@echo -n "Building Documentation For: "
+	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
+	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
+	@echo "<docs>" >> $@
+	@for x in $(MOD_SUBDIRS); do \
+		echo -n "$$x " ; \
+		for i in $$x/*.c; do \
+			$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
+		done ; \
+	done
+	@echo
+	@echo "</docs>" >> $@
+
+validate-docs: install-xmldoc 
+ifeq ($(XMLSTARLET),:)
+	@echo "---------------------------------------------------------------"
+	@echo "--- Please install xmlstarlet to validate the documentation ---"
+	@echo "---------------------------------------------------------------"
+else
+	@$(XMLSTARLET) val -E $(ASTDATADIR)/documentation/addons-en_US.xml 
+endif
+
 update:
 	@if [ -d .svn ]; then \
 		echo "Updating from Subversion..." ; \
@@ -292,4 +329,4 @@
 	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
 	@echo "</menu>" >> $@
 
-.PHONY: menuselect clean dist-clean distclean all cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS)
+.PHONY: menuselect clean dist-clean distclean all cleantest install-xmldoc uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS)

Added: trunk/build_tools/get_documentation
URL: http://svn.digium.com/view/asterisk-addons/trunk/build_tools/get_documentation?view=auto&rev=685
==============================================================================
--- trunk/build_tools/get_documentation (added)
+++ trunk/build_tools/get_documentation Thu Nov  6 11:44:05 2008
@@ -1,0 +1,3 @@
+/\/\*\*\* DOCUMENTATION/ {printit=1; next}
+/\*\*\*\// {if (printit) exit}
+// {if (printit) print}

Propchange: trunk/build_tools/get_documentation
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/build_tools/get_documentation
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/build_tools/get_documentation
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk-addons/trunk/configure.ac?view=diff&rev=685&r1=684&r2=685
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Nov  6 11:44:05 2008
@@ -155,6 +155,7 @@
 AC_PATH_PROG([DIRNAME], [dirname], :)
 AC_PATH_PROG([SHELL], [sh], :)
 AC_PATH_PROG([LN], [ln], :)
+AC_PATH_PROG([XMLSTARLET], [xmlstarlet], :)
 
 AC_LANG(C)
 

Modified: trunk/makeopts.in
URL: http://svn.digium.com/view/asterisk-addons/trunk/makeopts.in?view=diff&rev=685&r1=684&r2=685
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Thu Nov  6 11:44:05 2008
@@ -50,3 +50,5 @@
 
 NCURSES_LIB=@NCURSES_LIB@
 NCURSES_INCLUDE=@NCURSES_INCLUDE@
+
+XMLSTARLET=@XMLSTARLET@




More information about the asterisk-addons-commits mailing list