svn commit: samba r17729 - in branches/SAMBA_4_0/source/lib/ldb: . docs

tridge at samba.org tridge at samba.org
Wed Aug 23 00:42:34 GMT 2006


Author: tridge
Date: 2006-08-23 00:42:33 +0000 (Wed, 23 Aug 2006)
New Revision: 17729

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17729

Log:

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

Added:
   branches/SAMBA_4_0/source/lib/ldb/docs/builddocs.sh
   branches/SAMBA_4_0/source/lib/ldb/docs/installdocs.sh
Modified:
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2006-08-23 00:39:07 UTC (rev 17728)
+++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in	2006-08-23 00:42:33 UTC (rev 17729)
@@ -57,13 +57,11 @@
 
 LIBS = $(LDB_LIB)($(OBJS))
 
-MANPAGES = $(patsubst %.xml,%,$(wildcard $(srcdir)/man/*.xml))
-
 EXAMPLES = examples/ldbreader examples/ldifreader
 
 DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
 
-all: dirs $(OBJS) $(BINS) $(LIBS) $(EXAMPLES) $(MANPAGES) doxygen
+all: dirs $(OBJS) $(BINS) $(LIBS) $(EXAMPLES) manpages doxygen
 
 .c.o:
 	@echo Compiling $*.c
@@ -107,22 +105,16 @@
 
 .SUFFIXES: .1 .1.xml .3 .3.xml .xml .html
 
-%.3: %.3.xml
-	test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+manpages:
+	$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
 
-%.1: %.1.xml
-	test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
-
-%.html: %.xml
-	test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
-
 doxygen:
 	test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
 
 clean:
 	rm -f */*.o *.gcov */*.gc?? tdbtest.ldb* \
 	rm -f $(BINS) $(TDB_OBJ) $(TALLOC_OBJ) $(LDB_LIB)
-	rm -f $(MANPAGES)
+	rm -f man/*.1 man/*.3 man/*.html
 	rm -f $(EXAMPLES)
 	rm -rf apidocs/
 
@@ -135,9 +127,6 @@
 	rm -f ldb.pc
 	rm -f Makefile
 
-etags:
-	etags */*.[ch]
-
 installcheck: install tests
 	for t in $(TESTS); do echo STARTING $${t}; $(srcdir)/tests/$${t} || exit 1; done
 
@@ -145,13 +134,11 @@
 
 install: all
 	mkdir -p $(includedir) $(libdir)/pkgconfig $(libdir) $(bindir)
-	mkdir -p $(mandir) $(mandir)/man3 $(mandir)/man1
 	cp $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(includedir)
 	cp $(LDB_LIB) $(libdir)
 	cp $(BINS) $(bindir)
 	cp ldb.pc $(libdir)/pkgconfig
-	test -z "$(XSLTPROC)" || cp $(filter %.1, $(MANPAGES)) $(mandir)/man1
-	test -z "$(XSLTPROC)" || cp $(filter %.3, $(MANPAGES)) $(mandir)/man3
+	$(srcdir)/docs/installdocs.sh $(mandir)
 
 gcov:
 	$(GCOV) -po ldb_sqlite3 $(srcdir)/ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
@@ -161,5 +148,8 @@
 	$(GCOV) -po modules $(srcdir)/modules/*.c 2| tee modules.report.gcov
 	$(GCOV) -po tools $(srcdir)/tools/*.c 2| tee tools.report.gcov
 
+etags:
+	etags `find $(srcdir) -name "*.[ch]"`
+
 ctags:
 	ctags `find $(srcdir) -name "*.[ch]"`

Added: branches/SAMBA_4_0/source/lib/ldb/docs/builddocs.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/docs/builddocs.sh	2006-08-23 00:39:07 UTC (rev 17728)
+++ branches/SAMBA_4_0/source/lib/ldb/docs/builddocs.sh	2006-08-23 00:42:33 UTC (rev 17729)
@@ -0,0 +1,62 @@
+#!/bin/sh
+# build ldb docs
+# tridge at 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


Property changes on: branches/SAMBA_4_0/source/lib/ldb/docs/builddocs.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/SAMBA_4_0/source/lib/ldb/docs/installdocs.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/docs/installdocs.sh	2006-08-23 00:39:07 UTC (rev 17728)
+++ branches/SAMBA_4_0/source/lib/ldb/docs/installdocs.sh	2006-08-23 00:42:33 UTC (rev 17729)
@@ -0,0 +1,17 @@
+#!/bin/sh
+# install ldb docs
+# tridge at 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


Property changes on: branches/SAMBA_4_0/source/lib/ldb/docs/installdocs.sh
___________________________________________________________________
Name: svn:executable
   + *



More information about the samba-cvs mailing list