aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b851066dd5f5c83e6d854b7d42d2280f0b112d8e (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
pkgname=larryshell
pkgver='1.3.1'
pkgrel='2'
pkgdesc="LarryShell modifies bash to create a more affluent command-line interface."
arch=('any')
license=('MIT')
depends=('bash')
source=("http://jhoughton.me/larryshell/${pkgver}-${pkgrel}.tar.gz")
url='https://github.com/Devon-Austin-Wood-Thomas/larryshell'
md5sums=('ef809a870df8789555a0fdaf6d5c22f0')

package() {
    cd $srcdir/larryshell

    mkdir -p $pkgdir/usr/bin
    mkdir -p $pkgdir/etc/larryshell
    mkdir -p $pkgdir/usr/share/larryshell

    cp larryshell $pkgdir/usr/bin/
    cp larryshellrc $pkgdir/etc/larryshell/
    cp larryshell-errors.txt $pkgdir/usr/share/larryshell/
    cp larryascii $pkgdir/usr/share/larryshell/
    cp larry.cow $pkgdir/usr/share/larryshell/
}

post_install() {
    if [ -f /etc/shells ] && [ -z `grep /usr/bin/larryshell /etc/shells` ]
    then
        if [ -z `grep /bin/sh /etc/shells` ]
        then
            sed -i'' -e 's/\(\/bin\/sh\)/\1\n\/usr\/bin\/larryshell/' /etc/shells
        else
            echo "/usr/bin/larryshell" >> /etc/shells
        fi
    fi
}

post_remove() {
    if [ -f /etc/shells ] && ! [ -z `grep /usr/bin/larryshell /etc/shells` ]
    then
        sed -i'' -e 's/\n\/usr\/bin\/larryshell//' /etc/shells
    fi
}