summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/kscons_tdemdi/SConscript-doc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-26 13:18:13 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-26 13:18:13 -0600
commit2fb700f92bb787fab0845a63a541cd5640daa449 (patch)
treec6f769db55585dd47a9fd415a40ee8b86926f683 /languages/cpp/app_templates/kscons_tdemdi/SConscript-doc
parentfd1d1e1064eb09ddbbd67d3597c39856f5c0bc76 (diff)
downloadtdevelop-2fb700f92bb787fab0845a63a541cd5640daa449.tar.gz
tdevelop-2fb700f92bb787fab0845a63a541cd5640daa449.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'languages/cpp/app_templates/kscons_tdemdi/SConscript-doc')
-rw-r--r--languages/cpp/app_templates/kscons_tdemdi/SConscript-doc92
1 files changed, 92 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kscons_tdemdi/SConscript-doc b/languages/cpp/app_templates/kscons_tdemdi/SConscript-doc
new file mode 100644
index 00000000..0c3e07e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_tdemdi/SConscript-doc
@@ -0,0 +1,92 @@
+#! /usr/bin/env python
+## This script demonstrates to build and install
+## the documentation of a kde program with scons
+##
+## Thomas Nagy, 2005
+
+## This file can be reused freely for any project (see COPYING)
+
+## First load the environment set in the top-level SConstruct file
+Import( 'env' )
+myenv=env.Copy()
+
+## The following looks complicated but it is not
+## We first define a function to install all files as documentation
+## The documentation is of course lying in subfolders from here
+## * normal files are installed under TDEDOC/destination
+## * meinproc files are not installed, but processed into a single
+## index.cache.bz2 which is installed afterwards
+
+## This is far more maintainable to have *one* file than
+## having lots of almost empty SConscript in several folders
+
+###################################################################
+# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS
+###################################################################
+
+import os
+import sys
+import glob
+import SCons.Util
+
+## Define this to 1 if you are writing documentation else to 0 :)
+i_am_a_documentation_writer = 0
+
+## This function uses env imported above
+def processfolder(folder, lang, destination=""):
+ # folder is the folder to process
+ # lang is the language
+ # destination is the subdirectory in TDEDOC
+
+ docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :)
+
+ # warn about errors
+ #if len(lang) != 2:
+ # print "error, lang must be a two-letter string, like 'en'"
+
+ # when the destination is not given, use the folder
+ if len(destination) == 0:
+ destination=folder
+
+ docbook_list = []
+ for file in docfiles:
+
+ # do not process folders
+ if not os.path.isfile(file):
+ continue
+ # do not process the cache file
+ if file == 'index.cache.bz2':
+ continue
+ # ignore invalid files (TODO??)
+ if len( SCons.Util.splitext( file ) ) <= 1 :
+ continue
+
+ ext = SCons.Util.splitext( file )[1]
+
+ # docbook files are processed by meinproc
+ if ext == '.docbook':
+ docbook_list.append( file )
+ continue
+
+ myenv.TDEinstall('TDEDOC', lang+'/'+destination, file)
+
+ # Now process the index.docbook files ..
+ if len(docbook_list) == 0:
+ return
+ if not os.path.isfile( folder+'/index.docbook' ):
+ print "Error, index.docbook was not found in "+folder+'/index.docbook'
+ return
+ if i_am_a_documentation_writer:
+ for file in docbook_list:
+ myenv.Depends( folder+'index.cache.bz2', file )
+ myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' )
+ myenv.TDEinstall( 'TDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' )
+
+###################################################################
+# TELL WHICH FOLDERS TO PROCESS
+###################################################################
+
+## Use processfolder for each documentation directory
+processfolder('en/', 'en', '%{APPNAMELC}')
+processfolder('fr/', 'fr', '%{APPNAMELC}')
+