[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
proposal for fdl module
From: |
Eric Blake |
Subject: |
proposal for fdl module |
Date: |
Mon, 10 Jul 2006 18:21:36 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
In the m4 project, I wanted to update the documentation to include the FDL in
an appendix. gnulib contains doc/fdl.texi, but did not have any easy way to
import it over to m4. Would this patch be acceptable to allow documentation to
be pulled in as separate modules? It would also be beneficial to the getdate
module, which references doc/getdate.texi, by adding handling for a doc
directory.
2006-07-10 Eric Blake <address@hidden>
* gnulib-tool: Avoid space-tab.
(--doc-base): Add new option, for where .texi files should live.
* modules/fdl: New module, for grabbing fdl.texi.
Index: gnulib-tool
===================================================================
RCS file: /sources/gnulib/gnulib/gnulib-tool,v
retrieving revision 1.114
diff -u -r1.114 gnulib-tool
--- gnulib-tool 9 Jul 2006 03:31:53 -0000 1.114
+++ gnulib-tool 10 Jul 2006 18:03:20 -0000
@@ -114,6 +114,8 @@
--tests-base=DIRECTORY
Directory relative --dir where unit tests are
placed (default \"tests\"), for --import.
+ --doc-base=DIRECTORY Directory relative --dir where documentation
+ files are placed (default \"doc\").
--aux-dir=DIRECTORY Directory relative --dir where auxiliary build
tools are placed (default \"build-aux\").
--with-tests Include unit tests for the included modules.
@@ -239,6 +241,7 @@
# - sourcebase from --source-base
# - m4base from --m4-base
# - testsbase from --tests-base
+# - docbase from --doc-base
# - auxdir from --aux-dir
# - inctests true if --with-tests was given, blank otherwise
# - avoidlist list of modules to avoid, from --avoid
@@ -254,6 +257,7 @@
sourcebase=
m4base=
testsbase=
+ docbase=
auxdir=
inctests=
avoidlist=
@@ -344,6 +348,16 @@
--tests-base=* )
testsbase=`echo "X$1" | sed -e 's/^X--tests-base=//'`
shift ;;
+ --doc-base )
+ shift
+ if test $# = 0; then
+ func_fatal_error "missing argument for --doc-base"
+ fi
+ docbase=$1
+ shift ;;
+ --doc-base=* )
+ docbase=`echo "X$1" | sed -e 's/^X--doc-base=//'`
+ shift ;;
--aux-dir )
shift
if test $# = 0; then
@@ -421,6 +435,7 @@
fi
if test -n "$supplied_libname" || test -n "$sourcebase" || test -
n "$m4base" \
|| test -n "$testsbase" || test -n "$auxdir" || test -n "$inctests" \
+ || test -n "$docbase" \
|| test -n "$avoidlist" || test -n "$lgpl" || test -n "$macro_prefix";
then
echo "gnulib-tool: invalid options for 'update' mode" 1>&2
echo "Try 'gnulib-tool --help' for more information." 1>&2
@@ -443,6 +458,9 @@
case "$testsbase" in
*/ ) testsbase=`echo "$testsbase" | sed -e "$sed_trimtrailingslashes"` ;;
esac
+ case "$docbase" in
+ */ ) docbase=`echo "$docbase" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
case "$auxdir" in
*/ ) auxdir=`echo "$auxdir" | sed -e "$sed_trimtrailingslashes"` ;;
esac
@@ -520,17 +538,17 @@
esac
}
-sed_extract_prog=':[ ]*$/ {
+sed_extract_prog=':[ ]*$/ {
:a
n
- s/^Description:[ ]*$//
- s/^Files:[ ]*$//
- s/^Depends-on:[ ]*$//
- s/^configure\.ac:[ ]*$//
- s/^Makefile\.am:[ ]*$//
- s/^Include:[ ]*$//
- s/^License:[ ]*$//
- s/^Maintainer:[ ]*$//
+ s/^Description:[ ]*$//
+ s/^Files:[ ]*$//
+ s/^Depends-on:[ ]*$//
+ s/^configure\.ac:[ ]*$//
+ s/^Makefile\.am:[ ]*$//
+ s/^Include:[ ]*$//
+ s/^License:[ ]*$//
+ s/^Maintainer:[ ]*$//
tb
p
ba
@@ -683,7 +701,7 @@
func_verify_nontests_module
if test -n "$module"; then
# Extract the value of "lib_SOURCES += ...".
- for file in `func_get_automake_snippet "$module" | sed -
e "$sed_remove_backslash_newline" | sed -n -e 's,^lib_SOURCES[ ]*+=\([^#]
*\).*$,\1,p'`; do
+ for file in `func_get_automake_snippet "$module" | sed -
e "$sed_remove_backslash_newline" | sed -n -e 's,^lib_SOURCES[ ]*+=\([^#]
*\).*$,\1,p'`; do
# Ignore .h files since they are not compiled.
case "$file" in
*.h) ;;
@@ -767,7 +785,7 @@
fi
} > amsnippet.tmp
# Skip the contents if its entirely empty.
- if grep '[^ ]' amsnippet.tmp > /dev/null ; then
+ if grep '[^ ]' amsnippet.tmp > /dev/null ; then
echo "## begin gnulib module $module"
echo
cat amsnippet.tmp
@@ -844,7 +862,7 @@
if test -n "$module"; then
func_get_automake_snippet "$module" > amsnippet.tmp
# Skip the contents if its entirely empty.
- if grep '[^ ]' amsnippet.tmp > /dev/null ; then
+ if grep '[^ ]' amsnippet.tmp > /dev/null ; then
echo "## begin gnulib module $module"
echo
cat amsnippet.tmp
@@ -876,6 +894,7 @@
# - sourcebase directory relative to destdir where to place source code
# - m4base directory relative to destdir where to place *.m4 macros
# - testsbase directory relative to destdir where to place unit test code
+# - docbase directory relative to destdir where to place doc files
# - auxdir directory relative to destdir where to place build aux
files
# - inctests true if --with-tests was given, blank otherwise
# - avoidlist list of modules to avoid, from --avoid
@@ -893,6 +912,7 @@
cached_sourcebase=
cached_m4base=
cached_testsbase=
+ cached_docbase=
cached_libname=
cached_lgpl=
cached_libtool=
@@ -918,6 +938,9 @@
/gl_TESTS_BASE(/ {
s,^.*gl_TESTS_BASE([[ ]*\([^])]*\).*$,cached_testsbase="\1",p
}
+ /gl_DOC_BASE(/ {
+ s,^.*gl_DOC_BASE([[ ]*\([^])]*\).*$,cached_docbase="\1",p
+ }
/gl_LIB(/ {
s,^.*gl_LIB([[ ]*\([^])]*\).*$,cached_libname="\1",p
}
@@ -978,6 +1001,13 @@
func_fatal_error "missing --tests-base option"
fi
fi
+ # The docbase defaults to the cached one.
+ if test -z "$docbase"; then
+ docbase="$cached_docbase"
+ if test -z "$docbase"; then
+ func_fatal_error "missing --doc-base option"
+ fi
+ fi
# The libname defaults to the cached one.
if test -z "$supplied_libname"; then
libname="$cached_libname"
@@ -1070,6 +1100,14 @@
fi
fi
fi
+ if test ! -d "$destdir/$docbase"; then
+ if $doit; then
+ echo "Creating directory $destdir/$docbase"
+ mkdir "$destdir/$docbase" || func_fatal_error "failed"
+ else
+ echo "Create directory $destdir/$docbase"
+ fi
+ fi
if test ! -d "$destdir/$auxdir"; then
if $doit; then
echo "Creating directory $destdir/$auxdir"
@@ -1103,6 +1141,7 @@
for f in $old_files; do
case "$f" in
build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
+ doc/*) g=`echo "$f" | sed -e "s,^doc/,$cached_docbase/,"` ;;
lib/*) g=`echo "$f" | sed -e "s,^lib/,$cached_sourcebase/,"` ;;
m4/*) g=`echo "$f" | sed -e "s,^m4/,$cached_m4base/,"` ;;
tests/*) g=`echo "$f" | sed -e "s,^tests/,$cached_testsbase/,"` ;;
@@ -1113,6 +1152,7 @@
for f in $new_files; do
case "$f" in
build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
+ doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
@@ -1198,6 +1238,7 @@
for f in `LC_ALL=C join -t"$delimiter" -v2 "$tmp"/old-files "$tmp"/new-files
| sed -e "$sed_take_last_column"`; do
case "$f" in
build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
+ doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
@@ -1210,6 +1251,7 @@
for f in `LC_ALL=C join -t"$delimiter" "$tmp"/old-files "$tmp"/new-files |
sed -e "$sed_take_last_column"`; do
case "$f" in
build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
+ doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
@@ -1224,6 +1266,7 @@
actioncmd="$actioncmd --lib=$libname"
actioncmd="$actioncmd --source-base=$sourcebase"
actioncmd="$actioncmd --m4-base=$m4base"
+ actioncmd="$actioncmd --doc-base=$docbase"
actioncmd="$actioncmd --aux-dir=$auxdir"
for module in $avoidlist; do
actioncmd="$actioncmd --avoid=$module"
@@ -1283,6 +1326,7 @@
echo "gl_SOURCE_BASE([$sourcebase])"
echo "gl_M4_BASE([$m4base])"
echo "gl_TESTS_BASE([$testsbase])"
+ echo "gl_DOC_BASE([$docbase])"
echo "gl_LIB([$libname])"
test -z "$lgpl" || echo "gl_LGPL"
test -z "$libtool" || echo "gl_LIBTOOL"
@@ -1863,6 +1907,7 @@
test -n "$supplied_libname" || supplied_libname=true
test -n "$sourcebase" || sourcebase="lib"
test -n "$testsbase" || testsbase="tests"
+ test -n "$docbase" || docbase="doc"
test -n "$macro_prefix" || macro_prefix="gl"
fi
func_import "$*"
@@ -1871,7 +1916,7 @@
# To get this list of directories, look at Makefile.am. (Not at
# configure, because it may be omitted from CVS. Also, don't run
# "find $destdir -name gnulib-cache.m4", as it might be too expensive.)
- aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]
*=' "$destdir"/Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
+ aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am |
sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
m4dirs=
m4dirs_count=0
m4dir_is_next=
@@ -1902,6 +1947,7 @@
test -n "$sourcebase" || sourcebase="lib"
m4base="m4"
test -n "$testsbase" || testsbase="tests"
+ test -n "$docbase" || docbase="doc"
test -n "$macro_prefix" || macro_prefix="gl"
func_import "$*"
else
Index: modules/fdl
===================================================================
RCS file: modules/fdl
diff -N modules/fdl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/fdl 10 Jul 2006 18:03:21 -0000
@@ -0,0 +1,19 @@
+Description:
+Provide the Free Documentation License.
+
+Files:
+doc/fdl.texi
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+
+License:
+GPL
+
+Maintainer:
+all
- proposal for fdl module,
Eric Blake <=