From f9390d74d3882897edce0f2c2cee986ec003916761fae45cb4f0418e49e6a9b2 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 15 Jan 2007 23:10:31 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dos2unix?expand=0&rev=1 --- .gitattributes | 23 +++++++ .gitignore | 1 + dos2unix-3.1-preserve-file-modes.patch | 28 ++++++++ dos2unix-3.1-segfault.patch | 93 ++++++++++++++++++++++++++ dos2unix-3.1.patch | 49 ++++++++++++++ dos2unix-3.1.tar.bz2 | 3 + dos2unix.changes | 25 +++++++ dos2unix.spec | 75 +++++++++++++++++++++ ready | 0 9 files changed, 297 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 dos2unix-3.1-preserve-file-modes.patch create mode 100644 dos2unix-3.1-segfault.patch create mode 100644 dos2unix-3.1.patch create mode 100644 dos2unix-3.1.tar.bz2 create mode 100644 dos2unix.changes create mode 100644 dos2unix.spec create mode 100644 ready diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/dos2unix-3.1-preserve-file-modes.patch b/dos2unix-3.1-preserve-file-modes.patch new file mode 100644 index 0000000..0244a4a --- /dev/null +++ b/dos2unix-3.1-preserve-file-modes.patch @@ -0,0 +1,28 @@ +--- dos2unix.c. 2003-05-21 08:09:08.000000000 -0700 ++++ dos2unix.c 2003-05-21 08:09:56.000000000 -0700 +@@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN + char TempPath[16]; + struct stat StatBuf; + struct utimbuf UTimeBuf; ++ mode_t mode = S_IRUSR | S_IWUSR; + int fd; + + /* retrieve ipInFN file date stamp */ +- if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) ++ if (stat(ipInFN, &StatBuf)) + RetVal = -1; ++ else ++ mode = StatBuf.st_mode; + + strcpy (TempPath, "./u2dtmpXXXXXX"); + if((fd=mkstemp (TempPath))<0) { +@@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN + RetVal = -1; + } + ++ if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR)) ++ RetVal = -1; ++ + #ifdef DEBUG + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); + #endif DEBUG diff --git a/dos2unix-3.1-segfault.patch b/dos2unix-3.1-segfault.patch new file mode 100644 index 0000000..d61a11f --- /dev/null +++ b/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/dos2unix-3.1.patch b/dos2unix-3.1.patch new file mode 100644 index 0000000..2f9acd5 --- /dev/null +++ b/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); diff --git a/dos2unix-3.1.tar.bz2 b/dos2unix-3.1.tar.bz2 new file mode 100644 index 0000000..74416ab --- /dev/null +++ b/dos2unix-3.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e571d6f334809cecf064da32e8be95132e69a30020e7f3009bb80455f093a94 +size 13400 diff --git a/dos2unix.changes b/dos2unix.changes new file mode 100644 index 0000000..38ad7f0 --- /dev/null +++ b/dos2unix.changes @@ -0,0 +1,25 @@ +------------------------------------------------------------------- +Tue Apr 11 12:12:57 CEST 2006 - pth@suse.de + +- Make dos2unix preserve file modes (bugzilla #119350). + +------------------------------------------------------------------- +Wed Jan 25 21:35:33 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Wed Oct 5 13:21:19 CEST 2005 - dmueller@suse.de + + - add norootforbuild + +------------------------------------------------------------------- +Mon Aug 12 17:52:01 MEST 2002 - bk@suse.de + +- update to dos2unix-3.1(no longer uses hd2u, but real dos2unix) + +------------------------------------------------------------------- +Wed Jun 19 17:58:10 CEST 2002 - postadal@suse.cz + +- new package dos2unix verison 0.8.0 + diff --git a/dos2unix.spec b/dos2unix.spec new file mode 100644 index 0000000..d6eec41 --- /dev/null +++ b/dos2unix.spec @@ -0,0 +1,75 @@ +# +# spec file for package dos2unix (Version 3.1) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: dos2unix +Summary: A DOS to UNIX Text Converter +Version: 3.1 +Release: 313 +Group: Productivity/Text/Convertors +License: Other License(s), see package, distributable +Source: %{name}-%{version}.tar.bz2 +Patch0: %{name}-%{version}.patch +Patch1: dos2unix-3.1-segfault.patch +Patch2: dos2unix-3.1-preserve-file-modes.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +dos2unix is used to convert plain text from DOS (CR/LF) format to UNIX +format (LF). + + + +Authors: +-------- + Benjamin Lin blin @ socs.uts.edu.au + +%prep +%setup -q +%patch0 -p1 -b .orig +%patch1 -p1 -b .segf +%patch2 -b .fmode +perl -pi -e 's,(#endif|#else)[^ ]*(.*),$1 /* $2 */,g' *.[ch] + +%build +make clean +make CFLAGS="$RPM_OPT_FLAGS" +make link + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} +install -m755 dos2unix $RPM_BUILD_ROOT%{_bindir} +install -m755 mac2unix $RPM_BUILD_ROOT%{_bindir} +install -m444 dos2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1 +install -m444 mac2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1 + +%files +%defattr(-,root,root,0755) +%doc COPYRIGHT +%{_bindir}/dos2unix +%{_bindir}/mac2unix +%{_mandir}/*/* + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog -n dos2unix +* Tue Apr 11 2006 - pth@suse.de +- Make dos2unix preserve file modes (bugzilla #119350). +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Wed Oct 05 2005 - dmueller@suse.de +- add norootforbuild +* Mon Aug 12 2002 - bk@suse.de +- update to dos2unix-3.1(no longer uses hd2u, but real dos2unix) +* Wed Jun 19 2002 - postadal@suse.cz +- new package dos2unix verison 0.8.0 diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4