xref: /freebsd/usr.sbin/bsdinstall/scripts/docsinstall (revision 05b56666d37d98e73697caf1cdf929d02b698a2f)
1bfc3bab8SNathan Whitehorn#!/bin/sh
2bfc3bab8SNathan Whitehorn#-
3bfc3bab8SNathan Whitehorn# Copyright (c) 2011 Marc Fonvieille
4bfc3bab8SNathan Whitehorn# All rights reserved.
5bfc3bab8SNathan Whitehorn#
6bfc3bab8SNathan Whitehorn# Redistribution and use in source and binary forms, with or without
7bfc3bab8SNathan Whitehorn# modification, are permitted provided that the following conditions
8bfc3bab8SNathan Whitehorn# are met:
9bfc3bab8SNathan Whitehorn# 1. Redistributions of source code must retain the above copyright
10bfc3bab8SNathan Whitehorn#    notice, this list of conditions and the following disclaimer.
11bfc3bab8SNathan Whitehorn# 2. Redistributions in binary form must reproduce the above copyright
12bfc3bab8SNathan Whitehorn#    notice, this list of conditions and the following disclaimer in the
13bfc3bab8SNathan Whitehorn#    documentation and/or other materials provided with the distribution.
14bfc3bab8SNathan Whitehorn#
15bfc3bab8SNathan Whitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16bfc3bab8SNathan Whitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17bfc3bab8SNathan Whitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18bfc3bab8SNathan Whitehorn# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19bfc3bab8SNathan Whitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20bfc3bab8SNathan Whitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21bfc3bab8SNathan Whitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22bfc3bab8SNathan Whitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23bfc3bab8SNathan Whitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24bfc3bab8SNathan Whitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25bfc3bab8SNathan Whitehorn# SUCH DAMAGE.
26bfc3bab8SNathan Whitehorn#
27bfc3bab8SNathan Whitehorn# $FreeBSD$
28bfc3bab8SNathan Whitehorn
29bfc3bab8SNathan Whitehorn
30bfc3bab8SNathan Whitehornexec 3>&1
31bfc3bab8SNathan WhitehornDOCS=$(dialog --backtitle "FreeBSD Installer" \
32bfc3bab8SNathan Whitehorn    --title "FreeBSD Documentation Installation" --separate-output \
33bfc3bab8SNathan Whitehorn    --checklist "This menu will allow you to install the whole documentation set
34bfc3bab8SNathan Whitehornfrom the FreeBSD Documentation Project: Handbook, FAQ and articles.\n\n
35bfc3bab8SNathan WhitehornPlease select the language versions you wish to install.  At minimum,
36bfc3bab8SNathan Whitehornyou should install the English version, this is the original version
37bfc3bab8SNathan Whitehornof the documentation.\n\n
38bfc3bab8SNathan WhitehornNB: This requires a working, configured network connection." 0 0 0 \
39bfc3bab8SNathan Whitehorn	bn	"Bengali Documentation" ${DIST_DOC_BN:-off} \
40bfc3bab8SNathan Whitehorn	da	"Danish Documentation" ${DIST_DOC_DA:-off} \
41bfc3bab8SNathan Whitehorn	de	"German Documentation" ${DIST_DOC_DE:-off} \
42bfc3bab8SNathan Whitehorn	el	"Greek Documentation" ${DIST_DOC_EL:-off} \
43bfc3bab8SNathan Whitehorn	en	"English Documentation (recommended)" ${DIST_DOC_EN:-on} \
44bfc3bab8SNathan Whitehorn	es	"Spanish Documentation" ${DIST_DOC_ES:-off} \
45bfc3bab8SNathan Whitehorn	fr	"French Documentation" ${DIST_DOC_FR:-off} \
46bfc3bab8SNathan Whitehorn	hu	"Hungarian Documentation" ${DIST_DOC_HU:-off} \
47bfc3bab8SNathan Whitehorn	it	"Italian Documentation" ${DIST_DOC_IT:-off} \
48bfc3bab8SNathan Whitehorn	ja	"Japanese Documentation" ${DIST_DOC_JA:-off} \
49bfc3bab8SNathan Whitehorn	mn	"Mongolian Documentation" ${DIST_DOC_MN:-off} \
50bfc3bab8SNathan Whitehorn	nl	"Dutch Documentation" ${DIST_DOC_NL:-off} \
51bfc3bab8SNathan Whitehorn	pl	"Polish Documentation" ${DIST_DOC_PL:-off} \
52bfc3bab8SNathan Whitehorn	pt	"Portuguese Documentation" ${DIST_DOC_PT:-off} \
53bfc3bab8SNathan Whitehorn	ru	"Russian Documentation" ${DIST_DOC_RU:-off} \
54bfc3bab8SNathan Whitehorn	sr	"Serbian Documentation" ${DIST_DOC_SR:-off} \
55bfc3bab8SNathan Whitehorn	tr	"Turkish Documentation" ${DIST_DOC_TR:-off} \
56bfc3bab8SNathan Whitehorn	zh_cn	"Simplified Chinese Documentation" ${DIST_DOC_ZH_CN:-off} \
57bfc3bab8SNathan Whitehorn	zh_tw	"Traditional Chinese Documentation" ${DIST_DOC_ZH_TW:-off} \
58bfc3bab8SNathan Whitehorn2>&1 1>&3)
59bfc3bab8SNathan Whitehorntest $? -eq 0 || exit 0
60bfc3bab8SNathan Whitehornexec 3>&-
61bfc3bab8SNathan Whitehorn
62*05b56666SNathan Whitehorn# Let pkg_add be able to use name servers
63*05b56666SNathan Whitehorncp ${BSDINSTALL_TMPETC}/resolv.conf ${BSDINSTALL_CHROOT}/etc
64*05b56666SNathan Whitehorn
65*05b56666SNathan Whitehornerror() {
66*05b56666SNathan Whitehorn	dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
67*05b56666SNathan Whitehorn	    "Could not install package $1 (`tail -n 1 ${BSDINSTALL_LOG}`)" 0 0
68*05b56666SNathan Whitehorn	exit 1
69*05b56666SNathan Whitehorn}
70*05b56666SNathan Whitehorn
71*05b56666SNathan Whitehorn
72bfc3bab8SNathan Whitehornclear
73bfc3bab8SNathan Whitehornecho "FreeBSD Installer"
74bfc3bab8SNathan Whitehornecho "========================"
75bfc3bab8SNathan Whitehornecho
76bfc3bab8SNathan Whitehorn
77bfc3bab8SNathan Whitehornfor i in $DOCS; do
78*05b56666SNathan Whitehorn    pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc || error $i-freebsd-doc
79bfc3bab8SNathan Whitehorndone
80