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

5
Last change on this file since db2c683 was db2c683, checked in by Chris Johns <chrisj@…>, on 10/29/19 at 04:27:17

Update to support RTEMS 5

  • Property mode set to 100755
File size: 3.9 KB
Line 
1#! /bin/sh
2#
3# RTEMS Tools Project (http://www.rtems.org/)
4# Copyright 2017 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 Release Notes builder, v${rtems_release_version}"
37
38#
39# Defaults.
40#
41. ${release_top}/rtems-release-defaults
42
43#
44# Only build if wkhtmltopdf is present on the system.
45#
46if [ "`command -v wkhtmltopdf`"no = no ]; then
47 echo "warning: release notes not built: no wkhtmltopdf"
48 exit 0
49fi
50
51#
52# Only build if gs is present on the system.
53#
54if [ "`command -v gs`"no = no ]; then
55 echo "warning: release notes not built: no gs"
56 exit 0
57fi
58
59#
60# Common package start. No git repo the data source is Trac.
61#
62rtems_git_repo=no
63. ./rtems-release-package-start
64
65#
66# The workspace pwd
67#
68ws_pwd=${PWD}
69
70#
71# The release notes are all held in the wiki
72#
73release_pages="https://devel.rtems.org/wiki/Release/"
74
75#
76# Set up the wkhtmltopdf defaults.
77#
78page_options="--print-media-type --zoom 0.8"
79header="--header-right [page]/[toPage] --header-font-size 10"
80footer="--footer-left [webpage] --footer-font-size 10"
81
82echo "Creating release notes"
83
84rel_html=""
85rel_html_line="<div>@RELEASE@</div>"
86rev=0
87while [ ${rev} -le ${revision_no} ]
88do
89  rel=${version}.${rev}
90  rel_html="$(echo ${rel_html_line} | sed -e "s/@RELEASE@/${rel}/g")${rel_html}"
91  rev=$(expr ${rev} + 1)
92done
93rel_html=$(echo ${rel_html} | sed -e 's/\./\\\./g' -e  's/\//\\\//g')
94
95echo "Create the coverpage"
96cp ${top}/rtems-release-notes-coverpage/* .
97cat rtems-release-notes-coverpage.html.in | \
98    sed -e "s/@RELEASE@/${release}/g" \
99        -e "s/@VERSION@/${version}/g" \
100        -e "s/@REVISION@/${revision}/g" \
101        -e "s/@DATE@/${now}/g" \
102        -e "s/@REVISIONS@/${rel_html}/g" > rtems-release-notes-coverpage.html
103wkhtmltopdf file://${ws_pwd}/rtems-release-notes-coverpage.html \
104            --disable-smart-shrinking \
105            ${page_options} \
106            --no-header-line \
107            --no-footer-line cp.pdf
108
109pdfs=""
110rev=0
111while [ ${rev} -le ${revision_no} ]
112do
113  rel=${version}.${rev}
114  echo "Creating the ${rel} PDF"
115  wkhtmltopdf --user-style-sheet file://${ws_pwd}/trac-rtems-style.html \
116              -L 5mm -R 5mm \
117              ${release_pages}/${version}/${version}.${rev} \
118              ${page_options} \
119              --header-left "RTEMS ${rel} Release Notes" ${header} \
120              ${footer} \
121              p${rev}.pdf
122  pdfs="p${rev}.pdf ${pdfs}"
123  rev=$(expr ${rev} + 1)
124done
125
126gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=../rtems-${release}-release-notes.pdf cp.pdf ${pdfs}
127
128echo "Created: ${release}/rtems-${release}-release-notes.pdf cp.pdf"
129
130#
131# Comman package end.
132#
133. ${top}/rtems-release-package-end
134
135exit 0
Note: See TracBrowser for help on using the repository browser.