# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=tree
pkgver=2.3.2
pkgrel=1
pkgdesc="A directory listing program displaying a depth indented list of files"
arch=('i686' 'x86_64')
url="https://oldmanprogrammer.net/source.php?dir=projects/tree"
msys2_repository_url="https://gitlab.com/OldManProgrammer/unix-tree"
msys2_changelog_url='https://gitlab.com/OldManProgrammer/unix-tree/-/blob/master/CHANGES'
msys2_references=(
  "anitya: 5006"
  "archlinux: tree"
  "cygwin: tree"
  "gentoo: app-text/tree"
)
license=('spdx:GPL-2.0-or-later')
makedepends=('make' 'gcc')
source=("https://gitlab.com/OldManProgrammer/unix-tree/-/archive/${pkgver}/unix-tree-${pkgver}.tar.gz"
        'Makefile-Uncomment-for-Cygwin.patch')
sha256sums=('513a53cbc42ca1f4ea06af2bab1f5283524a3848266b1d162416f8033afc4985'
            'dc82ca9afa916267db763cda7db18b9812cc318d19115cbff2e7ce38580a9583')

prepare() {
  cd ${srcdir}/unix-${pkgname}-${pkgver}
  patch -Np1 -i ${srcdir}/Makefile-Uncomment-for-Cygwin.patch
}

build() {
  cd ${srcdir}/unix-${pkgname}-${pkgver}
  make
}

package() {
  cd ${srcdir}/unix-${pkgname}-${pkgver}
  make PREFIX="${pkgdir}/usr" MANDIR="${pkgdir}/usr/share/man" install
}
