summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cc46f25cb181f4626e29ca65942b7048f86e3ee3 (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
# Maintainer:  Yamada Hayao <hayao@fascode.net>

_pkgname=filezilla
pkgname="${_pkgname}-unstable-bin"
pkgver=3.54.0_rc1
pkgrel=1
pkgdesc='Free, open source FTP, FTPS and SFTP client (Pre-built binary)'
arch=('i686' 'x86_64')
url='https://filezilla-project.org'
license=('GPL')
depends=('pugixml' 'wxgtk3' 'xdg-utils' 'gmp' 'gnutls' 'nettle' 'sqlite')
makedepends=('curl')
provides=("${_pkgname}" "${_pkgname}-git")
conflicts=("${_pkgname}" "${_pkgname}-git" "libfilezilla")
machine_arch="${CARCH}"

for _arch in ${arch[@]}; do
    eval "source_${_arch}=(FileZilla_${pkgver}_${_arch}-linux-gnu.tar.bz2::https://download.filezilla-project.org/client/FileZilla_${pkgver//_/-}_${_arch}-linux-gnu.tar.bz2)"
    eval "sha512sums_${_arch}=(
        '$(
            _url="https://download.filezilla-project.org/client/FileZilla_${pkgver//_/-}.sha512"
            _sum="$(curl --silent -L "${_url}" | grep "FileZilla_${pkgver}_${_arch}-linux-gnu.tar.bz2")"
            if [[ ! "${?}" = 0 ]] || [[ ! -v "_sum" ]] || [[ -z "${_sum}" ]]; then
                echo -n "SKIP"
            else
                echo -n "$(echo "${_sum}" | cut -d ' ' -f 1)"
            fi
        )'
    )"
done

package() {
    rm -rf "${srcdir}/FileZilla_${pkgver}_${machine_arch}-linux-gnu.tar.bz2"
    mkdir -p "${pkgdir}/opt/" "${pkgdir}/usr/bin/"
    cp -r "${srcdir}/"* "${pkgdir}/opt/"

    mv "${pkgdir}/opt/FileZilla3/share" "${pkgdir}/usr/"

    local _fullpath _filename _make_link
    function _make_link () {
        ln -s "${1}" "${2}"
        echo "Created symlink ${1} -> ${2}"
    }
    for _fullpath in "${pkgdir}/opt/FileZilla3/bin/"* ;do
        _filename="$(basename "${_fullpath}")"
        _make_link "/opt/FileZilla3/bin/${_filename}"  "${pkgdir}/usr/bin/${_filename}" 
    done
}