summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardon <jjardon@gnome.org>2015-04-01 15:30:28 (GMT)
committerJavier Jardón <jjardon@gnome.org>2015-04-29 13:27:20 (GMT)
commit678a0e030366b5c33a44d8f5b42c12cdc3aa3f60 (patch)
tree5742319f29fbc2f2521238ca1a843d4e83535ed1
parentdb1fe6e41bebf7da71d11fe9bc492ede1821f57b (diff)
downloaddefinitions-678a0e030366b5c33a44d8f5b42c12cdc3aa3f60.tar.gz
strata/core/bash.morph: Add configuration file /etc/bash.bashrc
This will: - Enable bash autocompletion if it's installed - Reset the terminal title when exit the current process Change-Id: Ic46a1edd1f84cf54f189956559344a85d8b64638
-rw-r--r--strata/core/bash.morph39
1 files changed, 34 insertions, 5 deletions
diff --git a/strata/core/bash.morph b/strata/core/bash.morph
index 9639593..5d0b8f0 100644
--- a/strata/core/bash.morph
+++ b/strata/core/bash.morph
@@ -1,8 +1,37 @@
name: bash
kind: chunk
+build-system: autotools
configure-commands:
-- ./configure --prefix=/usr --bindir=/bin --without-bash-malloc --with-installed-readline
-build-commands:
-- make
-install-commands:
-- make DESTDIR="$DESTDIR" install
+- |
+ export CFLAGS="${CFLAGS} -DSYS_BASHRC='\"/etc/bash.bashrc\"'";
+ ./configure --prefix="$PREFIX" \
+ --bindir=/bin \
+ --without-bash-malloc \
+ --with-installed-readline \
+ --enable-readline
+post-install-commands:
+- |
+ 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