summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2002-12-01 05:54:20 +0000
committerMike Frysinger <vapier@gentoo.org>2002-12-01 05:54:20 +0000
commitdb4d9e3bd4710f5117f41af053b18595e9ff326a (patch)
treeed4b431dda93167dc049fa71607b64f4a613cdc1 /app-text/dos2unix
parentInitial import. ~keyworded for testing. (diff)
downloadgentoo-2-db4d9e3bd4710f5117f41af053b18595e9ff326a.tar.gz
gentoo-2-db4d9e3bd4710f5117f41af053b18595e9ff326a.tar.bz2
gentoo-2-db4d9e3bd4710f5117f41af053b18595e9ff326a.zip
initial ebuild #11242
Diffstat (limited to 'app-text/dos2unix')
-rw-r--r--app-text/dos2unix/ChangeLog8
-rw-r--r--app-text/dos2unix/dos2unix-3.1.ebuild34
-rw-r--r--app-text/dos2unix/files/digest-dos2unix-3.11
-rw-r--r--app-text/dos2unix/files/dos2unix-3.1-segfault.patch93
-rw-r--r--app-text/dos2unix/files/dos2unix-3.1.patch49
5 files changed, 185 insertions, 0 deletions
diff --git a/app-text/dos2unix/ChangeLog b/app-text/dos2unix/ChangeLog
new file mode 100644
index 000000000000..7f9ac501f221
--- /dev/null
+++ b/app-text/dos2unix/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for app-text/dos2unix
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/dos2unix/ChangeLog,v 1.1 2002/12/01 05:54:20 vapier Exp $
+
+*dos2unix-3.1 (01 Dec 2002)
+
+ 01 Dec 2002; Mike Frysinger <vapier@gentoo.org> :
+ Initial import. Ebuild submitted by José Fonseca <j_r_fonseca@yahoo.co.uk>.
diff --git a/app-text/dos2unix/dos2unix-3.1.ebuild b/app-text/dos2unix/dos2unix-3.1.ebuild
new file mode 100644
index 000000000000..da5e0646e5fa
--- /dev/null
+++ b/app-text/dos2unix/dos2unix-3.1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/dos2unix/dos2unix-3.1.ebuild,v 1.1 2002/12/01 05:54:20 vapier Exp $
+
+DESCRIPTION="Dos2unix converts DOS or MAC text files to UNIX format"
+HOMEPAGE=""
+SRC_URI="http://www2.tripleg.net.au/dos2unix.builder/${P}.tar.bz2"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="x86"
+
+DEPEND=""
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${P}.patch || die
+ patch -p1 < ${FILESDIR}/${P}-segfault.patch || die
+}
+
+src_compile() {
+ make clean || die
+ make CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ dobin dos2unix
+ dosym dos2unix /usr/bin/mac2unix
+
+ doman dos2unix.1
+ dosym dos2unix.1.gz /usr/share/man/man1/mac2unix.1.gz
+}
diff --git a/app-text/dos2unix/files/digest-dos2unix-3.1 b/app-text/dos2unix/files/digest-dos2unix-3.1
new file mode 100644
index 000000000000..c27346b635d4
--- /dev/null
+++ b/app-text/dos2unix/files/digest-dos2unix-3.1
@@ -0,0 +1 @@
+MD5 f90026a397cf787083ec2e4892c6dcdd dos2unix-3.1.tar.bz2 13400
diff --git a/app-text/dos2unix/files/dos2unix-3.1-segfault.patch b/app-text/dos2unix/files/dos2unix-3.1-segfault.patch
new file mode 100644
index 000000000000..7c8391bd2bdb
--- /dev/null
+++ b/app-text/dos2unix/files/dos2unix-3.1-segfault.patch
@@ -0,0 +1,93 @@
+--- dos2unix-3.1/dos2unix.c.segf Thu Jan 17 17:27:42 2002
++++ dos2unix-3.1/dos2unix.c Thu Jan 17 17:28:07 2002
+@@ -147,9 +147,9 @@
+ * RetVal: NULL if failure
+ * file stream otherwise
+ */
+-FILE* OpenOutFile(char *ipFN)
++FILE* OpenOutFile(int fd)
+ {
+- return (fopen(ipFN, W_CNTRL));
++ return (fdopen(fd, W_CNTRL));
+ }
+
+
+@@ -260,14 +260,17 @@
+ char TempPath[16];
+ struct stat StatBuf;
+ struct utimbuf UTimeBuf;
++ int fd;
+
+ /* retrieve ipInFN file date stamp */
+ if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+ RetVal = -1;
+
+- strcpy (TempPath, "./d2utmp");
+- strcat (TempPath, "XXXXXX");
+- mkstemp (TempPath);
++ strcpy (TempPath, "./d2utmpXXXXXX");
++ if((fd=mkstemp (TempPath))<0) {
++ perror("Failed to open output temp file");
++ RetVal = -1;
++ }
+
+ #ifdef DEBUG
+ fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -278,7 +281,7 @@
+ RetVal = -1;
+
+ /* can open out file? */
+- if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++ if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+ {
+ fclose (InF);
+ RetVal = -1;
+@@ -295,6 +298,8 @@
+ /* can close out file? */
+ if ((TempF) && (fclose(TempF) == EOF))
+ RetVal = -1;
++ if(fd>=0)
++ close(fd);
+
+ if ((!RetVal) && (ipFlag->KeepDate))
+ {
+@@ -340,14 +345,17 @@
+ char TempPath[16];
+ struct stat StatBuf;
+ struct utimbuf UTimeBuf;
++ int fd;
+
+ /* retrieve ipInFN file date stamp */
+ if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+ RetVal = -1;
+
+- strcpy (TempPath, "./u2dtmp");
+- strcat (TempPath, "XXXXXX");
+- mkstemp (TempPath);
++ strcpy (TempPath, "./u2dtmpXXXXXX");
++ if((fd=mkstemp (TempPath))<0) {
++ perror("Failed to open output temp file");
++ RetVal = -1;
++ }
+
+ #ifdef DEBUG
+ fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -358,7 +366,7 @@
+ RetVal = -1;
+
+ /* can open out file? */
+- if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++ if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+ {
+ fclose (InF);
+ RetVal = -1;
+@@ -376,6 +384,9 @@
+ if ((TempF) && (fclose(TempF) == EOF))
+ RetVal = -1;
+
++ if(fd>=0)
++ close(fd);
++
+ if ((!RetVal) && (ipFlag->KeepDate))
+ {
+ UTimeBuf.actime = StatBuf.st_atime;
diff --git a/app-text/dos2unix/files/dos2unix-3.1.patch b/app-text/dos2unix/files/dos2unix-3.1.patch
new file mode 100644
index 000000000000..5f823b2e7a9b
--- /dev/null
+++ b/app-text/dos2unix/files/dos2unix-3.1.patch
@@ -0,0 +1,49 @@
+--- dos2unix-3.1/Makefile.orig Thu Nov 19 07:09:38 1998
++++ dos2unix-3.1/Makefile Fri Nov 17 13:25:35 2000
+@@ -1,10 +1,12 @@
++CFLAGS=
++
+ default: dos2unix
+
+ all: dos2unix link install
+
+
+ dos2unix:
+- gcc -O dos2unix.c -o dos2unix
++ gcc $(CFLAGS) dos2unix.c -o dos2unix
+
+
+ link:
+@@ -12,11 +14,10 @@
+ ln -s dos2unix.1 mac2unix.1
+
+ clean:
+- rm dos2unix
++ rm -f dos2unix mac2unix mac2unix.1 *~ *.orig core
+
+ install:
+ install -m 755 dos2unix /usr/local/bin
+ install -m 644 dos2unix.1 /usr/local/man/man1
+ install -m 755 mac2unix /usr/local/bin
+ install -m 644 mac2unix.1 /usr/local/man/man1
+-
+--- dos2unix-3.1/dos2unix.c.orig Thu Nov 19 07:19:25 1998
++++ dos2unix-3.1/dos2unix.c Fri Nov 17 13:25:25 2000
+@@ -267,7 +267,7 @@
+
+ strcpy (TempPath, "./d2utmp");
+ strcat (TempPath, "XXXXXX");
+- mktemp (TempPath);
++ mkstemp (TempPath);
+
+ #ifdef DEBUG
+ fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -347,7 +347,7 @@
+
+ strcpy (TempPath, "./u2dtmp");
+ strcat (TempPath, "XXXXXX");
+- mktemp (TempPath);
++ mkstemp (TempPath);
+
+ #ifdef DEBUG
+ fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);