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

5
Last change on this file since db2c683 was db2c683, checked in by Chris Johns <chrisj@…>, on Oct 29, 2019 at 4:27:17 AM

Update to support RTEMS 5

  • Property mode set to 100755
File size: 5.0 KB
Line 
1#! /bin/sh
2#
3# RTEMS Tools Project (http://www.rtems.org/)
4# Copyright 2015,2016,2019 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#
35. ${release_top}/rtems-release-version
36echo "RTEMS Documentation Release builder, v${rtems_release_version}"
37
38#
39# Defaults.
40#
41. ${release_top}/rtems-release-defaults
42
43#
44# Only build if sphinx-build is present on the system.
45#
46if [ "`command -v sphinx-build`"no = no ]; then
47 echo "warning: documentation not built"
48 exit 0
49fi
50
51#
52# Common package start.
53#
54. ./rtems-release-package-start
55
56#
57# The workspace pwd
58#
59ws_pwd=${PWD}
60
61#
62# Get the documentation, create the tarball and stamp.
63#
64echo "git clone ${git_remote} ${git_local}"
65git clone ${git_remote} ${git_local}
66
67cd ${git_local}
68 echo "git fetch origin"
69 git fetch origin
70 # Get the remote branch. If the release branch is not found use master.
71 remote_branch=$(git branch --remote | grep ${version} | tr -d "[:space:]")
72 if [ -z "${remote_branch}" ]; then
73  remote_branch="master"
74 fi
75 echo "git archive --format=tar --prefix=${prefix}/ ${remote_branch}"
76 git archive --format=tar --prefix=${prefix}/ ${remote_branch} | \
77     ${comp} > ../${prefix}-unstamped.tar.${comp_ext}
78 cd ..
79
80#
81# Stamp the source and package
82#
83echo "tar ${comp_tar}xf ../${prefix}-unstamped.tar.${comp_ext}"
84tar ${comp_tar}xf ${prefix}-unstamped.tar.${comp_ext}
85
86cd ${prefix}
87 #
88 # This is a hack until I add support for the VERSION file created below.
89 #
90 echo "Creating VERSION: ${release}"
91 if [ ${version} -le 5 ]; then
92   cat wscript | sed -e "s/^version[[:space:]].*=.*$/version = '${release}'/g" > wscript.tmp
93   rm -f wscript
94   mv wscript.tmp wscript
95 else
96  echo "[version]" > VERSION
97  echo "revision = ${release}" >> VERSION
98  d=$(date +%e)
99  case $d in
100   1?) d=${d}th ;;
101   *1) d=${d}st ;;
102   *2) d=${d}nd ;;
103   *3) d=${d}rd ;;
104   *)  d=${d}th ;;
105  esac
106  now=$(date +"%d${d} %B %Y")
107  echo "date = %{now}" >> VERSION
108 fi
109 cd ..
110
111echo "tar cf - ${prefix}"
112tar cf - ${prefix} | ${comp} > ../${prefix}.tar.${comp_ext}
113
114echo "Created: ${release}/${prefix}.tar.${comp_ext}"
115
116#
117# Build the docs.
118#
119mkdir install
120cd ${prefix}
121 ./waf distclean configure --prefix=../install/${prefix} --pdf --singlehtml
122 ./waf build install
123 cd ..
124
125#
126# Package the docs, PDF first.
127#
128mkdir ${top}/${release}/docs
129cd install
130 echo "Creating DOC all rtems-${release}-docs-all.tar.${comp_ext}"
131 tar cf - * | ${comp} > ${top}/${release}/docs/rtems-${release}-docs-all.tar.${comp_ext}
132 for p in $(find . -name \*.pdf)
133 do
134  manual=$(echo $(basename $p) | sed -e "s/\\..*//")
135  base=$(dirname $p)
136  #
137  # Compress the PDF and move it out of the way.
138  #
139  echo "Creating PDF rtems-${release}-${manual}.pdf.${comp_ext}"
140  ${comp} $p
141  mv $p.${comp_ext} ${top}/${release}/docs/rtems-${release}-${manual}.pdf.${comp_ext}
142  #
143  # Create the single html manual
144  #
145  echo "Creating SingleHTML rtems-${release}-${manual}.html.${comp_ext}"
146  mv ${base}/${manual}.html ${base}/rtems-${release}-${manual}.html
147  ${comp} ${base}/rtems-${release}-${manual}.html
148  mv ${base}/rtems-${release}-${manual}.html.${comp_ext} ${top}/${release}/docs/.
149  #
150  # Tar the multi-page html and install.
151  #
152  echo "Creating HTML rtems-${release}-${manual}-html.tar.${comp_ext}"
153  tar cf - ${base}/${manual} | \
154      ${comp} > ${top}/${release}/docs/rtems-${release}-${manual}-html.tar.${comp_ext}
155 done
156 cd ..
157
158#
159# Comman package end.
160#
161. ${top}/rtems-release-package-end
162
163cd ${release}/docs
164 rm -f ${checksum}sum.txt
165 for f in $(ls -1)
166 do
167  if [ ! -d ${f} ]; then
168   csum=$(${checksum} -q ${f})
169   echo "${csum} ${f}" >> ${checksum}sum.txt
170  fi
171 done
172 cd ..
173
174echo "Created: ${release}/docs/${checksum}sum.txt"
175echo "Created: ${release}/docs"
176
177exit 0
Note: See TracBrowser for help on using the repository browser.