From 115ba7bb8e5eedfdee2156a927441ca403e993d8 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 13 Nov 2010 06:08:42 +0000 Subject: [PATCH] - removed obsolete manpage-update,workaround-rename-EXDEV patches - pass __cc/rpmcflags/rpmcppflags/rpmldflags - package nl manpages - License is BSD Changed files: dos2unix-manpage-update.patch -> 1.3 dos2unix-workaround-rename-EXDEV.patch -> 1.2 dos2unix.spec -> 1.24 --- dos2unix-manpage-update.patch | 180 ------------------------- dos2unix-workaround-rename-EXDEV.patch | 56 -------- dos2unix.spec | 29 ++-- 3 files changed, 18 insertions(+), 247 deletions(-) delete mode 100644 dos2unix-manpage-update.patch delete mode 100644 dos2unix-workaround-rename-EXDEV.patch diff --git a/dos2unix-manpage-update.patch b/dos2unix-manpage-update.patch deleted file mode 100644 index bf59418..0000000 --- a/dos2unix-manpage-update.patch +++ /dev/null @@ -1,180 +0,0 @@ -Ripped from Fedora - -The dos2unix man page examples are confusing. -For instance, one piece of text mentions "c.txt", but that file -isn't used in the following example. - -Patch by Bill Anderson -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57507 - ---- dos2unix-5.1.1/man/man1/dos2unix.1~ -+++ dos2unix-5.1.1/man/man1/dos2unix.1 -@@ -4,127 +4,104 @@ - .SH NAME - - dos2unix \- DOS/MAC to UNIX text file format converter -+.SH SYNOPSIS - --.SH SYNOPSYS -- --dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...] --.PP --Options: --.PP --[-hkqV] [--help] [--keepdate] [--quiet] [--version] -+\fBdos2unix\fR [options] [\-c convmode] [\-o file ...] [\-n infile outfile ...] - -+\fBdos2unix\fR [\-hkqV] [\-\-help] [\-\-keepdate] [\-\-quiet] [\-\-version] - .SH DESCRIPTION - - .PP --This manual page documents dos2unix, the program that converts plain text -+This manual page documents \fBdos2unix\fR, the program that converts plain text - files in DOS/MAC format to UNIX format. -- - .SH OPTIONS - --The following options are available: - .TP --.B \-h --help -+.B \-h \-\-help - Print online help. -- - .TP --.B \-k --keepdate -+.B \-k \-\-keepdate - Keep the date stamp of output file same as input file. -- - .TP --.B \-q --quiet -+.B \-q \-\-quiet - Quiet mode. Suppress all warning and messages. -- - .TP --.B \-V --version -+.B \-V \-\-version - Prints version information. -- - .TP --.B \-c --convmode convmode --Sets conversion mode. Simulates dos2unix under SunOS. -- -+.B \-c \-\-convmode convmode -+Sets conversion mode. convmode is one of: -+.B ASCII, 7bit, ISO, Mac -+with ASCII being the default. Simulates dos2unix under SunOS. - .TP --.B \-o --oldfile file ... -+.B \-o \-\-oldfile file ... - Old file mode. Convert the file and write output to it. The program - default to run in this mode. Wildcard names may be used. -- - .TP --.B \-n --newfile infile outfile ... -+.B \-n \-\-newfile infile outfile ... - New file mode. Convert the infile and write output to outfile. File names - must be given in pairs and wildcard names should NOT be used or you WILL - lost your files. -- - .SH EXAMPLES - - .LP - Get input from stdin and write output to stdout. - .IP - .B dos2unix -- - .LP - Convert and replace a.txt. Convert and replace b.txt. - .IP - .B dos2unix a.txt b.txt - .IP --.B dos2unix -o a.txt b.txt -- -+.B dos2unix \-o a.txt b.txt - .LP - Convert and replace a.txt in ASCII conversion mode. -+.IP -+.B dos2unix a.txt \-c iso b.txt -+.LP - Convert and replace b.txt in ISO conversion mode. -+.IP -+.B dos2unix \-c ascii a.txt \-c iso b.txt -+.LP - Convert c.txt from Mac to Unix ascii format. - .IP --.B dos2unix a.txt -c iso b.txt --.IP --.B dos2unix -c ascii a.txt -c iso b.txt --.IP --.B dos2unix -c mac a.txt b.txt -- -+.B dos2unix \-c mac c.txt b.txt - .LP - Convert and replace a.txt while keeping original date stamp. - .IP --.B dos2unix -k a.txt -+.B dos2unix \-k a.txt - .IP --.B dos2unix -k -o a.txt -- -+.B dos2unix \-k \-o a.txt - .LP - Convert a.txt and write to e.txt. - .IP --.B dos2unix -n a.txt e.txt -- -+.B dos2unix \-n a.txt e.txt - .LP - Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. - .IP --.B dos2unix -k -n a.txt e.txt -- -+.B dos2unix \-k \-n a.txt e.txt - .LP - Convert and replace a.txt. Convert b.txt and write to e.txt. - .IP --.B dos2unix a.txt -n b.txt e.txt -+.B dos2unix a.txt \-n b.txt e.txt - .IP --.B dos2unix -o a.txt -n b.txt e.txt -- -+.B dos2unix \-o a.txt \-n b.txt e.txt - .LP - Convert c.txt and write to e.txt. Convert and replace a.txt. - Convert and replace b.txt. Convert d.txt and write to f.txt. - .IP --.B dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt -- --.SH DIAGNOSTICS -- -+.B dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt - .SH BUGS - - The program does not work properly under MSDOS in stdio processing mode. - If you know why is that so, please tell me. -- - .SH AUTHORS - --Benjamin Lin - -+Benjamin Lin - .B -- -- -+.br - Bernd Johannes Wuebben (mac2unix mode) - .B -- -- - .SH MISCELLANY - - Tested environment: -@@ -136,7 +114,6 @@ - MS-DOS 6.20 with Borland C++ 4.02 - .PP - Suggestions and bug reports are welcome. -- - .SH SEE ALSO --unix2dos(1) mac2unix(1) -- -+.BR unix2dos (1), -+.BR mac2unix (1) diff --git a/dos2unix-workaround-rename-EXDEV.patch b/dos2unix-workaround-rename-EXDEV.patch deleted file mode 100644 index 71a3a69..0000000 --- a/dos2unix-workaround-rename-EXDEV.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ./dos2unix.c.orig 2007-04-17 11:16:32.000000000 +0400 -+++ ./dos2unix.c 2007-04-17 12:41:01.000000000 +0400 -@@ -279,7 +279,7 @@ - int RetVal = 0; - FILE *InF = NULL; - FILE *TempF = NULL; -- char TempPath[16]; -+ char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); - struct stat StatBuf; - struct utimbuf UTimeBuf; - int fd; -@@ -288,7 +288,8 @@ - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) - RetVal = -1; - -- strcpy (TempPath, "./d2utmpXXXXXX"); -+ strcpy (TempPath, ipInFN); -+ strcat (TempPath, "_u2dtmpXXXXXX"); - if((fd=mkstemp (TempPath))<0) { - perror("Failed to open output temp file"); - RetVal = -1; -@@ -349,6 +350,7 @@ - RetVal = -1; - } - } -+ free (TempPath); - return RetVal; - } - -@@ -364,7 +366,7 @@ - int RetVal = 0; - FILE *InF = NULL; - FILE *TempF = NULL; -- char TempPath[16]; -+ char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); - struct stat StatBuf; - struct utimbuf UTimeBuf; - mode_t mode = S_IRUSR | S_IWUSR; -@@ -376,7 +378,8 @@ - else - mode = StatBuf.st_mode; - -- strcpy (TempPath, "./u2dtmpXXXXXX"); -+ strcpy (TempPath, ipInFN); -+ strcat (TempPath, "_u2dtmpXXXXXX"); - if((fd=mkstemp (TempPath))<0) { - perror("Failed to open output temp file"); - RetVal = -1; -@@ -442,6 +445,7 @@ - } - RetVal = -1; - } -+ free (TempPath); - return RetVal; - } - diff --git a/dos2unix.spec b/dos2unix.spec index d4960fe..78eb557 100644 --- a/dos2unix.spec +++ b/dos2unix.spec @@ -8,14 +8,13 @@ Summary(zh_CN.UTF-8): 转换DOS或MAC文本文件到UNIX格式 Name: dos2unix Version: 5.1.1 Release: 1 -License: Freer than LGPL +License: BSD Group: Applications/Text Source0: http://www.xs4all.nl/~waterlan/dos2unix/%{name}-%{version}.tar.gz # Source0-md5: b8f6d8109fc6decf412bc1e3959450c0 +Patch0: %{name}-includes.patch URL: http://www.xs4all.nl/~waterlan/dos2unix.html -Patch2: %{name}-includes.patch -Patch3: %{name}-manpage-update.patch -Patch6: %{name}-workaround-rename-EXDEV.patch +Provides: unix2dos Obsoletes: unix2dos BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -42,22 +41,23 @@ dos2unix - конвертор текстових файлів DOS в форма %prep %setup -q -%patch2 -p1 -#%patch3 -p1 -#%patch6 -p1 +%patch0 -p1 %build -%{__make} +%{__make} \ + CC="%{__cc}" \ + RPM_OPT_FLAGS="%{rpmcflags} %{rpmcppflags}" \ + LDFLAGS="%{rpmldflags}" %install rm -rf $RPM_BUILD_ROOT + %{__make} install \ DESTDIR=$RPM_BUILD_ROOT +# dos2unix and unix2dos domains %find_lang %{name} --all-name -find $RPM_BUILD_ROOT - %clean rm -rf $RPM_BUILD_ROOT @@ -68,4 +68,11 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/mac2unix %attr(755,root,root) %{_bindir}/unix2dos %attr(755,root,root) %{_bindir}/unix2mac -%{_mandir}/man1/* +%{_mandir}/man1/dos2unix.1* +%{_mandir}/man1/mac2unix.1* +%{_mandir}/man1/unix2dos.1* +%{_mandir}/man1/unix2mac.1* +%lang(nl) %{_mandir}/nl/man1/dos2unix.1* +%lang(nl) %{_mandir}/nl/man1/mac2unix.1* +%lang(nl) %{_mandir}/nl/man1/unix2dos.1* +%lang(nl) %{_mandir}/nl/man1/unix2mac.1* -- 2.44.0