1 #!/usr/bin/bash
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
9 #
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
14 #
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 #
21 # CDDL HEADER END
22 #
23
24 #
25 # Copyright 2011-2013 OmniTI Computer Consulting, Inc. All rights reserved.
26 # Use is subject to license terms.
27 #
28
29 #
30 # Copyright (c) 2013 by Delphix. All rights reserved.
31 #
32
33 # Load support functions
34 . ../../lib/functions.sh
35
36 # Patches are synced from gnu.org, e.g.
37 # rsync -a --exclude=*.sig rsync://ftp.gnu.org/ftp/bash/bash-4.3-patches/ patches/bash-4.3-patches/
38 # cd patches
39 # ls bash-4.3-patches/* | sed -e 's/\([0-9]\)$/\1 -p0/' > series
40 # Then set PATCHLEVEL to the highest patch number in the updated list
41 #
42 # NOTE: patches will obviously have to be checked often.
43
44 PROG=bash # App name
45 VER=4.3 # App version
46 PATCHLEVEL=33 # Patch level
47 VERHUMAN="$VER patchlevel $PATCHLEVEL"
48 PKG=shell/bash # Package name (without prefix)
49 SUMMARY="GNU Bourne-Again shell (bash)"
50 DESC="$SUMMARY version $VER"
51
52 DEPENDS_IPS="system/library system/library/gcc-4-runtime"
53
54 BUILDARCH=32
55 NO_PARALLEL_MAKE=1
56
57 # Cribbed from upstream but modified for gcc
58 # "let's shrink the SHT_SYMTAB as much as we can"
59 LDFLAGS="-Wl,-z -Wl,redlocsym"
60
61 # Cribbed from upstream, with a few changes:
62 # We only do 32-bit so forgo the isaexec stuff
63 # Don't bother building static
64 CONFIGURE_OPTS="
65 --bindir=$PREFIX/bin
66 --localstatedir=/var
67 --enable-alias
68 --enable-arith-for-command
69 --enable-array-variables
70 --enable-bang-history
71 --enable-brace-expansion
72 --enable-casemod-attributes
73 --enable-casemod-expansions
74 --enable-command-timing
75 --enable-cond-command
76 --enable-cond-regexp
77 --enable-coprocesses
78 --enable-debugger
79 --enable-directory-stack
80 --enable-disabled-builtins
81 --enable-dparen-arithmetic
82 --enable-extended-glob
83 --enable-help-builtin
84 --enable-history
85 --enable-job-control
86 --enable-multibyte
87 --enable-net-redirections
88 --enable-process-substitution
89 --enable-progcomp
90 --enable-prompt-string-decoding
91 --enable-readline
92 --enable-restricted
93 --enable-select
94 --enable-separate-helpfiles
95 --enable-single-help-strings
96 --disable-strict-posix-default
97 --enable-usg-echo-default
98 --enable-xpg-echo-default
99 --enable-mem-scramble
100 --disable-profiling
101 --enable-largefile
102 --enable-nls
103 --with-bash-malloc
104 --with-curses
105 --with-installed-readline=no
106 "
107 reset_configure_opts
108
109 # Files pilfered from upstream userland-gate
110 install_files() {
111 logmsg "Installing extra files"
112 logcmd cp $MYDIR/files/rbash.1 $DESTDIR$PREFIX/share/man/man1/
113 logcmd mkdir -p $DESTDIR/etc/bash
114 logcmd mkdir -p $DESTDIR/etc/skel
115 logcmd cp $MYDIR/files/etc.bash.bash_completion $DESTDIR/etc/bash/bash_completion
116 logcmd cp $MYDIR/files/etc.bash.bashrc $DESTDIR/etc/bash/bashrc.example
117 logcmd cp $MYDIR/files/etc.bash.inputrc $DESTDIR/etc/bash/inputrc.example
118 logcmd cp $MYDIR/files/etc.skel.bashrc $DESTDIR/etc/skel/.bashrc
119 }
120
121 make_symlink() {
122 logmsg "Setting up symlinks"
123 logcmd ln -s ./bash $DESTDIR$PREFIX/bin/rbash
124 logcmd mkdir -p $DESTDIR$PREFIX/gnu/bin
125 logcmd ln -s ../../bin/bash $DESTDIR$PREFIX/gnu/bin/sh
126 }
127
128 init
129 download_source $PROG $PROG $VER
130 patch_source
131 prep_build
132 build
133 make_isa_stub
134 install_files
135 make_symlink
136 VER=${VER}.$PATCHLEVEL
137 make_package
138 clean_up
139
140 # Vim hints
141 # vim:ts=4:sw=4:et: