Debian Codegraph @

debian/repack

raw
1 #!/bin/sh
2 # This program extracts from upstream GNU Bison source release the files needed
3 # to build the non-DFSG-free documentation. This program was originally
4 # developed against Bison 3.0.4.
5
6 # Command line check.
7 if [ $# -ne 2 ] || [ "$1" != "--upstream-version" ]; then
8 echo "$0: This script must be called via uscan with watch version 4." >&2
9 exit 1
10 fi
11 rversion="$2"
12 version="${rversion%+*}"
13
14 # Create a temporary directory and delete it on exit.
15 temp="$(mktemp -d)"
16 trap '! [ -d "${temp}" ] || rm -rf -- "${temp}"' EXIT
17
18 opackage="bison-${version}"
19 npackage="bison-doc-${version}"
20 otarball="../bison-${version}.tar.xz"
21 ntarball="../bison-doc_${rversion}.orig.tar.xz"
22 opath="${temp}/${opackage}"
23 npath="${temp}/${npackage}"
24
25 tar -C "${temp}" -Jxf "${otarball}"
26 mkdir -p "${npath}/build-aux"
27 mkdir -p "${npath}/doc"
28
29 # These files are under GFDL with Front-Cover and Back-Cover Texts.
30 mv \
31 "${opath}/doc/bison.info" \
32 "${opath}/doc/bison.texi" \
33 "${opath}/doc/figs" \
34 "${npath}/doc"
35
36 # These files are needed to build the texi documentation.
37 mv "${opath}"/build-aux/texinfo.tex "${npath}/build-aux"
38 mv "${opath}"/doc/*.texi "${npath}/doc"
39
40 # These files are used with GFDL documentation.
41 mv "${opath}/examples" "${npath}"
42
43 # Clean up mk-origtargz symlinks and repack.
44 rm -f "${ntarball}" "${ntarball}.asc"
45 tar -C "${temp}" -Jcf "${ntarball}" "${npackage}"