Subject: [alpine-aports] [PATCH] community/tcsh: add csh.cshrc and csh.login to /etc

From: Milan P. Stanić <[email-masked]>
Date: Mon, 29 Apr 2019 16:59:47 +0200

add sysconfdir=/etc option to build() configure
set url to current active development on github.com
add myself as contributor
bump pkgrel
---
 community/tcsh/APKBUILD  | 20 +++++++--
 community/tcsh/csh.cshrc | 96 ++++++++++++++++++++++++++++++++++++++++
 community/tcsh/csh.login | 71 +++++++++++++++++++++++++++++
 3 files changed, 183 insertions(+), 4 deletions(-)
 create mode 100644 community/tcsh/csh.cshrc
 create mode 100644 community/tcsh/csh.login

diff --git a/community/tcsh/APKBUILD b/community/tcsh/APKBUILD
index 2e6e2ebc67..be3c77e225 100644
--- a/community/tcsh/APKBUILD
+++ b/community/tcsh/APKBUILD
@@ -1,10 +1,11 @@
 # Contributor: Dan Theisen <[email-masked]>
+# Contributor: Milan P. Stanić <[email-masked]>
 # Maintainer: Dan Theisen <[email-masked]>
 pkgname=tcsh
 pkgver=6.20.00
-pkgrel=2
+pkgrel=3
 pkgdesc="extended C-shell"
-url="http://www.tcsh.org"
+url="https://github.com/tcsh-org/tcsh"
 arch="all"
 license="BSD-3-Clause"
 depends=""
@@ -15,7 +16,11 @@ subpackages="$pkgname-doc"
 options="!checkroot"
 source="$pkgname-$pkgver.tar.gz::http://http.debian.net/debian/pool/main/t/tcsh/${pkgname}_${pkgver}.orig.tar.gz
 	001-sysmalloc.patch
