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

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

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
}
