summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c09289776d4771fcf5e981af4d8dd422b86027bd (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
53
54
55
56
57
58
59
60
61
62
# Maintainer: Cedric Girard <cgirard [dot] archlinux [at] valinor [dot] fr>
# Contributor: Jason Axelson <jason.axelsonATgmail.com>
# Contributor: Sean Escriva <sean.escrivaATgmail.com>
# Contributor: William Ting <william.h.tingATgmail.com>

pkgname=autojump-git
pkgver=22.5.3.r0.g06e082c
pkgrel=4
pkgdesc="A faster way to navigate your filesystem from the command line"
arch=(any)
url="http://github.com/wting/autojump"
license=('GPL3')
depends=('python>=3.8')
makedepends=('git')
conflicts=('autojump')
provides=('autojump')
source=('git+https://github.com/wting/autojump.git')
md5sums=('SKIP')

_gitname="autojump"
_python="python3.9"

pkgver() {
    cd ${_gitname}
    git describe --long --tags | sed 's/^release\-v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd ${_gitname}
    sed -i 's$#!/usr/bin/env python$#!/usr/bin/env python3$' bin/autojump bin/*.py
}

package() {
    cd ${_gitname}
    ./install.py --prefix 'usr/' --destdir "${pkgdir}" --zshshare 'usr/share/zsh/site-functions'

    cd "${pkgdir}"/usr/share/$_gitname
    for i in $_gitname.* ; do
        ln -s /usr/share/$_gitname/$i \
            "${pkgdir}"/etc/profile.d/$i
    done

    # FS#60929
    install -d "${pkgdir}/usr/lib/$_python/site-packages"
    mv ${pkgdir}/usr/bin/*.py "${pkgdir}/usr/lib/$_python/site-packages"
    python -m compileall -d /usr/lib "${pkgdir}/usr/lib"
    python -O -m compileall -d /usr/lib "${pkgdir}/usr/lib"

    # FS#49601
    install -d "${pkgdir}"/usr/share/fish/completions
    mv "${pkgdir}"/etc/profile.d/$_gitname.fish "${pkgdir}"/usr/share/fish/completions

    # https://github.com/joelthelion/autojump/pull/339
    sed -i "s!/usr/local/!/usr/!g" "${pkgdir}"/etc/profile.d/$_gitname.sh
    sed -i "s!/build/${pkgname}/pkg/${pkgname}/!/!g" "${pkgdir}"/etc/profile.d/$_gitname.sh

    # FS#43762
    sed -i '27,31d' "${pkgdir}"/etc/profile.d/$_gitname.sh
}


# vim:set ts=4 sw=4 et: