first commit

This commit is contained in:
ngn
2024-07-09 16:44:10 +03:00
commit e1683c711c
66 changed files with 1364 additions and 0 deletions

3
src/bash/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.cache/
dist/
root/

View File

@ -0,0 +1,24 @@
if [ -f /usr/share/bash-completion/bash_completion ]; then
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
[ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
fi
fi
fi
else
if shopt -q progcomp; then
for script in /etc/bash_completion.d/* ; do
if [ -r $script ] ; then
. $script
fi
done
fi
fi

2
src/bash/changes.md Normal file
View File

@ -0,0 +1,2 @@
# 5.2.21
First version

2
src/bash/i18n.sh Normal file
View File

@ -0,0 +1,2 @@
. /etc/locale.conf
export LANG

60
src/bash/pkg.sh Normal file
View File

@ -0,0 +1,60 @@
# general info
NAME="bash"
DESC="Bourne-Again shell"
VERSION="5.2.21"
# required files
FILES=(
"https://ftp.gnu.org/gnu/bash/bash-${VERSION}.tar.gz"
"skelrc"
"skelprof"
"profile"
"bash_completion.sh"
"i18n.sh"
"readline.sh"
"shells"
)
HASHES=(
"ad5b38410e3bf0e9bcc20e2765f5e3f9"
"21ae7b58947dc168b1fb8a6b21f12632a594aaff6f5472ade79c8ce235c4f960"
"9acd816e6e55af7337ad9c0dfaaf3e09297de7a83e55a5378d2075a7c4862fb2"
"eb0d73e7bce8e4eddcea05511bcb2b6105716d5d715ea9a28b8b9ad59137ec48"
"7dda3e99ed885edb70cb7188283fcb3b7339c0563b0b419cb023b4e6eb504cd8"
"f955496d700e3aeff47ed200ec89f82ba4323b33f9d70555677b1b6196688761"
"07c0e8de91e91e534452c52a8d16b3f282c16a5f5d1818f9f623bf056e800298"
"4cc26708349348ad3520dae0e1046ef3d1b6eb823c9e1361aa24062d785595d8"
)
# install and build depends
DEPENDS=("glibc" "readline" "ncurses")
BUILD=()
KEEP=("/etc/shells")
build(){
tar xf "${NAME}-${VERSION}.tar.gz"
cd "${NAME}-${VERSION}"
./configure --prefix=/usr \
--without-bash-malloc \
--with-installed-readline \
--docdir="/usr/share/doc/bash-${VERSION}"
make && make DESTDIR="${ROOTDIR}" install
ln -sf bash "${ROOTDIR}/usr/bin/sh"
install -dm755 "${ROOTDIR}/etc/skel/"
install -m644 "${ROOTDIR}/skelrc" "${ROOTDIR}/etc/skel/.bashrc"
install -m644 "${ROOTDIR}/skelprof" "${ROOTDIR}/etc/skel/.bash_profile"
install -m644 "${ROOTDIR}/profile" "${ROOTDIR}/etc/profile"
install -m644 "${ROOTDIR}/shells" "${ROOTDIR}/etc/shells"
install --directory --mode=0755 "${ROOTDIR}/etc/profile.d"
install --directory --mode=0755 "${ROOTDIR}/etc/bash_completion.d"
install -m644 "${ROOTDIR}/bash_completion.sh" "${ROOTDIR}/etc/profile.d/bash_completion.sh"
install -m644 "${ROOTDIR}/i18n.sh" "${ROOTDIR}/etc/profile.d/i18n.sh"
install -m644 "${ROOTDIR}/readline.sh" "${ROOTDIR}/etc/profile.d/readline.sh"
cd .. && rm -r "${NAME}-${VERSION}"
}

41
src/bash/profile Normal file
View File

@ -0,0 +1,41 @@
pathremove () {
local IFS=':'
local NEWPATH
local DIR
local PATHVARIABLE=${2:-PATH}
for DIR in ${!PATHVARIABLE} ; do
if [ "$DIR" != "$1" ] ; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
export $PATHVARIABLE="$NEWPATH"
}
pathprepend () {
pathremove $1 $2
local PATHVARIABLE=${2:-PATH}
export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
}
pathappend () {
pathremove $1 $2
local PATHVARIABLE=${2:-PATH}
export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
}
export -f pathremove pathprepend pathappend
export PATH="/usr/bin:/usr/sbin:/usr/local/bin"
export HISTSIZE=1000
export HISTIGNORE="&:[bf]g:exit"
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share/}
export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg/}
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
for script in /etc/profile.d/*.sh ; do
if [ -r $script ] ; then
. $script
fi
done
unset script

4
src/bash/readline.sh Normal file
View File

@ -0,0 +1,4 @@
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
INPUTRC=/etc/inputrc
fi
export INPUTRC

2
src/bash/shells Normal file
View File

@ -0,0 +1,2 @@
/bin/sh
/bin/bash

2
src/bash/skelprof Normal file
View File

@ -0,0 +1,2 @@
# default ~/.bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc

16
src/bash/skelrc Normal file
View File

@ -0,0 +1,16 @@
# default ~/.bashrc
[[ $- != *i* ]] && return
C_BOLD="\[\e[1m\]"
C_RESET="\[\e[0m\]"
C_GREEN="\[\e[1;32m\]"
C_RED="\[\e[1;31m\]"
alias ls="ls --color"
alias grep="grep --color"
if [[ $EUID == 0 ]] ; then
PS1="$C_BOLD\u$C_RESET$C_BOLD@\h:\w $C_RED>>> $C_RESET"
else
PS1="$C_BOLD\u$C_RESET$C_BOLD@\h:\w $C_GREEN>>> $C_RESET"
fi