summaryrefslogtreecommitdiff
path: root/strata/build-essential/bash.morph
blob: eb267007e755d63e93c831cb93c54368dfd67d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: bash
kind: chunk
build-system: autotools
configure-commands:
- |
  export CFLAGS="${CFLAGS}  -DSYS_BASHRC='\"/etc/bash.bashrc\"'";
  ./configure --prefix="$PREFIX" \
              --bindir=/bin \
              --without-bash-malloc \
              --with-installed-readline \
              --enable-readline
post-install-commands:
- ln -sf /bin/bash "$DESTDIR"/bin/sh
- |
  cat <<'EOF' >> bash.bashrc
  #
  # /etc/bash.bashrc
  #

  # If not running interactively, don't do anything
  [[ $- != *i* ]] && return

  # Configure prompt for different terminals
  case ${TERM} in
    xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
      PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'

      ;;
    screen)
      PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
      ;;
  esac

  # Enable bash completion if present
  [ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion
  EOF
- mkdir -p "$DESTDIR"/etc
- install -m 644 bash.bashrc "$DESTDIR"/etc/bash.bashrc