import ports/converters/dos2unix

Convert text files with DOS or Mac line breaks to Unix line breaks and
vice versa. Features:

* Automatically skips binary and non-regular files.
* In-place, paired, or stdio mode conversion.
* Keep original file dates option.
* 7-bit and iso conversion modes like SunOS dos2unix.
* Conversion of Windows UTF-16 files to Unix UTF-8.

ok/reminder about /usr/local (now subst'ed in do-configure) ajacoutot@
ok pirofti
This commit is contained in:
sthen 2012-05-07 12:07:07 +00:00
parent 972bc1d24f
commit 65893c67b5
5 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/05/07 12:07:07 sthen Exp $
COMMENT= convert DOS/MAC files to UNIX (line-endings/charset)
DISTNAME= dos2unix-6.0
CATEGORIES= converters
HOMEPAGE= http://waterlan.home.xs4all.nl/dos2unix.html
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB += c
MASTER_SITES= http://waterlan.home.xs4all.nl/dos2unix/
MODULES= devel/gettext
MAKE_FLAGS= CC="${CC}"
FAKE_FLAGS= prefix="${PREFIX}" \
docsubdir=dos2unix \
man1dir="${PREFIX}/man/man1"
USE_GMAKE= Yes
NO_REGRESS= Yes
do-configure:
perl -pi -e 's,/usr/local,${LOCALBASE},g' ${WRKSRC}/Makefile
post-install:
mv ${PREFIX}/share/man/* ${PREFIX}/man/
rmdir ${PREFIX}/share/man
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (dos2unix-6.0.tar.gz) = L8jW6+nxpRmxXr4IUOmqvQ==
RMD160 (dos2unix-6.0.tar.gz) = 9rnxnlGVin0Qj7sXyiuB9O25cK4=
SHA1 (dos2unix-6.0.tar.gz) = d/9bkgPyoKvEkAwA1p6NW2fWF6U=
SHA256 (dos2unix-6.0.tar.gz) = Cj2v5co9xvZApzGXMil1pMsg6bummev+yq7MFfliOJ4=
SIZE (dos2unix-6.0.tar.gz) = 67666

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2012/05/07 12:07:07 sthen Exp $
--- Makefile.orig Mon May 7 09:04:29 2012
+++ Makefile Mon May 7 09:06:36 2012
@@ -195,6 +195,16 @@ endif
endif
endif
+ifndef OS
+ifeq (OpenBSD, $(shell uname -s))
+ OS = openbsd
+ifdef ENABLE_NLS
+ CFLAGS_OS = -I/usr/local/include
+ LDFLAGS_EXTRA = -liconv -lintl -L/usr/local/lib
+endif
+endif
+endif
+
ifeq (Darwin, $(shell uname -s))
OS = Darwin
ifdef ENABLE_NLS
@@ -240,7 +250,7 @@ EO_NOTATION = -x
endif
CFLAGS_USER =
-CFLAGS = -O2 -Wall $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER)
+CFLAGS += -Wall $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER)
EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \
-DVER_DATE=\"$(DOS2UNIX_DATE)\" \

View File

@ -0,0 +1,8 @@
Convert text files with DOS or Mac line breaks to Unix line breaks and
vice versa. Features:
* Automatically skips binary and non-regular files.
* In-place, paired, or stdio mode conversion.
* Keep original file dates option.
* 7-bit and iso conversion modes like SunOS dos2unix.
* Conversion of Windows UTF-16 files to Unix UTF-8.

View File

@ -0,0 +1,34 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/05/07 12:07:07 sthen Exp $
@bin bin/dos2unix
bin/mac2unix
@bin bin/unix2dos
bin/unix2mac
man/es/
man/es/man1/
@man man/es/man1/dos2unix.1
@man man/es/man1/mac2unix.1
@man man/es/man1/unix2dos.1
@man man/es/man1/unix2mac.1
@man man/man1/dos2unix.1
@man man/man1/mac2unix.1
@man man/man1/unix2dos.1
@man man/man1/unix2mac.1
man/nl/
man/nl/man1/
@man man/nl/man1/dos2unix.1
@man man/nl/man1/mac2unix.1
@man man/nl/man1/unix2dos.1
@man man/nl/man1/unix2mac.1
share/doc/dos2unix/
share/doc/dos2unix/BUGS.txt
share/doc/dos2unix/COPYING.txt
share/doc/dos2unix/ChangeLog.txt
share/doc/dos2unix/NEWS.txt
share/doc/dos2unix/README.txt
share/doc/dos2unix/TODO.txt
share/doc/dos2unix/dos2unix.htm
share/doc/dos2unix/dos2unix.txt
share/locale/de/LC_MESSAGES/dos2unix.mo
share/locale/eo/LC_MESSAGES/dos2unix.mo
share/locale/es/LC_MESSAGES/dos2unix.mo
share/locale/nl/LC_MESSAGES/dos2unix.mo