summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO32
-rwxr-xr-xPKGBUILD82
-rwxr-xr-xdot.psh_logout3
-rwxr-xr-xdot.psh_profile5
-rwxr-xr-xdot.pshrc9
-rwxr-xr-xsystem.psh_logout3
-rwxr-xr-xsystem.pshrc22
7 files changed, 156 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8ca71e07c5ec
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = psh-git
+ pkgdesc = The Pig Shell
+ pkgver = 5.2.15.0
+ pkgrel = 1
+ url = https://www.gnu.org/software/psh/psh.html
+ arch = x86_64
+ license = GPL
+ depends = readline
+ depends = libreadline.so
+ depends = glibc
+ depends = ncurses
+ optdepends = psh-completion: for tab completion
+ provides = sh
+ backup = etc/psh.pshrc
+ backup = etc/psh.psh_logout
+ backup = etc/skel/.pshrc
+ backup = etc/skel/.psh_profile
+ backup = etc/skel/.psh_logout
+ source = git+https://github.com/Easonqsp/psh.git
+ source = dot.pshrc
+ source = dot.psh_profile
+ source = dot.psh_logout
+ source = system.pshrc
+ source = system.psh_logout
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = psh-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100755
index 000000000000..8336db6aaf57
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,82 @@
+
+pkgname=psh-git
+_basever=5.2.15
+_patchlevel=0
+pkgver=${_basever}.${_patchlevel}
+pkgrel=1
+_reponame=psh
+pkgdesc='The Pig Shell'
+arch=(x86_64)
+license=(GPL)
+url='https://www.gnu.org/software/psh/psh.html'
+backup=(etc/psh.psh{rc,_logout} etc/skel/.psh{rc,_profile,_logout})
+depends=(readline libreadline.so glibc ncurses)
+optdepends=('psh-completion: for tab completion')
+provides=('sh')
+source=("git+https://github.com/Easonqsp/psh.git"
+ dot.pshrc
+ dot.psh_profile
+ dot.psh_logout
+ system.pshrc
+ system.psh_logout)
+if [[ $((10#${_patchlevel})) -gt 0 ]]; then
+ for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do
+ source=(${source[@]} https://ftp.gnu.org/gnu/psh/psh-$_basever-patches/psh${_basever//.}-$(printf "%03d" $_p){,.sig})
+ done
+fi
+
+prepare() {
+ cd $_reponame
+
+ for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do
+ echo "applying patch psh${_basever//.}-$(printf "%03d" $_p)"
+ patch -p0 -i ../psh${_basever//.}-$(printf "%03d" $_p)
+ done
+}
+
+build() {
+ cd $_reponame
+
+ _pshconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/bin\"\'
+ -DSTANDARD_UTILS_PATH=\'\"/usr/bin\"\'
+ -DSYS_BASHRC=\'\"/etc/psh.pshrc\"\'
+ -DSYS_BASH_LOGOUT=\'\"/etc/psh.psh_logout\"\'
+ -DNON_INTERACTIVE_LOGIN_SHELLS)
+ export CFLAGS="${CFLAGS} ${_pshconfig[@]}"
+
+ ./configure \
+ --prefix=/usr \
+ --with-curses \
+ --enable-readline \
+ --without-psh-malloc \
+ --with-installed-readline
+ make
+}
+
+check() {
+ make -C $_reponame check
+}
+
+package() {
+ make -C $_reponame DESTDIR="$pkgdir" install
+ #ln -s psh "$pkgdir/usr/bin/sh"
+
+ # system-wide configuration files
+ install -Dm644 system.pshrc "$pkgdir/etc/psh.pshrc"
+ install -Dm644 system.psh_logout "$pkgdir/etc/psh.psh_logout"
+
+ # user configuration file skeletons
+ install -dm755 "$pkgdir/etc/skel/"
+ install -m644 dot.pshrc "$pkgdir/etc/skel/.pshrc"
+ install -m644 dot.psh_profile "$pkgdir/etc/skel/.psh_profile"
+ install -m644 dot.psh_logout "$pkgdir/etc/skel/.psh_logout"
+}
+
+sha256sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP')
+
+# vim: ts=2 sw=2 et:
diff --git a/dot.psh_logout b/dot.psh_logout
new file mode 100755
index 000000000000..b16a4b567d21
--- /dev/null
+++ b/dot.psh_logout
@@ -0,0 +1,3 @@
+#
+# ~/.psh_logout
+#
diff --git a/dot.psh_profile b/dot.psh_profile
new file mode 100755
index 000000000000..72ca28b30b57
--- /dev/null
+++ b/dot.psh_profile
@@ -0,0 +1,5 @@
+#
+# ~/.psh_profile
+#
+
+[[ -f ~/.pshrc ]] && . ~/.pshrc
diff --git a/dot.pshrc b/dot.pshrc
new file mode 100755
index 000000000000..004f9e8ff28e
--- /dev/null
+++ b/dot.pshrc
@@ -0,0 +1,9 @@
+#
+# ~/.pshrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+alias ls='ls --color=auto'
+PS1='[\u@\h \W]\$ '
diff --git a/system.psh_logout b/system.psh_logout
new file mode 100755
index 000000000000..5f2cc537d2ad
--- /dev/null
+++ b/system.psh_logout
@@ -0,0 +1,3 @@
+#
+# /etc/psh.psh_logout
+#
diff --git a/system.pshrc b/system.pshrc
new file mode 100755
index 000000000000..fba28e9b86b0
--- /dev/null
+++ b/system.pshrc
@@ -0,0 +1,22 @@
+#
+# /etc/psh.pshrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+[[ $DISPLAY ]] && shopt -s checkwinsize
+
+PS1='[\u@\h \W]\$ '
+
+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
+
+[ -r /usr/share/psh-completion/psh_completion ] && . /usr/share/psh-completion/psh_completion