source: rtems-release/rtems-release-docs @ bcd2dd3

5
Last change on this file since bcd2dd3 was bcd2dd3, checked in by Chris Johns <chrisj@…>, on Apr 12, 2017 at 12:54:02 AM

Use defaults for compress.

The threading option is added to the XZ command.

  • Property mode set to 100755
File size: 4.4 KB
Line 
1#! /bin/sh
2#
3# RTEMS Tools Project (http://www.rtems.org/)
4# Copyright 2015-2016 Chris Johns (chrisj@rtems.org)
5# All rights reserved.
6#
7# This file is part of the RTEMS Tools package in 'rtems-tools'.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are met:
11#
12# 1. Redistributions of source code must retain the above copyright notice,
13# this list of conditions and the following disclaimer.
14#
15# 2. Redistributions in binary form must reproduce the above copyright notice,
16# this list of conditions and the following disclaimer in the documentation
17# and/or other materials provided with the distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32#
33# This worker script to build the doco.
34#
35echo "RTEMS Documentation Release builder, v0.1"
36
37#
38# Defaults.
39#
40. ${release_top}/rtems-release-defaults
41
42#
43# Only build if sphinx-build is present on the system.
44#
45if [ "`command -v sphinx-build`"no = no ]; then
46 echo "warning: documentation not built"
47 exit 0
48fi
49
50#
51# Common package start.
52#
53. ./rtems-release-package-start
54
55#
56# The workspace pwd
57#
58ws_pwd=${PWD}
59
60#
61# Get the documentation, create the tarball and stamp.
62#
63echo "git clone ${git_remote} ${git_local}"
64git clone ${git_remote} ${git_local}
65
66cd ${git_local}
67 echo "git fetch origin"
68 git fetch origin
69 echo "git archive --format=tar --prefix=${prefix}/ origin/${version}"
70 git archive --format=tar --prefix=${prefix}/ origin/${version} | \
71     ${comp} > ../${prefix}-unstamped.tar.${comp_ext}
72 cd ..
73
74#
75# Stamp the source and package
76#
77echo "tar ${comp_tar}xf ../${prefix}-unstamped.tar.${comp_ext}"
78tar ${comp_tar}xf ${prefix}-unstamped.tar.${comp_ext}
79
80cd ${prefix}
81 #
82 # This is a hack until I add support for the VERSION file created below.
83 #
84 cat wscript | sed -e "s/^version[[:space:]].*=.*$/version = '${release}'/g" > wscript.tmp
85 rm -f wscript
86 mv wscript.tmp wscript
87 echo "Creating VERSION: ${release}"
88 echo "[version]" > VERSION
89 echo "release = ${release}" >> VERSION
90 cd ..
91
92echo "tar cf - ${prefix}"
93tar cf - ${prefix} | ${comp} > ../${prefix}.tar.${comp_ext}
94
95echo "Created: ${release}/${prefix}.tar.${comp_ext}"
96
97#
98# Build the docs.
99#
100mkdir install
101cd ${prefix}
102 ./waf distclean configure --prefix=../install/${prefix} --pdf --singlehtml
103 ./waf build install
104 cd ..
105
106#
107# Package the docs, PDF first.
108#
109mkdir ${top}/${release}/docs
110cd install
111 echo "Creating DOC all rtems-${release}-docs-all.tar.${comp_ext}"
112 tar cf - * | ${comp} > ${top}/${release}/docs/rtems-${release}-docs-all.tar.${comp_ext}
113 for p in $(find . -name \*.pdf)
114 do
115  manual=$(echo $(basename $p) | sed -e "s/\\..*//")
116  base=$(dirname $p)
117  #
118  # Compress the PDF and move it out of the way.
119  #
120  echo "Creating PDF rtems-${release}-${manual}.pdf.${comp_ext}"
121  ${comp} $p
122  mv $p.${comp_ext} ${top}/${release}/docs/rtems-${release}-${manual}.pdf.${comp_ext}
123  #
124  # Create the single html manual
125  #
126  echo "Creating SingleHTML rtems-${release}-${manual}.html.${comp_ext}"
127  mv ${base}/${manual}.html ${base}/rtems-${release}-${manual}.html
128  ${comp} ${base}/rtems-${release}-${manual}.html
129  mv ${base}/rtems-${release}-${manual}.html.${comp_ext} ${top}/${release}/docs/.
130  #
131  # Tar the multi-page html and install.
132  #
133  echo "Creating HTML rtems-${release}-${manual}-html.tar.${comp_ext}"
134  tar cf - ${base}/${manual} | \
135      ${comp} > ${top}/${release}/docs/rtems-${release}-${manual}-html.tar.${comp_ext}
136 done
137 cd ..
138
139#
140# Comman package end.
141#
142. ${top}/rtems-release-package-end
143
144cd ${release}/docs
145 rm -f ${checksum}sum.txt
146 for f in $(ls -1)
147 do
148  if [ ! -d ${f} ]; then
149   csum=$(${checksum} -q ${f})
150   echo "${csum} ${f}" >> ${checksum}sum.txt
151  fi
152 done
153 cd ..
154
155echo "Created: ${release}/docs/${checksum}sum.txt"
156echo "Created: ${release}/docs"
157
158exit 0
Note: See TracBrowser for help on using the repository browser.