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

pkgname=tree
pkgver=2.3.1
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_references=(
  "anitya: 5006"
  "archlinux: tree"
  "cygwin: tree"
  "gentoo: app-text/tree"
)
license=('GPL')
makedepends=('make' 'gcc')
source=("https://gitlab.com/OldManProgrammer/unix-tree/-/archive/${pkgver}/unix-tree-${pkgver}.tar.gz"
        'Makefile-Uncomment-for-Cygwin.patch')
sha256sums=('ac3cda918492fc4dd7833745a9fd431fa976c35e682fd824656bfe21d8b51a69'
            'dc82ca9afa916267db763cda7db18b9812cc318d19115cbff2e7ce38580a9583')

prepare() {
  cd ${srcdir}/unix-${pkgname}-${pkgver}
  patch -p1 -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
}
