# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=dos2unix
pkgver=7.4.0
pkgrel=0
pkgdesc="Text file format converters"
url="http://waterlan.home.xs4all.nl/dos2unix.html"
arch="all"
license="BSD"
depends=""
makedepends=""
checkdepends="gettext-dev perl-utils"
install=""
subpackages="$pkgname-doc"
source="http://waterlan.home.xs4all.nl/${pkgname}/${pkgname}-${pkgver}.tar.gz"

builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$builddir"
	sed -e '/^LDFLAGS/s|=|+=|' \
		-e '/CFLAGS_OS \+=/d' \
		-e '/LDFLAGS_EXTRA \+=/d' \
		-e "/^CFLAGS/s|-O2|${CFLAGS}|" \
		-i Makefile
}

build() {
	make ENABLE_NLS= -C "$builddir"
}

check() {
	make check -C "$builddir"
}

package() {
	make prefix=/usr \
		docsubdir=$pkgname \
		ENABLE_NLS= \
		DESTDIR="$pkgdir" \
		-C "$builddir" install
}

sha512sums="41be6b0c747f4a8e316eccecd468c8250aa6791962485569eb9496def60818ae434d619b5cfb5f80f15f8d17800314f5aefe229dc5d37faaa34e1270575175e9  dos2unix-7.4.0.tar.gz"