-	002-test_123-posix_fix.patch"
+	002-test_123-posix_fix.patch
+	csh.login
+	csh.cshrc
+	"
+
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
@@ -24,6 +29,7 @@ build() {
 		--build=$CBUILD \
 		--host=$CHOST \
 		--prefix=/usr \
+		--sysconfdir=/etc \
 		--bindir=/bin \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
@@ -39,9 +45,15 @@ check() {
 package() {
 	cd "$builddir"
 	make DESTDIR="$pkgdir" install
+	install -Dm0644 "${srcdir}/csh.cshrc" "${pkgdir}/etc/csh.cshrc"
+	install -Dm0644 "${srcdir}/csh.login" "${pkgdir}/etc/csh.login"
+	ln -s tcsh "${pkgdir}/bin/csh"
+	ln -s tcsh.1 "${pkgdir}/usr/share/man/man1/csh.1"
 	rm -rf "$pkgdir"/usr/share/locale
 }
 
 sha512sums="c5635393c22341e62fb9a0b953ddf8871a876ab09deb08c98237f93afa9257b4a3381d1db65eefe769e22ef845db29ab7bc78773f1f609d73c8205689a6683e9  tcsh-6.20.00.tar.gz
 40149d8eb2fc0fe5184f3c24c7a1b728e881cc0048ccd37a986c3b2d2094499ec1c37ae2bae4c209fb8a847aa943e83e81f79e3d2f55c59990bc00d9d07f5a94  001-sysmalloc.patch
-b4c1afe04554d117b1402608bcdb243148c0c7b2442bdc10dde3ed6601db5e7c5a2341373f9bdc31fda8860e47a6e152cdcc4e3a8b273742037eebc624df282c  002-test_123-posix_fix.patch"
+b4c1afe04554d117b1402608bcdb243148c0c7b2442bdc10dde3ed6601db5e7c5a2341373f9bdc31fda8860e47a6e152cdcc4e3a8b273742037eebc624df282c  002-test_123-posix_fix.patch
+0800e82a38db731154e8f04e5fad2919bb319fdbc626415f0f95d90b7f802c93071d106cee89f9a7201fb3cb69313b741f5f058aea8f89e86fe69613ca20557d  csh.login
+205628d2f0825aab9a1eb3b33b4de2377d010dbb3a098388fb11febda10ca2385ecacaa27c5428dbd7d9d711c913cddca72379c825bfb63385ebc3643253cb37  csh.cshrc"
diff --git a/community/tcsh/csh.cshrc b/community/tcsh/csh.cshrc
new file mode 100644
index 0000000000..5f53824bb2
--- /dev/null
+++ b/community/tcsh/csh.cshrc
@@ -0,0 +1,96 @@
+#############################################################################
+##
+## Gentoo's csh.cshrc
+##
+## Based on the TCSH package (http://tcshrc.sourceforge.net)
+##
+## .tcshrc		2Sep2001, Simos Xenitellis ([email-masked])
+##
+## 2003-01-13  --  Alain Penders ([email-masked])
+##     Renamed to /etc/csh.cshrc, basic cleanup work.
+##
+## 2003-01-24  --  Alain Penders ([email-masked])
+##     Improved config file handling.
+##
+onintr -
+##
+
+##
+## Load the environment defaults.
+##
+if ( -r /etc/csh.env ) then
+    source /etc/csh.env
+endif
+
+
+##
+## Make sure our path includes the basic stuff for root and normal users.
+##
+if ($LOGNAME == "root") then
+    set -f path = ( $path /sbin )
+    set -f path = ( $path /usr/sbin )
+    set -f path = ( $path /usr/local/sbin )
+endif
+set -f path = ( $path /bin )
+set -f path = ( $path /usr/bin )
+set -f path = ( $path /usr/local/bin )
+set -f path = ( $path /opt/bin )
+
+
+##
+## Load our settings -- most are for interactive shells only, but not all.
+##
+if ( -e /etc/profile.d/tcsh-settings ) then
+    source /etc/profile.d/tcsh-settings
+endif
+
+
+##
+## Source extensions installed by ebuilds
+##
+if ( -d /etc/profile.d ) then
+  set _tmp=${?nonomatch}
+  set nonomatch
+  foreach _s ( /etc/profile.d/*.csh )
+    if ( -r $_s ) then
+      source $_s
+    endif
+  end
+  if ( ! ${_tmp} ) unset nonomatch
+  unset _tmp _s
+endif
+
+
+# Everything after this point is interactive shells only.
+if ( $?prompt == 0 ) goto end
+
+
+##
+## Load our aliases -- for interactive shells only
+##
+if ( -e /etc/profile.d/tcsh-aliases ) then
+    source /etc/profile.d/tcsh-aliases
+endif
+
+
+##
+## Load our key bindings -- for interactive shells only
+##
+if ( -e /etc/profile.d/tcsh-bindkey ) then
+    source /etc/profile.d/tcsh-bindkey
+endif
+
+
+##
+## Load our command completions -- for interactive shells only
+##
+if ( -e /etc/profile.d/tcsh-complete ) then
+    source /etc/profile.d/tcsh-complete
+endif
+
+
+end:
+##
+onintr
+##
+
diff --git a/community/tcsh/csh.login b/community/tcsh/csh.login
new file mode 100644
index 0000000000..ea75d1fab5
--- /dev/null
+++ b/community/tcsh/csh.login
@@ -0,0 +1,71 @@
+#############################################################################
+##
+## Gentoo's csh.login
+##
+## 2003-01-13  -- Alain Penders ([email-masked])
+##
+##     Initial version.  Inspired by the Suse version.
+##
+
+
+##
+## Default terminal initialization
+##
+if ( -o /dev/$tty && ${?prompt} ) then
+    # Console
+    if ( ! ${?TERM} )           setenv TERM linux
+    if ( "$TERM" == "unknown" ) setenv TERM linux
+    # No tset available on SlackWare
+    if ( -x "`which stty`" ) stty sane cr0 pass8 dec
+    if ( -x "`which tset`" ) tset -I -Q
+    unsetenv TERMCAP
+    settc km yes
+endif
+
+##
+## Default UMASK
+##
+umask 022
+
+##
+## Set our SHELL variable.
+##
+setenv SHELL /bin/tcsh
+
+##
+## Setup a default MAIL variable
+##
+if ( -f /var/spool/mail/$USER ) then
+    setenv MAIL /var/spool/mail/$USER
+    set mail=$MAIL
+endif
+
+##
+## If we're root, report who's logging in and out.
+## disabled because musl libc doesn't support utmp
+##if ( "$uid" == "0" ) then
+##    set who=( "%n has %a %l from %M." )
+##    set watch=( any any ) #
+##endif
+
+##
+## Show the MOTD once the first time, and once after it has been changed.
+##
+## Note: if this is a SSH login, SSH will always show the MOTD, so we
+## skip it.  Create ~/.hushlogin is you don't want SSH to show it.
+##
+if (-f /etc/motd ) then
+    if ( ! $?SSH_CLIENT ) then
+        cmp -s /etc/motd ~/.hushmotd
+        if ($status) then
+            tee ~/.hushmotd < /etc/motd
+            echo "((( MOTD shown only once, unless it is changed )))"
+        endif
+    endif
+endif
+
+##
+## Send us home.
+##
+cd
+
-- 
2.20.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---