add script to build only the manpages (not the complete docs) - no-git version
[sfrench/samba-autobuild/.git] / release-scripts / build-manpages-nogit
1 #!/bin/sh
2 #
3 # Copyright (C) Michael Adam 2010
4
5 _exit() {
6         echo $@
7         popd
8         exit 1
9 }
10
11 DIRNAME=$(dirname $0)
12 DOCS_XML_DIR=${DIRNAME}/../docs-xml
13 DOCS_DIR=${DIRNAME}/../docs
14
15 pushd ${DOCS_XML_DIR} || exit 1
16
17 #git clean -xdf || _exit "Error running git clean."
18
19 autoconf || _exit "Error running autoconf."
20
21 ./configure || _exit "Error running configure."
22
23 # enable offline build by creating catalog:
24 cat $(pwd)/build/catalog.xml.in \
25         | sed -e "s|@BUILDDIR@|$(pwd)|g" \
26         > $(pwd)/build/catalog.xml
27
28 export XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml"
29
30 make clean || _exit "Error running make clean"
31
32 # re-establish catalog (has been removed by make clean...)
33 cat $(pwd)/build/catalog.xml.in \
34         | sed -e "s|@BUILDDIR@|$(pwd)|g" \
35         > $(pwd)/build/catalog.xml
36
37 make manpages3 || _exit "Error running make manpages3"
38
39 popd
40
41 test -e ${DOCS_DIR}/manpages && rm -rf ${DOCS_DIR}/manpages
42 mkdir -p ${DOCS_DIR}/manpages
43
44 rsync -Ca ${DOCS_XML_DIR}/output/manpages-3/ ${DOCS_DIR}/manpages
45
46 echo "Success"
47 exit
48
49 # END