summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/docs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-23 00:42:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:32 -0500
commitc09f6050f719e48cdd18fc405a21d74711026235 (patch)
tree645ed90a549b55bac65d068bb7fa7e4ace84f132 /source4/lib/ldb/docs
parent8e36c42846352957a66745c267d3714831e2ab73 (diff)
downloadsamba-c09f6050f719e48cdd18fc405a21d74711026235.tar.gz
samba-c09f6050f719e48cdd18fc405a21d74711026235.tar.bz2
samba-c09f6050f719e48cdd18fc405a21d74711026235.zip
r17729: remove the dependence on an internet connection for building
standalone ldb by only running xsltproc if we can find a local copy of the required stylesheets (This used to be commit 16be09e0d6bd2c9c21f9cf0291dabf661a9a3797)
Diffstat (limited to 'source4/lib/ldb/docs')
-rwxr-xr-xsource4/lib/ldb/docs/builddocs.sh62
-rwxr-xr-xsource4/lib/ldb/docs/installdocs.sh17
2 files changed, 79 insertions, 0 deletions
diff --git a/source4/lib/ldb/docs/builddocs.sh b/source4/lib/ldb/docs/builddocs.sh
new file mode 100755
index 0000000000..2842a7fb68
--- /dev/null
+++ b/source4/lib/ldb/docs/builddocs.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+# build ldb docs
+# tridge@samba.org August 2006
+
+XSLTPROC="$1"
+SRCDIR="$2"
+
+if ! test -x "$XSLTPROC"; then
+ echo "xsltproc not installed"
+ exit 0
+fi
+
+# list of places to look for the docbook style sheet
+manxsl=/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
+
+# list of places to look for the html style sheet
+htmlxsl=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl
+
+manstyle=""
+htmlstyle=""
+
+for f in $manxsl; do
+ if [ -r "$f" ]; then
+ manstyle="$f"
+ fi
+done
+
+if [ -z "$manstyle" ]; then
+ echo "manpages/docbook.xsl not found on system"
+ exit 0
+fi
+
+for f in $htmlxsl; do
+ if [ -r "$f" ]; then
+ htmlstyle="$f"
+ fi
+done
+
+if [ -z "$htmlstyle" ]; then
+ echo "html/docbook.xsl not found on system"
+ exit 0
+fi
+
+mkdir -p man html
+
+for f in $SRCDIR/man/*.xml; do
+ base=`basename $f .xml`
+ out=man/"`basename $base`"
+ if [ ! -f "$out" ] || [ "$base" -nt "$out" ]; then
+ echo Processing manpage $f
+ $XSLTPROC -o "$out" "$manstyle" $f || exit 1
+ fi
+done
+
+for f in $SRCDIR/man/*.xml; do
+ base=`basename $f .xml`
+ out=man/"`basename $base`".html
+ if [ ! -f "$out" ] || [ "$base" -nt "$out" ]; then
+ echo Processing html $f
+ $XSLTPROC -o "$out" "$htmlstyle" $f || exit 1
+ fi
+done
diff --git a/source4/lib/ldb/docs/installdocs.sh b/source4/lib/ldb/docs/installdocs.sh
new file mode 100755
index 0000000000..6cc7b74ad5
--- /dev/null
+++ b/source4/lib/ldb/docs/installdocs.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# install ldb docs
+# tridge@samba.org August 2006
+
+MANDIR="$1"
+
+MAN1="`/bin/ls man/*.1`"
+MAN3="`/bin/ls man/*.3`"
+
+if [ -z "$MAN1" ] && [ -z "$MAN3" ]; then
+ echo "No manpages have been built"
+ exit 0
+fi
+
+mkdir -p "$MANDIR/man1" "$MANDIR/man3"
+cp $MAN1 "$MANDIR/man1/" || exit 1
+cp $MAN3 "$MANDIR/man3/" || exit 1