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

pkgname=lndir
pkgver=1.0.3
pkgrel=1
pkgdesc="Create a shadow directory of symbolic links to another directory tree"
arch=('i686' 'x86_64')
url="https://xorg.freedesktop.org/"
license=('custom')
makedepends=('xproto')
source=(https://xorg.freedesktop.org/archive/individual/util/$pkgname-$pkgver.tar.bz2
        0001-msysize.msys.patch)
sha256sums=('49f4fab0de8d418db4ce80dad34e9b879a4199f3e554253a8e1ab68f7c7cb65d'
            'fe924531fd201526eb9446d7aba4c7b084c2ee5ece5d56f884b3008a459c5499')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  patch -p1 -i ${srcdir}/0001-msysize.msys.patch
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --build=${CHOST} \
              --prefix=/usr \
              --sysconfdir=/etc \
              --localstatedir=/var
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
  install -D -m 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
