summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2002-12-01 06:03:15 +0000
committerMike Frysinger <vapier@gentoo.org>2002-12-01 06:03:15 +0000
commitf19f7869e466855122ff7fb15cd5881112025977 (patch)
tree954b47019ec231df4931ef2e124a8fa66f697223 /app-text
parentinitial ebuild #11242 (diff)
downloadgentoo-2-f19f7869e466855122ff7fb15cd5881112025977.tar.gz
gentoo-2-f19f7869e466855122ff7fb15cd5881112025977.tar.bz2
gentoo-2-f19f7869e466855122ff7fb15cd5881112025977.zip
initial ebuild #11242
Diffstat (limited to 'app-text')
-rw-r--r--app-text/unix2dos/ChangeLog8
-rw-r--r--app-text/unix2dos/files/digest-unix2dos-2.21
-rw-r--r--app-text/unix2dos/files/unix2dos-2.2-manpage.patch32
-rw-r--r--app-text/unix2dos/files/unix2dos-2.2-segfault.patch94
-rw-r--r--app-text/unix2dos/files/unix2dos-mkstemp.patch20
-rw-r--r--app-text/unix2dos/unix2dos-2.2.ebuild32
6 files changed, 187 insertions, 0 deletions
diff --git a/app-text/unix2dos/ChangeLog b/app-text/unix2dos/ChangeLog
new file mode 100644
index 000000000000..e9e3a01269ed
--- /dev/null
+++ b/app-text/unix2dos/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for app-text/unix2dos
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/unix2dos/ChangeLog,v 1.1 2002/12/01 06:03:15 vapier Exp $
+
+*unix2dos-2.2 (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/unix2dos/files/digest-unix2dos-2.2 b/app-text/unix2dos/files/digest-unix2dos-2.2
new file mode 100644
index 000000000000..2b5964287a59
--- /dev/null
+++ b/app-text/unix2dos/files/digest-unix2dos-2.2
@@ -0,0 +1 @@
+MD5 e4488c241fa9067a48a7534a21d4babb unix2dos-2.2.src.tar.gz 5898
diff --git a/app-text/unix2dos/files/unix2dos-2.2-manpage.patch b/app-text/unix2dos/files/unix2dos-2.2-manpage.patch
new file mode 100644
index 000000000000..f6ae1b83fa3f
--- /dev/null
+++ b/app-text/unix2dos/files/unix2dos-2.2-manpage.patch
@@ -0,0 +1,32 @@
+--- unix2dos-2.2/unix2dos.1.man Thu Jan 17 17:25:08 2002
++++ unix2dos-2.2/unix2dos.1 Thu Jan 17 17:25:35 2002
+@@ -16,7 +16,7 @@
+ .SH DESCRIPTION
+
+ .PP
+-This manual page documents dos2unix, the program that converts text
++This manual page documents unix2dos, the program that converts text
+ files in UNIX format to DOS format.
+
+ .SH OPTIONS
+@@ -40,7 +40,7 @@
+
+ .TP
+ .B \-c --convmode convmode
+-Sets conversion mode. Simulates dos2unix under SunOS.
++Sets conversion mode. Simulates unix2dos under SunOS.
+
+ .TP
+ .B \-o --oldfile file ...
+@@ -71,9 +71,9 @@
+ Convert and replace a.txt in ASCII conversion mode.
+ Convert and replace b.txt in ISO conversion mode.
+ .IP
+-.B dos2unix a.txt -c iso b.txt
++.B unix2dos a.txt -c iso b.txt
+ .IP
+-.B dos2unix -c ascii a.txt -c iso b.txt
++.B unix2dos -c ascii a.txt -c iso b.txt
+
+ .LP
+ Convert and replace a.txt while keeping original date stamp.
diff --git a/app-text/unix2dos/files/unix2dos-2.2-segfault.patch b/app-text/unix2dos/files/unix2dos-2.2-segfault.patch
new file mode 100644
index 000000000000..a92f57cfe70c
--- /dev/null
+++ b/app-text/unix2dos/files/unix2dos-2.2-segfault.patch
@@ -0,0 +1,94 @@
+--- unix2dos-2.2/unix2dos.c.segf Thu Jan 17 17:09:49 2002
++++ unix2dos-2.2/unix2dos.c Thu Jan 17 17:12:47 2002
+@@ -131,9 +131,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));
+ }
+
+
+@@ -207,14 +207,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("Can't open output temp file");
++ RetVal = -1;
++ }
+
+ #ifdef DEBUG
+ fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -225,7 +228,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;
+@@ -243,6 +246,9 @@
+ if ((TempF) && (fclose(TempF) == EOF))
+ RetVal = -1;
+
++ if(fd>=0)
++ close(fd);
++
+ if ((!RetVal) && (ipFlag->KeepDate))
+ {
+ UTimeBuf.actime = StatBuf.st_atime;
+@@ -286,14 +292,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("Can't open output temp file");
++ RetVal = -1;
++ }
+
+ #ifdef DEBUG
+ fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -304,7 +313,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;
+@@ -322,6 +331,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/unix2dos/files/unix2dos-mkstemp.patch b/app-text/unix2dos/files/unix2dos-mkstemp.patch
new file mode 100644
index 000000000000..034e0a00b686
--- /dev/null
+++ b/app-text/unix2dos/files/unix2dos-mkstemp.patch
@@ -0,0 +1,20 @@
+--- unix2dos-2.2/unix2dos.c.orig Fri Nov 17 13:29:24 2000
++++ unix2dos-2.2/unix2dos.c Fri Nov 17 13:30:16 2000
+@@ -214,7 +214,7 @@
+
+ strcpy (TempPath, "./u2dtmp");
+ strcat (TempPath, "XXXXXX");
+- mktemp (TempPath);
++ mkstemp (TempPath);
+
+ #ifdef DEBUG
+ fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -293,7 +293,7 @@
+
+ strcpy (TempPath, "./u2dtmp");
+ strcat (TempPath, "XXXXXX");
+- mktemp (TempPath);
++ mkstemp (TempPath);
+
+ #ifdef DEBUG
+ fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
diff --git a/app-text/unix2dos/unix2dos-2.2.ebuild b/app-text/unix2dos/unix2dos-2.2.ebuild
new file mode 100644
index 000000000000..b2f9a99878cf
--- /dev/null
+++ b/app-text/unix2dos/unix2dos-2.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/unix2dos/unix2dos-2.2.ebuild,v 1.1 2002/12/01 06:03:15 vapier Exp $
+
+DESCRIPTION="unix2dos - UNIX to DOS text file format converter"
+HOMEPAGE=""
+SRC_URI="mirror://gentoo/${P}.src.tar.gz"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="x86"
+
+DEPEND=""
+RDEPEND="!app-text/hd2u"
+
+S=${WORKDIR}
+
+src_unpack() {
+ unpack ${A}
+ patch -p1 < ${FILESDIR}/${PN}-mkstemp.patch || die
+ patch -p1 < ${FILESDIR}/${P}-segfault.patch || die
+ patch -p1 < ${FILESDIR}/${P}-manpage.patch || die
+}
+
+src_compile() {
+ gcc ${CFLAGS} -o unix2dos unix2dos.c || die
+}
+
+src_install() {
+ dobin unix2dos
+ doman unix2dos.1
+}