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

pkgname=dos2unix
pkgver=7.5.2
pkgrel=1
pkgdesc='Text file format converter'
arch=('i686' 'x86_64')
url='https://waterlan.home.xs4all.nl/dos2unix.html'
license=('BSD')
depends=('libintl')
makedepends=('perl' 'gettext-devel' 'gcc' 'make')
conflicts=('hd2u')
source=("https://waterlan.home.xs4all.nl/${pkgname}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('264742446608442eb48f96c20af6da303cb3a92b364e72cb7e24f88239c4bf3a')

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

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DEBUG=1
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  install -Dm755 ${pkgdir}/usr/bin/dos2unix.exe ${pkgdir}/usr/bin/d2u.exe
  install -Dm755 ${pkgdir}/usr/bin/unix2dos.exe ${pkgdir}/usr/bin/u2d.exe
  install -D -m644 COPYING.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
