From 7973d77a989ce764f8629ea854eeac7dd4484a22ad6b6dd4dd163f1c6718a72f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 2 Jul 2007 12:40:15 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/editors/nedit?expand=0&rev=1 --- .gitattributes | 23 ++++++++ nedit-5.4-makefiles.patch | 23 ++++++++ nedit-5.4-security.patch | 61 ++++++++++++++++++++ nedit-5.5-nc-manfix.patch | 118 ++++++++++++++++++++++++++++++++++++++ nedit-5.5-src.tar.bz2 | 3 + nedit-5.5-utf8.patch | 52 +++++++++++++++++ nedit-5.5-varfix.patch | 11 ++++ nedit-icon.png | 3 + nedit.changes | 5 ++ nedit.desktop | 28 +++++++++ nedit.spec | 73 +++++++++++++++++++++++ openmotif.diff | 11 ++++ 12 files changed, 411 insertions(+) create mode 100644 .gitattributes create mode 100644 nedit-5.4-makefiles.patch create mode 100644 nedit-5.4-security.patch create mode 100644 nedit-5.5-nc-manfix.patch create mode 100644 nedit-5.5-src.tar.bz2 create mode 100644 nedit-5.5-utf8.patch create mode 100644 nedit-5.5-varfix.patch create mode 100644 nedit-icon.png create mode 100644 nedit.changes create mode 100644 nedit.desktop create mode 100644 nedit.spec create mode 100644 openmotif.diff 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/nedit-5.4-makefiles.patch b/nedit-5.4-makefiles.patch new file mode 100644 index 0000000..4d5aaf0 --- /dev/null +++ b/nedit-5.4-makefiles.patch @@ -0,0 +1,23 @@ +--- nedit-5.4/makefiles/Makefile.linux.makefiles 2003-05-20 02:27:56.000000000 +0200 ++++ nedit-5.4/makefiles/Makefile.linux 2004-03-17 15:28:40.000000000 +0100 +@@ -1,5 +1,5 @@ + # $Id: Makefile.linux,v 1.11 2003/05/20 00:27:56 n8gray Exp $ +-CC=cc ++CC=gcc + AR=ar + + # For editres, add -DEDITRES to CFLAGS and -lXmu to LIBS +@@ -17,11 +17,11 @@ + # To test if the Motif library exports the runtime version + # add -DHAVE__XMVERSIONSTRING to CFLAGS + # +-CFLAGS=-O -I/usr/X11R6/include -DUSE_DIRENT -DUSE_LPR_PRINT_CMD ++CFLAGS=-I/usr/X11R6/include $(RPM_OPT_FLAGS) -DUSE_DIRENT -DUSE_LPR_PRINT_CMD -DBUILD_UNTESTED_NEDIT + + ARFLAGS=-urs + +-LIBS= -L/usr/X11R6/lib -Wl,-Bstatic -lXm -Wl,-Bdynamic -lXp -lXpm -lXext -lXt -lSM -lICE -lX11 -lm ++LIBS= -lXm -lXmu -lXp -lXpm -lXext -lXt -lSM -lICE -lX11 -lm + + include Makefile.common + diff --git a/nedit-5.4-security.patch b/nedit-5.4-security.patch new file mode 100644 index 0000000..5f02654 --- /dev/null +++ b/nedit-5.4-security.patch @@ -0,0 +1,61 @@ +--- nedit-5.4/source/file.c.security 2003-09-28 16:18:12.000000000 +0200 ++++ nedit-5.4/source/file.c 2004-03-17 15:25:31.000000000 +0100 +@@ -1218,7 +1218,7 @@ + */ + void PrintString(const char *string, int length, Widget parent, const char *jobName) + { +- char tmpFileName[L_tmpnam]; /* L_tmpnam defined in stdio.h */ ++ char *tmpFileName=strdup("/tmp/neditXXXXXX"); + FILE *fp; + int fd; + +@@ -1229,14 +1229,10 @@ + 1. Create a filename + 2. Open the file with the O_CREAT|O_EXCL flags + So all an attacker can do is a DoS on the print function. */ +- tmpnam(tmpFileName); ++ fd = mkstemp(tmpFileName); + + /* open the temporary file */ +-#ifdef VMS +- if ((fp = fopen(tmpFileName, "w", "rfm = stmlf")) == NULL) +-#else +- if ((fd = open(tmpFileName, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR | S_IWUSR)) < 0 || (fp = fdopen(fd, "w")) == NULL) +-#endif /* VMS */ ++ if ((fp = fdopen(fd, "w")) == NULL) + { + DialogF(DF_WARN, parent, 1, "Error while Printing", + "Unable to write file for printing:\n%s", "Dismiss", +@@ -1250,7 +1246,7 @@ + + /* write to the file */ + #ifdef IBM_FWRITE_BUG +- write(fileno(fp), string, length); ++ write(fd, string, length); + #else + fwrite(string, sizeof(char), length, fp); + #endif +@@ -1260,6 +1256,7 @@ + "%s not printed:\n%s", "Dismiss", jobName, errorString()); + fclose(fp); /* should call close(fd) in turn! */ + remove(tmpFileName); ++ free(tmpFileName); + return; + } + +@@ -1270,6 +1267,7 @@ + "Error closing temp. print file:\n%s", "Dismiss", + errorString()); + remove(tmpFileName); ++ free(tmpFileName); + return; + } + +@@ -1281,6 +1279,7 @@ + PrintFile(parent, tmpFileName, jobName); + remove(tmpFileName); + #endif /*VMS*/ ++ free(tmpFileName); + return; + } + diff --git a/nedit-5.5-nc-manfix.patch b/nedit-5.5-nc-manfix.patch new file mode 100644 index 0000000..96a1ae5 --- /dev/null +++ b/nedit-5.5-nc-manfix.patch @@ -0,0 +1,118 @@ +--- nedit-5.5/doc/nc.man.nc-manfix 2004-09-30 23:03:59.000000000 +0200 ++++ nedit-5.5/doc/nc.man 2005-10-16 08:53:42.000000000 +0200 +@@ -128,30 +128,30 @@ + .rm #[ #] #H #V #F C + .\" ======================================================================== + .\" +-.IX Title "NC 1" +-.TH NC 1 "2004-07-21" "NEdit 5.5" "NEdit documentation" ++.IX Title "NEDIT-CLIENT 1" ++.TH NEDIT-CLIENT 1 "2004-07-21" "NEdit 5.5" "NEdit documentation" + .SH "NAME" +-nc \- Client program for NEdit text editor ++nedit-client \- Client program for NEdit text editor + .SH "SYNOPSYS" + .IX Header "SYNOPSYS" +-nc [\fB\-read\fR] [\fB\-create\fR] [\fB\-line\fR \fIn\fR | \fB+\fR\fIn\fR] [\fB\-do\fR \fIcommand\fR] +- [\fB\-ask\fR] [\fB\-noask\fR] [\fB\-svrname\fR \fIname\fR] [\fB\-svrcmd\fR \fIcommand\fR] +- [\fB\-lm\fR \fIlanguagemode\fR] +- [\fB\-geometry\fR \fIgeometry\fR | \fB\-g\fR \fIgeometry\fR] [\fB\-icon\fR | \fB\-iconic\fR] +- [\fB\-display\fR \fI[host]:server[.screen]\fR] +- [\fB\-timeout\fR \fIseconds\fR] [\fB\-wait\fR] [\fB\-xrm\fR \fIresourcestring\fR] +- [\fB\-tabbed\fR] [\fB\-untabbed\fR] [\fB\-group\fR] +- [\fB\-V\fR | \fB\-version\fR] [\fB\-\-\fR] [file...] ++nedit-client [\fB\-read\fR] [\fB\-create\fR] [\fB\-line\fR \fIn\fR | \fB+\fR\fIn\fR] [\fB\-do\fR \fIcommand\fR] ++ [\fB\-ask\fR] [\fB\-noask\fR] [\fB\-svrname\fR \fIname\fR] [\fB\-svrcmd\fR \fIcommand\fR] ++ [\fB\-lm\fR \fIlanguagemode\fR] ++ [\fB\-geometry\fR \fIgeometry\fR | \fB\-g\fR \fIgeometry\fR] [\fB\-icon\fR | \fB\-iconic\fR] ++ [\fB\-display\fR \fI[host]:server[.screen]\fR] ++ [\fB\-timeout\fR \fIseconds\fR] [\fB\-wait\fR] [\fB\-xrm\fR \fIresourcestring\fR] ++ [\fB\-tabbed\fR] [\fB\-untabbed\fR] [\fB\-group\fR] ++ [\fB\-V\fR | \fB\-version\fR] [\fB\-\-\fR] [file...] + .SH "DESCRIPTION" + .IX Header "DESCRIPTION" +-\&\fBnc\fR is the client interface to the NEdit text editor. A server can be started ++\&\fBnedit-client\fR is the client interface to the NEdit text editor. A server can be started + explicitly by running NEdit in server mode: + .PP + .Vb 1 + \& nedit -server + .Ve + .PP +-If no server is running, \fBnc\fR will start one unless configured otherwise. ++If no server is running, \fBnedit-client\fR will start one unless configured otherwise. + Client/server mode is useful for integrating NEdit with software development + environments, mailers, and other programs; or just as a quick way to open files + from the shell command line without starting a new NEdit session. +@@ -171,21 +171,21 @@ Go to line number \fIn\fR. + Execute an NEdit macro or action on the file following the \-do argument on the + command line. + .Sp +-If you use this command without a filename, \fBnc\fR would randomly choose one ++If you use this command without a filename, \fBnedit-client\fR would randomly choose one + window to focus and execute the macro in. + .IP "\fB\-ask\fR, \fB\-noask\fR" 4 + .IX Item "-ask, -noask" +-Instructs \fBnc\fR whether to automatically start a server if one is not ++Instructs \fBnedit-client\fR whether to automatically start a server if one is not + available. This overrides the X resource `nc.autoStart'. + .IP "\fB\-svrname\fR \fIname\fR" 4 + .IX Item "-svrname name" +-Explicitly instructs \fBnc\fR which server to connect to, an instance of ++Explicitly instructs \fBnedit-client\fR which server to connect to, an instance of + \&\fInedit\fR\|(1) with a corresponding \fB\-svrname\fR argument. By naming servers, you + can run several simultaneously, and direct files and commands specifically to + any one. + .IP "\fB\-svrcmd\fR \fIcommand\fR" 4 + .IX Item "-svrcmd command" +-The command which \fBnc\fR uses to start an NEdit server. It is also settable via ++The command which \fBnedit-client\fR uses to start an NEdit server. It is also settable via + the X resource `nc.serverCommand', by default, \fI\*(L"nedit \-server\*(R"\fR. + .IP "\fB\-lm\fR \fIlanguagemode\fR" 4 + .IX Item "-lm languagemode" +@@ -221,11 +221,11 @@ Under rare conditions (such as a slow co + increase the time-out period. In most cases, the default is fine. + .IP "\fB\-wait\fR" 4 + .IX Item "-wait" +-Instructs \fBnc\fR not to return to the shell until all files given ++Instructs \fBnedit-client\fR not to return to the shell until all files given + are closed. + .Sp +-Normally, \fBnc\fR returns once the files given in its command line +-are opened by the server. When this option is given, nc returns ++Normally, \fBnedit-client\fR returns once the files given in its command line ++are opened by the server. When this option is given, nedit-client returns + only after the last file given in this call is closed. + Note that this option affects all files, not only the ones + following this option in the command line. +@@ -262,11 +262,11 @@ for your display: + .Ve + .SH "NOTES" + .IX Header "NOTES" +-Communication between \fInc\fR\|(1) and \fInedit\fR\|(1) is through the X display. So as +-long as X windows is set up and working properly, \fBnc\fR will work properly +-as well. \fBnc\fR uses the `\s-1DISPLAY\s0' environment variable, the machine name and ++Communication between \fInedit-client\fR\|(1) and \fInedit\fR\|(1) is through the X display. So as ++long as X windows is set up and working properly, \fBnedit-client\fR will work properly ++as well. \fBnedit-client\fR uses the `\s-1DISPLAY\s0' environment variable, the machine name and + your user name to find the appropriate server, meaning, if you have several +-machines sharing a common file system, \fBnc\fR will not be able to find a server ++machines sharing a common file system, \fBnedit-client\fR will not be able to find a server + that is running on a machine with a different host name, even though it may be + perfectly appropriate for editing a given file. + .PP +@@ -275,12 +275,12 @@ command line, for example: + .IP "incorrect:" 4 + .IX Item "incorrect:" + .Vb 1 +-\& nc file.c -line 25 ++\& nedit-client file.c -line 25 + .Ve + .IP "correct:" 4 + .IX Item "correct:" + .Vb 1 +-\& nc -line 25 file.c ++\& nedit-client -line 25 file.c + .Ve + .PP + For more information see NEdit's online help, or \fInedit.doc\fR in the NEdit diff --git a/nedit-5.5-src.tar.bz2 b/nedit-5.5-src.tar.bz2 new file mode 100644 index 0000000..07c5cc9 --- /dev/null +++ b/nedit-5.5-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f6ae7205753080e8b047fb45759a7d6036b19396045c0b5c4a979441231966b +size 1124825 diff --git a/nedit-5.5-utf8.patch b/nedit-5.5-utf8.patch new file mode 100644 index 0000000..58af36e --- /dev/null +++ b/nedit-5.5-utf8.patch @@ -0,0 +1,52 @@ +--- nedit-5.5/source/nedit.c.utf8 2004-09-02 10:49:56.000000000 +0200 ++++ nedit-5.5/source/nedit.c 2004-12-27 09:59:40.997208056 +0100 +@@ -90,6 +90,7 @@ static int checkDoMacroArg(const char *m + static String neditLanguageProc(Display *dpy, String xnl, XtPointer closure); + static void maskArgvKeywords(int argc, char **argv, const char **maskArgs); + static void unmaskArgvKeywords(int argc, char **argv, const char **maskArgs); ++static void changeLocaleIfUTF8(void); + static void patchResourcesForVisual(void); + static void patchResourcesForKDEbug(void); + static void patchLocaleForMotif(void); +@@ -392,6 +393,8 @@ int main(int argc, char **argv) + /* Save the command which was used to invoke nedit for restart command */ + ArgV0 = argv[0]; + ++ changeLocaleIfUTF8(); ++ + /* Set locale for C library, X, and Motif input functions. + Reverts to "C" if requested locale not available. */ + XtSetLanguageProc(NULL, neditLanguageProc, NULL); +@@ -1035,6 +1038,32 @@ static String neditLanguageProc(Display + return setlocale(LC_ALL, NULL); /* re-query in case overwritten */ + } + ++static void changeLocaleIfUTF8(void) ++{ ++ char *locale; ++ ++ locale = getenv("LANG"); ++ if (!locale) { ++ locale = setlocale(LC_ALL, NULL); ++ } ++ ++ if (locale) { ++ char *ptr; ++ ++ ptr = strstr(locale, ".UTF-8"); ++ if (ptr) { ++ fprintf(stderr, "nedit: the current locale is utf8 (%s)\n", locale); ++ ++ ptr[0] = '\0'; ++ ++ setenv("LC_ALL", locale, 1); ++ locale = setlocale(LC_ALL, locale); ++ ++ fprintf(stderr, "nedit: changed locale to non-utf8 (%s)\n", locale); ++ } ++ } ++} ++ + static int sortAlphabetical(const void* k1, const void* k2) + { + const char* key1 = *(const char**)k1; diff --git a/nedit-5.5-varfix.patch b/nedit-5.5-varfix.patch new file mode 100644 index 0000000..3a47865 --- /dev/null +++ b/nedit-5.5-varfix.patch @@ -0,0 +1,11 @@ +--- nedit-5.5/source/server.c.varfix 2004-07-21 13:32:05.000000000 +0200 ++++ nedit-5.5/source/server.c 2005-01-12 11:12:08.989922248 +0100 +@@ -340,7 +340,7 @@ static void processServerCommandString(c + char *fullname, filename[MAXPATHLEN], pathname[MAXPATHLEN]; + char *doCommand, *geometry, *langMode, *inPtr; + int editFlags, stringLen = strlen(string); +- int lineNum, createFlag, readFlag, iconicFlag, lastIconic = 0, tabbed; ++ int lineNum, createFlag, readFlag, iconicFlag, lastIconic = 0, tabbed = 0; + int fileLen, doLen, lmLen, geomLen, charsRead, itemsRead; + WindowInfo *window, *lastFile = NULL; + long currentDesktop = QueryCurrentDesktop(TheDisplay, diff --git a/nedit-icon.png b/nedit-icon.png new file mode 100644 index 0000000..b581ac1 --- /dev/null +++ b/nedit-icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d3956f8fa051c051e472d491214afb494f7ec4bbc0b45cf4f0352714e7a26e6 +size 3216 diff --git a/nedit.changes b/nedit.changes new file mode 100644 index 0000000..396f876 --- /dev/null +++ b/nedit.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri Jun 29 14:44:56 CEST 2007 - drahn@suse.de + +- initial BS version + diff --git a/nedit.desktop b/nedit.desktop new file mode 100644 index 0000000..487803f --- /dev/null +++ b/nedit.desktop @@ -0,0 +1,28 @@ +[Desktop Entry] +Encoding=UTF-8 +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Comment=Text Editor +Comment[bg]=Nedit Ðåäàêòîð +Comment[ca]=Editor Nedit +Comment[cs]=Editor Nedit +Comment[eo]=redaktilo Nedit +Comment[et]=Tekstiredaktor Nedit +Comment[fi]=Nedit-editori +Comment[fr]=Éditeur Nedit +Comment[hu]=Nedit szövegszerkesztő +Comment[is]=Nedit-ritill +Comment[mk]=Nedit - лесен и моќен уредувач +Comment[pt]=Editor Nedit +Comment[ro]=Editorul Nedit +Comment[ru]=Редактор Nedit +Comment[sk]=Editor Nedit +Comment[sl]=Urejevalnik Nedit +Comment[uk]=Редактор Nedit +Name=Nedit +Name[et]=Tekstiredaktor Nedit +Name[ru]=NEdit +Exec=nedit %f +Icon=nedit-icon.png +Path= +Type=Application +Terminal=false diff --git a/nedit.spec b/nedit.spec new file mode 100644 index 0000000..649fe88 --- /dev/null +++ b/nedit.spec @@ -0,0 +1,73 @@ +Name: nedit +Version: 5.5 +Release: 1 +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: openmotif-devel update-desktop-files +%if 0%{?suse_version} <= 1010 +BuildRequires: xorg-x11-devel +%endif +Group: Applications/Editors +Summary: A GUI text editor +Source0: http://nedit.org/ftp/v5_5/nedit-%{version}-src.tar.bz2 +Source1: nedit-icon.png +Source2: nedit.desktop +Patch1: nedit-5.4-makefiles.patch +Patch2: nedit-5.4-security.patch +Patch3: nedit-5.5-utf8.patch +Patch4: nedit-5.5-varfix.patch +Patch5: nedit-5.5-nc-manfix.patch + +%description +NEdit is a GUI style plain text editor for workstations with the X Window System +and Motif. NEdit provides all of the standard menu, dialog, editing, +mouse support, macro extension language, syntax highlighting, +and a lot other nice features (and extensions for programmers). + +%prep +%setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +cp %{S:1} $RPM_BUILD_DIR/%{name}-%{version}/ +cp %{S:2} $RPM_BUILD_DIR/%{name}-%{version}/ + +%build +%if 0%{?suse_version} <= 1010 +make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -L/usr/X11R6/%{_lib}" \ + linux +%endif + +%if 0%{?suse_version} > 1010 +make RPM_OPT_FLAGS="$RPM_OPT_FLAGS" \ + linux +%endif + +%install +install -d -m 755 $RPM_BUILD_ROOT%{_bindir} +install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 +mv source/nc source/nedit-client +install -s -m 755 source/nedit source/nedit-client $RPM_BUILD_ROOT%{_bindir} +install -m 644 doc/nedit.man $RPM_BUILD_ROOT%{_mandir}/man1/nedit.1x +mv doc/nc.man doc/nedit-client.man +install -m 644 doc/nedit-client.man $RPM_BUILD_ROOT%{_mandir}/man1/nedit-client.1x +mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps/ +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications/ +install -m 644 nedit-icon.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/ +install -m 644 nedit.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ +%suse_update_desktop_file %name TextEditor + +%clean +rm -rf "$RPM_BUILD_ROOT" + +%files +%defattr(-,root,root) +%doc doc/nedit.doc README ReleaseNotes +%{_mandir}/*/* +%{_bindir}/* +%{_prefix}/share/applications/* +%{_datadir}/pixmaps/nedit-icon.png + + diff --git a/openmotif.diff b/openmotif.diff new file mode 100644 index 0000000..445f72f --- /dev/null +++ b/openmotif.diff @@ -0,0 +1,11 @@ +--- makefiles/Makefile.linux.orig 2007-04-23 14:29:04.000000000 +0200 ++++ makefiles/Makefile.linux 2007-04-23 14:29:40.000000000 +0200 +@@ -17,7 +17,7 @@ + # To test if the Motif library exports the runtime version + # add -DHAVE__XMVERSIONSTRING to CFLAGS + # +-CFLAGS=-O -I/usr/X11R6/include -DUSE_DIRENT -DUSE_LPR_PRINT_CMD ++CFLAGS=-O -I/usr/X11R6/include -DUSE_DIRENT -DUSE_LPR_PRINT_CMD -DBUILD_UNTESTED_NEDIT + + ARFLAGS=-urs +