summaryrefslogtreecommitdiff
path: root/repo/tcsh/tcsh.xibuild
blob: f6a33d9bfe2eb01125834e6c2ac422b0c39a1d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh

NAME="tcsh"
DESC="extended C-shell"

MAKEDEPS="ncurses"

PKG_VER=6.24.01
SOURCE="https://github.com/tcsh-org/tcsh/archive/TCSH$(echo $PKG_VER | sed 's/\./_/g').tar.gz"

ADDITIONAL="
001-sysmalloc.patch
6974bc35a5cda6eab748e364bd76a860ca66968b.patch
csh.cshrc
csh.login
tcsh.post-install
"

prepare() {
    apply_patches || true
}

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


package() {
	make DESTDIR="$PKG_DEST" install
	install -Dm0644 "$BUILD_ROOT/csh.cshrc" "$PKG_DEST/etc/csh.cshrc"
	install -Dm0644 "$BUILD_ROOT/csh.login" "$PKG_DEST/etc/csh.login"
	ln -s tcsh "$PKG_DEST/bin/csh"
	ln -s tcsh.1 "$PKG_DEST/usr/share/man/man1/csh.1"
	rm -rf "$PKG_DEST"/usr/share/locale
}

postinstall () {
    if [ -f /etc/shells ] || grep -vq "tcsh" /etc/shells; then
        echo "/bin/tcsh" >> /etc/shells
    fi

    if [ -f /etc/shells ] || grep -vq "csh" /etc/shells; then
        echo "/bin/csh" >> /etc/shells
    fi
}