# Contributor: Dan Theisen <djt@hxx.in>
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=tcsh
pkgver=6.24.13
pkgrel=0
pkgdesc="extended C-shell"
url="https://github.com/tcsh-org/tcsh"
arch="all"
license="BSD-3-Clause"
checkdepends="diffutils autoconf"
makedepends="ncurses-dev"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="https://astron.com/pub/tcsh/tcsh-$pkgver.tar.gz
	csh.login
	csh.cshrc
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--bindir=/bin \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-rpath
	make
}

check() {
	make check
}

package() {
	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="
7405d3102c0cf70dd01396681e3fd69aeec70da7a99f6ffccc163ebd723fff0f2640f78fbcf452413edf24c96b22962f286fce5a3a1ac71276a348faacf9b231  tcsh-6.24.13.tar.gz
331dd02a5cf64fa281226ab0895c07557015895fe1079894c6d2162827f3e8b07a99245be1de93c93a8f0dfa136c447eae5a5a9d41352157743ff03f6ccb9b23  csh.login
205628d2f0825aab9a1eb3b33b4de2377d010dbb3a098388fb11febda10ca2385ecacaa27c5428dbd7d9d711c913cddca72379c825bfb63385ebc3643253cb37  csh.cshrc
"
