rpms/emacs/devel battery-acpi-support.dpatch, NONE, 1.1 bzero-and-have-stdlib.dpatch, NONE, 1.1 coding-region-leak.dpatch, NONE, 1.1 detect-coding-iso2022.dpatch, NONE, 1.1 emacs-21.4-21.4a-diff.patch, NONE, 1.1 fix-batch-mode-signal-handling.dpatch, NONE, 1.1 fix-x-vs-no-x-diffs.dpatch, NONE, 1.1 pcl-cvs-format.dpatch, NONE, 1.1 python-completion-ignored-extensions.dpatch, NONE, 1.1 remote-files-permissions.dpatch, NONE, 1.1 save-buffer.dpatch, NONE, 1.1 scroll-margin.dpatch, NONE, 1.1 wrapper, NONE, 1.1 xfree86-4.3-modifiers.dpatch, NONE, 1.1 .cvsignore, 1.13, 1.14 emacs.spec, 1.40, 1.41 sources, 1.14, 1.15 movemail-CAN-2005-0100.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sun Apr 10 07:23:01 UTC 2005


Update of /cvs/dist/rpms/emacs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv22681

Modified Files:
	.cvsignore emacs.spec sources 
Added Files:
	battery-acpi-support.dpatch bzero-and-have-stdlib.dpatch 
	coding-region-leak.dpatch detect-coding-iso2022.dpatch 
	emacs-21.4-21.4a-diff.patch 
	fix-batch-mode-signal-handling.dpatch 
	fix-x-vs-no-x-diffs.dpatch pcl-cvs-format.dpatch 
	python-completion-ignored-extensions.dpatch 
	remote-files-permissions.dpatch save-buffer.dpatch 
	scroll-margin.dpatch wrapper xfree86-4.3-modifiers.dpatch 
Removed Files:
	movemail-CAN-2005-0100.patch 
Log Message:
- update to 21.4 movemail vulnerability release
  - no longer need movemail-CAN-2005-0100.patch
- replace %{_bindir}/emacs alternatives with a wrapper script (Warren Togami)
  to prevent it from disappearing when upgrading (Michal Jaegermann, 154326)
  - suffix the X emacs binaries with -x and the no X binaries with -nox
  - the wrapper script %{_bindir}/emacs-%%version runs emacs-x if installed or
    otherwise emacs-nox.  %{_bindir}/emacs is a symlink to the wrapper
- make emacs and emacs-nox own the subdirs in %{_libexecdir}
- add a bunch of fixes from debian's emacs21_21.4a-1 patch:
    battery-acpi-support.dpatch, bzero-and-have-stdlib.dpatch,
    coding-region-leak.dpatch, detect-coding-iso2022.dpatch,
    fix-batch-mode-signal-handling.dpatch, pcl-cvs-format.dpatch,
    python-completion-ignored-extensions.dpatch,
    remote-files-permissions.dpatch, save-buffer.dpatch, scroll-margin.dpatch,
    xfree86-4.3-modifiers.dpatch
  - add fix-x-vs-no-x-diffs.dpatch
    - define emacs_libexecdir
    - build both emacs and emacs-nox as %%{version}.1 and move common DOC file
      to emacs-common
    - suffix version in fns-%%{version}.1.el with -x and -nox respectively
- add 100 to elisp patches




--- NEW FILE battery-acpi-support.dpatch ---
#!/bin/sh -e
## battery-acpi-support.dpatch by Jerome Marant <jerome at debian.org>
##
## DP: ** Support for ACPI in battery.el has be added
## DP: Status: appears to be incorporated upstream
## DP: Provided by: Mario Lang <mlang at debian.org>
## DP: Date: Fri, 26 Sep 2003 15:30:43 +0200

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/jerome/pkg/emacs21/svn/emacs/lisp/battery.el emacs/lisp/battery.el
--- /home/jerome/pkg/emacs21/svn/emacs/lisp/battery.el	2003-09-26 19:57:43.000000000 +0200
+++ emacs/lisp/battery.el	2003-09-28 17:19:22.000000000 +0200
@@ -42,7 +42,10 @@
 (defcustom battery-status-function
   (cond ((and (eq system-type 'gnu/linux)
 	      (file-readable-p "/proc/apm"))
-	 'battery-linux-proc-apm))
+	 'battery-linux-proc-apm)
+	((and (eq system-type 'gnu/linux)
+	      (file-directory-p "/proc/acpi/battery"))
+	 'battery-linux-proc-acpi))
   "*Function for getting battery status information.
 The function has to return an alist of conversion definitions.
 Its cons cells are of the form
@@ -56,7 +59,9 @@
 
 (defcustom battery-echo-area-format
   (cond ((eq battery-status-function 'battery-linux-proc-apm)
-	 "Power %L, battery %B (%p%% load, remaining time %t)"))
+	 "Power %L, battery %B (%p%% load, remaining time %t)")
+	((eq battery-status-function 'battery-linux-proc-acpi)
+	 "Power %L, battery %B at %r (%p%% load, remaining time %t)"))
   "*Control string formatting the string to display in the echo area.
 Ordinary characters in the control string are printed as-is, while
 conversion specifications introduced by a `%' character in the control
@@ -70,7 +75,9 @@
 
 (defcustom battery-mode-line-format
   (cond ((eq battery-status-function 'battery-linux-proc-apm)
-	 " [%b%p%%]"))
+	 " [%b%p%%]")
+	((eq battery-status-function 'battery-linux-proc-acpi)
+	 " [%b%p%%,%d°C]"))
   "*Control string formatting the string to display in the mode line.
 Ordinary characters in the control string are printed as-is, while
 conversion specifications introduced by a `%' character in the control
@@ -217,6 +224,122 @@
 	  (cons ?h (or (and hours (number-to-string hours)) "N/A"))
 	  (cons ?t (or remaining-time "N/A")))))
 
+
+;;; `/proc/acpi/' interface for Linux.
+
+(defun battery-linux-proc-acpi ()
+  "Get ACPI status information from Linux kernel.
+This function works only with the new `/proc/acpi/' format introduced
+in Linux version 2.4.20 and 2.6.0.
+
+The following %-sequences are provided:
+%c Current capacity (mAh)
+%B Battery status (verbose)
+%b Battery status, empty means high, `-' means low,
+   `!' means critical, and `+' means charging
+%d Temperature (in degrees Celsius)
+%L AC line status (verbose)
+%p battery load percentage
+%m Remaining time in minutes
+%h Remaining time in hours
+%t Remaining time in the form `h:min'"
+  (let (capacity design-capacity rate rate-type charging-state warn low
+		 minutes hours)
+    ;; ACPI provides information about each battery present in the system in
+    ;; a separate subdirectory.  We are going to merge the available
+    ;; information together since displaying for a variable amount of
+    ;; batteries seems overkill for format-strings.
+    (mapc
+     (lambda (dir)
+       (with-temp-buffer
+	 (battery-insert-file-contents (expand-file-name "state" dir))
+	 (when (re-search-forward "present: +yes$" nil t)
+	   (and (re-search-forward "charging state: +\\(.*\\)$" nil t)
+		(or (null charging-state) (string= charging-state
+						   "unknown"))
+		;; On most multi-battery systems, most of the time only one
+		;; battery is "charging"/"discharging", the others are
+		;; "unknown".
+		(setq charging-state (match-string 1)))
+	   (when (re-search-forward "present rate: +\\([0-9]+\\) \\(m[AW]\\)$"
+				    nil t)
+	     (setq rate (+ (or rate 0) (string-to-int (match-string 1)))
+		   rate-type (or (and rate-type
+				      (if (string= rate-type (match-string 2))
+					  rate-type
+					(error
+					 "Inconsistent rate types (%s vs. %s)"
+					 rate-type (match-string 2))))
+				 (match-string 2))))
+	   (when (re-search-forward "remaining capacity: +\\([0-9]+\\) m[AW]h$"
+				    nil t)
+	     (setq capacity
+		   (+ (or capacity 0) (string-to-int (match-string 1))))))
+	 (goto-char (point-max))
+	 (battery-insert-file-contents (expand-file-name "info" dir))
+	 (when (re-search-forward "present: +yes$" nil t)
+	   (when (re-search-forward "design capacity: +\\([0-9]+\\) m[AW]h$"
+				    nil t)
+	     (setq design-capacity (+ (or design-capacity 0)
+				      (string-to-int (match-string 1)))))
+	   (when (re-search-forward "design capacity warning: +\\([0-9]+\\) m[AW]h$"
+				    nil t)
+	     (setq warn (+ (or warn 0) (string-to-int (match-string 1)))))
+	   (when (re-search-forward "design capacity low: +\\([0-9]+\\) m[AW]h$"
+				    nil t)
+	     (setq low (+ (or low 0)
+			  (string-to-int (match-string 1))))))))
+     (directory-files "/proc/acpi/battery/" t "BAT"))
+    (and capacity rate
+	 (setq minutes (if (zerop rate) 0
+			 (floor (* (/ (float (if (string= charging-state
+							  "charging")
+						 (- design-capacity capacity)
+					       capacity)) rate) 60)))
+	       hours (/ minutes 60)))
+    (list (cons ?c (or (and capacity (number-to-string capacity)) "N/A"))
+	  (cons ?L (or (when (file-exists-p "/proc/acpi/ac_adapter/AC/state")
+			 (with-temp-buffer
+			   (battery-insert-file-contents
+			    "/proc/acpi/ac_adapter/AC/state")
+			   (when (re-search-forward "state: +\\(.*\\)$" nil t)
+			     (match-string 1))))
+		       "N/A"))
+	  (cons ?d (or (when (file-exists-p
+			      "/proc/acpi/thermal_zone/THRM/temperature")
+			 (with-temp-buffer
+			   (battery-insert-file-contents
+			    "/proc/acpi/thermal_zone/THRM/temperature")
+			   (when (re-search-forward
+				  "temperature: +\\([0-9]+\\) C$" nil t)
+			     (match-string 1))))
+		       (when (file-exists-p
+			      "/proc/acpi/thermal_zone/THM/temperature")
+			 (with-temp-buffer
+			   (battery-insert-file-contents
+			    "/proc/acpi/thermal_zone/THM/temperature")
+			   (when (re-search-forward
+				  "temperature: +\\([0-9]+\\) C$" nil t)
+			     (match-string 1))))
+		       "N/A"))
+	  (cons ?r (or (and rate (concat (number-to-string rate) " "
+					 rate-type)) "N/A"))
+	  (cons ?B (or charging-state "N/A"))
+	  (cons ?b (or (and (string= charging-state "charging") "+")
+		       (and low (< capacity low) "!")
+	               (and warn (< capacity warn) "-")
+	               ""))
+	  (cons ?h (or (and hours (number-to-string hours)) "N/A"))
+	  (cons ?m (or (and minutes (number-to-string minutes)) "N/A"))
+	  (cons ?t (or (and minutes
+			    (format "%d:%02d" hours (- minutes (* 60 hours))))
+		       "N/A"))
+	  (cons ?p (or (and design-capacity capacity
+			    (number-to-string
+			     (floor (/ capacity
+				       (/ (float design-capacity) 100)))))
+		       "N/A")))))
+
 
 ;;; Private functions.
 


--- NEW FILE bzero-and-have-stdlib.dpatch ---
#! /bin/sh -e
## 500-bzero-and-have-stdlib.dpatch by Rob Browning <rlb at defaultvalue.org>
##
## DP: ** Emacs uses memset, memcmp, and mmove rather than deprecated functions.
## DP: Status: sent-upstream, pending (all but mem* fixes already fixed upstream)
## DP: 
## DP: #defines have been added to arrange for Emacs to use memset, memcmp,
## DP: and memmove instead of bzero, bcmp, and bcopy.
## DP: 
## DP: ** HAVE_STDLIB_H checks have been added in various places.
## DP: Author: rlb
## DP: Status: sent-upstream, pending
## DP: 
## DP: Primarily in lib-src.

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
	*)
		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
		exit 1;;
esac

exit 0
@DPATCH@
--- emacs21-21.2.orig/src/config.in
+++ emacs21-21.2/src/config.in
@@ -531,6 +538,10 @@
 #endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+/* Don't use deprecated functions.  */
+#define bzero(data, size) memset(data, '\0', size)
+#define bcmp memcmp
+#define bcopy(a,b,c) memmove(b,a,c)
 #endif
 #endif
 
--- emacs21-21.2.orig/lib-src/yow.c
+++ emacs21-21.2/lib-src/yow.c
@@ -10,6 +10,7 @@
  * With dynamic memory allocation.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <../src/epaths.h>      /* For PATH_DATA.  */
@@ -33,7 +34,9 @@
     &res;})
 #endif
 
+#ifndef HAVE_STDLIB_H		/* config.h includes stdlib.  */
 char *malloc(), *realloc();
+#endif
 
 void yow();
 void setup_yow();
--- emacs21-21.2.orig/lib-src/cvtmail.c
+++ emacs21-21.2/lib-src/cvtmail.c
@@ -33,11 +33,14 @@
  * Author: Larry Kolodney, 1985
  */
 
-
+#include "config.h"
 #include <stdio.h>
 
+#ifndef HAVE_STDLIB_H		/* config.h includes stdlib.  */
 char *malloc ();
 char *realloc ();
+#endif
+
 char *getenv ();
 
 char *xmalloc ();


--- NEW FILE coding-region-leak.dpatch ---
#! /bin/sh -e
## coding-region-leak.dpatch by Florian Weimer <fw at deneb.enyo.de>
##
## All lines beginning with `## DP:' are a description of the patch.

## DP: This patch fixes a long-standing memory leak in decode-coding-region
## DP: and similar routines.
## DP: Authors: Kenichi Handa and Florian Weimer
## DP: Status: has been incorporated upstream
## DP: Date: Fri,  8 Oct 2004 23:13:59 +0200

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/callproc.c emacs21-21.3+1/src/callproc.c
--- /home/fw/debian/tmp/emacs21-21.3+1/src/callproc.c	2002-07-09 02:02:36.000000000 +0200
+++ emacs21-21.3+1/src/callproc.c	2004-09-30 09:44:42.000000000 +0200
@@ -790,6 +790,8 @@
 		  {
 		    detect_coding (&process_coding, bufptr, nread);
 		    if (process_coding.composing != COMPOSITION_DISABLED)
+		      /* We have not yet allocated the composition
+			 data because the coding type was undecided.  */
 		      coding_allocate_composition_data (&process_coding, PT);
 		  }
 		if (process_coding.cmp_data)
diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/coding.c emacs21-21.3+1/src/coding.c
--- /home/fw/debian/tmp/emacs21-21.3+1/src/coding.c	2003-03-16 23:06:55.000000000 +0100
+++ emacs21-21.3+1/src/coding.c	2004-09-30 09:44:42.000000000 +0200
@@ -5489,8 +5489,11 @@
 	coding_allocate_composition_data (coding, from);
     }
 
-  /* Try to skip the heading and tailing ASCIIs.  */
-  if (coding->type != coding_type_ccl)
+  /* Try to skip the heading and tailing ASCIIs.  We can't skip them
+     if we must run CCL program or there are compositions to
+     encode.  */
+  if (coding->type != coding_type_ccl
+      && (! coding->cmp_data || coding->cmp_data->used == 0))
     {
       int from_byte_orig = from_byte, to_byte_orig = to_byte;
 
@@ -5506,6 +5509,7 @@
 	  if (!replace)
 	    /* We must record and adjust for this new text now.  */
 	    adjust_after_insert (from, from_byte_orig, to, to_byte_orig, len);
+	  coding_free_composition_data (coding);
 	  return 0;
 	}
 
@@ -6106,12 +6110,16 @@
     coding_save_composition (coding, from, to, str);
 
   /* Try to skip the heading and tailing ASCIIs.  */
-  if (coding->type != coding_type_ccl)
+  if (coding->type != coding_type_ccl
+      && (! coding->cmp_data || coding->cmp_data->used == 0))
     {
       SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data,
 				1);
       if (from == to_byte)
-	return (nocopy ? str : Fcopy_sequence (str));
+ 	{
+ 	  coding_free_composition_data (coding);
+ 	  return (nocopy ? str : Fcopy_sequence (str));
+ 	}
       shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte);
     }
 
diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/fileio.c emacs21-21.3+1/src/fileio.c
--- /home/fw/debian/tmp/emacs21-21.3+1/src/fileio.c	2003-02-04 11:52:40.000000000 +0100
+++ emacs21-21.3+1/src/fileio.c	2004-09-30 09:44:42.000000000 +0200
@@ -4087,7 +4087,7 @@
       if (how_much < 0)
 	{
 	  xfree (conversion_buffer);
-
+	  coding_free_composition_data (&coding);
 	  if (how_much == -1)
 	    error ("IO error reading %s: %s",
 		   XSTRING (orig_filename)->data, emacs_strerror (errno));
@@ -4109,6 +4109,7 @@
       if (bufpos == inserted)
 	{
 	  xfree (conversion_buffer);
+	  coding_free_composition_data (&coding);
 	  emacs_close (fd);
 	  specpdl_ptr--;
 	  /* Truncate the buffer to the size of the file.  */
diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/process.c emacs21-21.3+1/src/process.c
--- /home/fw/debian/tmp/emacs21-21.3+1/src/process.c	2003-03-16 23:06:56.000000000 +0100
+++ emacs21-21.3+1/src/process.c	2004-09-30 09:44:42.000000000 +0200
@@ -3347,6 +3347,7 @@
       object = XPROCESS (proc)->encoding_buf;
       encode_coding (coding, (char *) buf, XSTRING (object)->data,
 		     len, STRING_BYTES (XSTRING (object)));
+      coding_free_composition_data (coding);
       len = coding->produced;
       buf = XSTRING (object)->data;
       if (temp_buf)


--- NEW FILE detect-coding-iso2022.dpatch ---
#!/bin/sh -e
## 500-detect-coding-iso2022.dpatch by Kenichi Handa <handa at etl.go.jp>
##
## All lines beginning with `## DP:' are a description of the patch.

## DP: ** An upstream fix has been incorporated for cases where emacs
## DP: might modify a binary file even when asked to use a raw-text
## DP: encoding during a save.
## DP: Author: Kenichi Handa <handa at etl.go.jp> 
## DP: Status: backported from upstream fix of 2002-07-26

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/rlb/deb/emacs21/trunk/src/coding.c trunk/src/coding.c
--- /home/rlb/deb/emacs21/trunk/src/coding.c	2003-09-09 17:28:48.000000000 -0500
+++ trunk/src/coding.c	2003-09-11 22:16:16.000000000 -0500
@@ -1359,6 +1359,7 @@
   while (mask && src < src_end)
     {
       ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
+    retry:
       switch (c)
 	{
 	case ISO_CODE_ESC:
@@ -1556,6 +1557,8 @@
 		  && mask & CODING_CATEGORY_MASK_ISO_8_2)
 		{
 		  int i = 1;
+
+		  c = -1;
 		  while (src < src_end)
 		    {
 		      ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep);
@@ -1568,6 +1571,9 @@
 		    mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
 		  else
 		    mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
+		  if (c >= 0)
+		    /* This means that we have read one extra byte.  */
+		    goto retry;
 		}
 	    }
 	  break;

emacs-21.4-21.4a-diff.patch:
 PROBLEMS |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+)

--- NEW FILE emacs-21.4-21.4a-diff.patch ---
diff -ur emacs-21.4/etc/PROBLEMS emacs-21.4a/etc/PROBLEMS
--- emacs-21.4/etc/PROBLEMS	2002-12-04 21:38:23.000000000 +0900
+++ emacs-21.4a/etc/PROBLEMS	2005-02-17 22:00:03.000000000 +0900
@@ -136,6 +136,33 @@
 which can be used to unpack `.tar.gz' and `.zip' archives without
 mangling them.
 
+* Segfault during `make bootstrap' under certain recent versions of the Linux kernel.
+
+With certain recent Linux kernels (like the one of Fedora Core),
+the new "Exec-shield" functionality is enabled by default, which
+creates a different memory layout that breaks the emacs dumper.
+
+You can check the Exec-shield state like this:
+
+    cat /proc/sys/kernel/exec-shield
+
+It returns non-zero when Exec-shield is enabled, 0 otherwise.  Please
+read your system documentation for more details on Exec-shield and
+associated commands.  Exec-shield can be turned off with this command:
+
+    echo "0" > /proc/sys/kernel/exec-shield
+
+When Exec-shield is enabled, building Emacs will segfault during the
+execution of this command:
+
+    ./temacs --batch --load loadup [dump|bootstrap]
+
+To work around this problem, it is necessary to temporarily disable
+Exec-shield while building Emacs, or, on x86, by using the `setarch'
+command when running temacs like this:
+
+    setarch i386 ./temacs --batch --load loadup [dump|bootstrap]
+
 * Emacs crashes when dumping itself on Mac PPC running Yellow Dog GNU/Linux.
 
 The crashes happen inside the function Fmake_symbol; here's a typical


--- NEW FILE fix-batch-mode-signal-handling.dpatch ---
#! /bin/sh -e
## fix-batch-mode-signal-handling.dpatch by  <rlb at defaultvalue.org>
##
## DP: ** A problem with emacs non-interactive signal handling has been fixed.
## DP: An upstream patch from 2003-06-21 was backported to fix Bug#253887.
## DP: Under certain conditions running "emacs --batch ... < /dev/null" would
## DP: trigger a process exit via SIGIO or SIGHUP.  This has been fixed.
## DP: Status: patch backported from upstream.

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/rlb/deb/emacs/trunk-21/src/keyboard.c trunk-21/src/keyboard.c
--- /home/rlb/deb/emacs/trunk-21/src/keyboard.c	2003-09-09 17:26:14.000000000 -0500
+++ trunk-21/src/keyboard.c	2004-07-18 17:10:35.000000000 -0500
@@ -6186,7 +6186,12 @@
 	/* ??? Is it really right to send the signal just to this process
 	   rather than to the whole process group?
 	   Perhaps on systems with FIONREAD Emacs is alone in its group.  */
-	kill (getpid (), SIGHUP);
+        {
+          if (! noninteractive)
+            kill (getpid (), SIGHUP);
+          else
+            n_to_read = 0;
+        }
       if (n_to_read == 0)
 	return 0;
       if (n_to_read > sizeof cbuf)
diff -urNad /home/rlb/deb/emacs/trunk-21/src/process.c trunk-21/src/process.c
--- /home/rlb/deb/emacs/trunk-21/src/process.c	2003-09-09 17:28:35.000000000 -0500
+++ trunk-21/src/process.c	2004-07-18 17:11:21.000000000 -0500
@@ -2734,7 +2734,7 @@
 	 but select says there is input.  */
 
       if (XINT (read_kbd) && interrupt_input
-	  && keyboard_bit_set (&Available))
+	  && keyboard_bit_set (&Available) && ! noninteractive)
 	kill (getpid (), SIGIO);
 #endif
 


--- NEW FILE fix-x-vs-no-x-diffs.dpatch ---
#! /bin/sh -e
## 501-fix-x-vs-no-x-diffs.dpatch by Rob Browning <rlb at defaultvalue.org>
##
## DP: ** Building --with-x=yes and --with-x=no creates very few differences now.
## DP: Author: rlb in consulatation with emacs-devel.
## DP: 
## DP: Eliminate as many differences between --with-x=yes and --with-x=no
## DP: versions of emacs as possible, and accommodate the rest.
## DP: 
## DP: Make sure that the DOC files generated with and without X,
## DP: i.e. --with-x=yes and --with-x=no, are the same.
## DP: 
## DP: Make sure that cus-dep.el generation doesn't fail by fixing some
## DP: problems with a couple of defcustom forms.  Without the fix, the
## DP: computation of custom-where in cus-dep.el fails because the defcustom
## DP: eval fails.  The gnus-art.el fix does copy/paste the value of
## DP: gnus-article-compface-xbm from gnus-ems to gnus-art.  This doesn't
## DP: look like it should hurt anything, but it'd be better to fix this
## DP: "right" in the long term.
## DP: 
## DP: Sort the custom-group entries in cus-dep before generating
## DP: custom-loads so the output doesn't differ from run-to-run.
## DP: 
## DP: Add a tag so that we can insert our own name for the fns-*.el file
## DP: into help.el at package build time.  fns-*.el is the only difference
## DP: remaining, and we just allow two versions, fns-*-x.el and fns-*-nox.el
## DP: and arrange for help.el to load the right one.

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
	*)
		echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
		exit 1;;
esac

exit 0
@DPATCH@
diff -ru 0/lisp/scroll-bar.el 1/lisp/scroll-bar.el
--- 0/lisp/scroll-bar.el	2002-09-15 17:14:25.000000000 -0500
+++ 1/lisp/scroll-bar.el	2002-09-15 17:15:39.000000000 -0500
@@ -99,6 +99,7 @@
 		 (const left)
 		 (const right))
   :group 'frames
+  :initialize 'custom-initialize-default
   :set 'set-scroll-bar-mode-1)
 
 ;; We just set scroll-bar-mode, but that was the default.
diff -ru 0/lisp/gnus/gnus-art.el 1/lisp/gnus/gnus-art.el
--- 0/lisp/gnus/gnus-art.el	2002-03-22 11:03:55.000000000 -0600
+++ 1/lisp/gnus/gnus-art.el	2002-09-15 16:42:46.000000000 -0500
@@ -207,7 +207,10 @@
   (if (and (fboundp 'image-type-available-p)
 	   (image-type-available-p 'xbm))
       'gnus-article-display-xface
-    (if gnus-article-compface-xbm
+    (if (or (and (boundp 'gnus-article-compface-xbm)
+                 gnus-article-compface-xbm)
+            (eq 0 (string-match "#define"
+                                (shell-command-to-string "uncompface -X"))))
 	"{ echo '/* Width=48, Height=48 */'; uncompface; } | display -"
       "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \
 display -"))
--- 0/lisp/cus-dep.el	2002-07-30 20:15:40.000000000 -0500
+++ 1/lisp/cus-dep.el	2002-09-15 18:20:53.000000000 -0500
@@ -35,7 +35,7 @@
   "Batch function to extract custom dependencies from .el files.
 Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
   (let ((enable-local-eval nil)
-	(all-subdirs command-line-args-left)
+	(all-subdirs (sort command-line-args-left 'string<))
 	(start-directory default-directory))
     (get-buffer-create " cus-dep temp")
     (set-buffer " cus-dep temp")
@@ -86,6 +86,10 @@
 	      (let ((members (get symbol 'custom-group))
 		    item where found)
 		(when members
+                  ;; So x and no-x builds won't differ.
+                  (setq members
+                        (sort (copy-sequence members)
+                              (lambda (x y) (string< (car x) (car y)))))
 		  (while members
 		    (setq item (car (car members))
 			  members (cdr members)
--- 0/lisp/help.el	2001-10-21 20:26:01.000000000 -0500
+++ 1/lisp/help.el	2002-09-19 23:29:30.000000000 -0500
@@ -612,7 +612,10 @@
 	   ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
 	   (if (eq system-type 'ms-dos)
 	       "fns.el"
-	     (format "fns-%s.el" emacs-version))
+            ;; Modified for Debian to support x and nox parallel installs.
+            (format "fns-%s-%s.el"
+                    emacs-version
+                    (or (and (featurep 'x-toolkit) "x") "nox")))
 	   exec-directory)
 	  ;; The file name fns-%s.el already has a .el extension.
 	  nil nil t)


--- NEW FILE pcl-cvs-format.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## pcl-cvs-format.dpatch by Romain Francoise <rfrancoise at debian.org>
##
## DP: Port changes from upstream CVS to support the new format used
## DP: used by CVS.
## DP: Upstream changes by Stefan Monnier.
## DP: Status: has been fixed upstream
## DP: Date: Mon, 24 Jan 2005 19:49:21 +0100

@DPATCH@
diff -urNad emacs21-21.3+1/lisp/pcvs-parse.el /tmp/dpep.SXISqR/emacs21-21.3+1/lisp/pcvs-parse.el
--- emacs21-21.3+1/lisp/pcvs-parse.el	2001-09-24 18:39:23.000000000 +0200
+++ /tmp/dpep.SXISqR/emacs21-21.3+1/lisp/pcvs-parse.el	2005-01-24 19:15:31.000000000 +0100
@@ -351,7 +351,7 @@
        ;; File you removed still exists.  Ignore (will be noted as removed).
        (cvs-match ".* should be removed and is still there$")
        ;; just a note
-       (cvs-match "use '.+ commit' to \\sw+ th\\sw+ files? permanently$")
+       (cvs-match "use ['`].+ commit' to \\sw+ th\\sw+ files? permanently$")
        ;; [add,status] followed by a more complete status description anyway
        (cvs-match "nothing known about .*$")
        ;; [update] problem with patch
@@ -467,12 +467,14 @@
 			  :head-rev head-rev))))
 
 (defun cvs-parse-commit ()
-  (let (path base-rev subtype)
+  (let (path file base-rev subtype)
     (cvs-or
 
      (and
-      (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2))
-      (cvs-match ".*,v  <--  .*$")
+      (cvs-or
+       (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2))
+       t)
+      (cvs-match ".*,v  <--  \\(.*\\)$" (file 1))
       (cvs-or
        ;; deletion
        (cvs-match "new revision: delete; previous revision: \\([0-9.]*\\)$"
@@ -483,15 +485,20 @@
        ;; update
        (cvs-match "new revision: \\([0-9.]*\\); previous revision: .*$"
 		  (subtype 'COMMITTED) (base-rev 1)))
-      (cvs-match "done$")
+      (cvs-or (cvs-match "done$") t)
+      ;; In cvs-1.12.9 commit messages have been changed and became
+      ;; ambiguous.  More specifically, the `path' above is not given.
+      ;; We assume here that in future releases the corresponding info will
+      ;; be put into `file'.
       (progn
 	;; Try to remove the temp files used by VC.
-	(vc-delete-automatic-version-backups (expand-file-name path))
+	(vc-delete-automatic-version-backups (expand-file-name (or path file)))
 	;; it's important here not to rely on the default directory management
 	;; because `cvs commit' might begin by a series of Examining messages
 	;; so the processing of the actual checkin messages might begin with
 	;; a `current-dir' set to something different from ""
-	(cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype) path 'trust
+	(cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype)
+			     (or path file) 'trust
 			     :base-rev base-rev)))
      
      ;; useless message added before the actual addition: ignored


--- NEW FILE python-completion-ignored-extensions.dpatch ---
#!/bin/sh -e
## python-completion-ignored-extensions.dpatch by Jerome Marant <jerome at debian.org>
##
## DP: ** Add Python byte-compiled file extensions to
## DP: completion-ignored-extensions variable.  
## DP: Status: has been incorporated upstream
## DP: Date: Sun,  6 Jun 2004 14:18:42 +0200

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/jerome/pkg/emacs21/svn/emacs21/lisp/bindings.el emacs21/lisp/bindings.el
--- /home/jerome/pkg/emacs21/svn/emacs21/lisp/bindings.el	2004-06-06 14:10:54.000000000 +0200
+++ emacs21/lisp/bindings.el	2004-06-06 14:10:54.000000000 +0200
@@ -446,7 +446,9 @@
 	 ;; Texinfo-related
 	 ".toc" ".log" ".aux"
 	 ".cp" ".fn" ".ky" ".pg" ".tp" ".vr"
-	 ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs")))
+	 ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs"
+	 ;; Python byte-compiled
+	 ".pyc" ".pyo")))
 
 ;; Packages should add to this list appropriately when they are
 ;; loaded, rather than listing everything here.


--- NEW FILE remote-files-permissions.dpatch ---
#! /bin/sh -e
## remote-files-permissions.dpatch by Michael Albinus <michael.albinus at gmx.de>
##
## All lines beginning with `## DP:' are a description of the patch.

## DP: Tightens permissions of local backup copies of remote files.
## DP: Authors: Michael Albinus <michael.albinus at gmx.de>
## DP: Status: has been incorporated upstream
## DP: Date: Sat,  9 Oct 2004 09:51:33 +0200

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
--- emacs21.orig/src/fileio.c	2004-10-09 09:45:43.000000000 +0200
+++ emacs21/src/fileio.c	2004-10-09 09:46:32.000000000 +0200
@@ -5438,6 +5438,9 @@
       && stat (XSTRING (current_buffer->filename)->data, &st) >= 0)
     /* But make sure we can overwrite it later!  */
     auto_save_mode_bits = st.st_mode | 0600;
+  else if (! NILP (current_buffer->filename))
+    /* Remote files don't cooperate with stat.  */
+    auto_save_mode_bits = XINT (Ffile_modes (current_buffer->filename)) | 0600;
   else
     auto_save_mode_bits = 0666;
 


--- NEW FILE save-buffer.dpatch ---
#!/bin/sh -e
## save-buffer.dpatch by Jerome Marant <jerome at debian.org>
##
## DP: ** Fixes cases where Emacs does not rename a backup file
## DP: to the original one when the coding system of the buffer
## DP: has changed and saving has been canceled.
## DP: Status: has been incorporated upstream
## DP: Date: Sun, 26 Oct 2003 17:48:46 +0100

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/jerome/pkg/emacs21/svn/emacs21/lisp/files.el emacs21/lisp/files.el
--- /home/jerome/pkg/emacs21/svn/emacs21/lisp/files.el	2003-10-01 20:01:28.000000000 +0200
+++ emacs21/lisp/files.el	2003-10-26 17:45:31.000000000 +0100
@@ -2207,7 +2207,8 @@
 			     (copy-file real-file-name backupname t t)))
 			;; rename-file should delete old backup.
 			(rename-file real-file-name backupname t)
-			(setq setmodes (file-modes backupname)))
+			(setq setmodes
+			      (cons (file-modes backupname) backupname)))
 		    (file-error
 		     ;; If trouble writing the backup, write it in ~.
 		     (setq backupname (expand-file-name
@@ -2682,7 +2683,7 @@
 		  (nthcdr 10 (file-attributes buffer-file-name)))
 	    (if setmodes
 		(condition-case ()
-		    (set-file-modes buffer-file-name setmodes)
+		    (set-file-modes buffer-file-name (car setmodes))
 		  (error nil))))
 	  ;; If the auto-save file was recent before this command,
 	  ;; delete it now.
@@ -2760,7 +2761,8 @@
 	    ;; Since we have created an entirely new file
 	    ;; and renamed it, make sure it gets the
 	    ;; right permission bits set.
-	    (setq setmodes (file-modes buffer-file-name))
+	    (setq setmodes (or setmodes (cons (file-modes buffer-file-name)
+					      buffer-file-name)))
 	    ;; We succeeded in writing the temp file,
 	    ;; so rename it.
 	    (rename-file tempname buffer-file-name t))
@@ -2770,10 +2772,18 @@
 	;; (setmodes is set) because that says we're superseding.
 	(cond ((and tempsetmodes (not setmodes))
 	       ;; Change the mode back, after writing.
-	       (setq setmodes (file-modes buffer-file-name))
-	       (set-file-modes buffer-file-name (logior setmodes 128))))
-	(write-region (point-min) (point-max)
-		      buffer-file-name nil t buffer-file-truename)))
+	       (setq setmodes (cons (file-modes buffer-file-name) buffer-file-name))
+	       (set-file-modes buffer-file-name (logior (car setmodes) 128))))
+	(let (success)
+	  (unwind-protect
+	      (progn
+		(write-region (point-min) (point-max)
+			      buffer-file-name nil t buffer-file-truename)
+		(setq success t))
+	    ;; If we get an error writing the new file, and we made
+	    ;; the backup by renaming, undo the backing-up.
+	    (and setmodes (not success)
+		 (rename-file (cdr setmodes) buffer-file-name))))))
     setmodes))
 
 (defun save-some-buffers (&optional arg pred)


--- NEW FILE scroll-margin.dpatch ---
#!/bin/sh -e
## scroll-margin.dpatch by Jerome Marant <jerome at debian.org>
##
## DP: ** Prevents Emacs to hang when a non-0 scroll-margin
## DP: has been set.    
## DP: Status: has been incorporated upstream
## DP: Date: Sat, 18 Oct 2003 14:53:26 +0200

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/jerome/pkg/emacs21/svn/emacs21/src/window.c emacs21/src/window.c
--- /home/jerome/pkg/emacs21/svn/emacs21/src/window.c	2003-10-01 19:59:18.000000000 +0200
+++ emacs21/src/window.c	2003-10-18 12:21:17.000000000 +0200
@@ -4124,7 +4124,12 @@
 	     in the scroll margin at the top.  */
 	  move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
 	  while (it.current_y < this_scroll_margin)
-	    move_it_by_lines (&it, 1, 1);
+	    {
+	      int prev = it.current_y;
+	      move_it_by_lines (&it, 1, 1);
+	      if (prev == it.current_y)
+		break;
+	    }
 	  SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
 	}
       else if (n < 0)


--- NEW FILE wrapper ---
#!/bin/sh

PROG_NAME=`basename $0`

for i in x nox; do
  [ -x "/usr/bin/${PROG_NAME}-$i" ] && exec /usr/bin/${PROG_NAME}-$i "$@"
done

echo "Can't find $PROG_NAME" 1>&2
exit 1


--- NEW FILE xfree86-4.3-modifiers.dpatch ---
#!/bin/sh -e
## xfree86-4.3-modifers.dpatch by Denis Barbier <barbier at linuxfr.org>
##
## DP: ** This patch allows Emacs to properly interpret logo keys
## DP: as Meta rather than Meta+Super+Hyper. This problem has been
## DP: showing up since latest XFree86 and Xorg introducted
## DP: `fake keys'.
## DP: Author: Denis Barbier <barbier at linuxfr.org>
## DP: Status: has been applied upstream
## DP: Date: Fri,  8 Oct 2004 22:37:15 +0200 

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
--- emacs-21.3+1.orig/src/xterm	2004-09-14 19:06:11.000000000 +0200
+++ emacs-21.3+1/src/xterm.c	2004-09-16 22:23:24.000000000 +0200
@@ -6380,8 +6380,11 @@
      Alt keysyms are on.  */
   {
     int row, col;	/* The row and column in the modifier table.  */
+    int found_alt_or_meta;
 
     for (row = 3; row < 8; row++)
+    {
+      found_alt_or_meta = 0;
       for (col = 0; col < mods->max_keypermod; col++)
 	{
 	  KeyCode code
@@ -6403,33 +6406,44 @@
 		  {
 		  case XK_Meta_L:
 		  case XK_Meta_R:
+		    found_alt_or_meta = 1;
 		    dpyinfo->meta_mod_mask |= (1 << row);
 		    break;
 
 		  case XK_Alt_L:
 		  case XK_Alt_R:
+		    found_alt_or_meta = 1;
 		    dpyinfo->alt_mod_mask |= (1 << row);
 		    break;
 
 		  case XK_Hyper_L:
 		  case XK_Hyper_R:
-		    dpyinfo->hyper_mod_mask |= (1 << row);
+		    if (!found_alt_or_meta)
+		      dpyinfo->hyper_mod_mask |= (1 << row);
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 
 		  case XK_Super_L:
 		  case XK_Super_R:
-		    dpyinfo->super_mod_mask |= (1 << row);
+		    if (!found_alt_or_meta)
+		      dpyinfo->super_mod_mask |= (1 << row);
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 
 		  case XK_Shift_Lock:
 		    /* Ignore this if it's not on the lock modifier.  */
-		    if ((1 << row) == LockMask)
+		    if (!found_alt_or_meta && ((1 << row) == LockMask))
 		      dpyinfo->shift_lock_mask = LockMask;
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 		  }
 	      }
 	  }
 	}
+    }
   }
 
   /* If we couldn't find any meta keys, accept any alt keys as meta keys.  */


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/emacs/devel/.cvsignore,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- .cvsignore	28 Feb 2005 08:09:28 -0000	1.13
+++ .cvsignore	10 Apr 2005 07:22:59 -0000	1.14
@@ -5,3 +5,5 @@
 leim-21.3.tar.gz
 php-mode-1.1.0.tgz
 tramp-2.1.3.tar.gz
+emacs-21.4.tar.gz
+leim-21.4.tar.gz


Index: emacs.spec
===================================================================
RCS file: /cvs/dist/rpms/emacs/devel/emacs.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- emacs.spec	6 Apr 2005 14:48:26 -0000	1.40
+++ emacs.spec	10 Apr 2005 07:22:59 -0000	1.41
@@ -5,8 +5,8 @@
 
 Summary: GNU Emacs text editor
 Name: emacs
-Version: 21.3
-Release: 27
+Version: 21.4
+Release: 0.92
 License: GPL
 URL: http://www.gnu.org/software/emacs/
 Group: Applications/Editors
@@ -35,6 +35,7 @@
 Source27: rfc1345.el
 Source28: http://ftp.gnu.org/gnu/tramp/tramp-%{tramp_ver}.tar.gz
 Source29: tramp-init.el
+Source30: wrapper
 Buildroot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: glibc-devel, gcc, bzip2, ncurses-devel, zlib-devel, autoconf213
 Buildrequires: xorg-x11-devel, Xaw3d-devel, libpng-devel, libjpeg-devel, libungif-devel, libtiff-devel
@@ -43,26 +44,40 @@
 BuildRequires: setarch
 %endif
 Requires: emacs-common = %{version}-%{release}
-PreReq: %{_sbindir}/alternatives
 Obsoletes: emacs-X11
 Conflicts: gettext < 0.10.40
+
+# Non-lisp patches
 Patch2: emacs-21.2-s390.patch
 Patch3: emacs-21.2-x86_64.patch
 Patch4: emacs-21.2-sticky-bit-80049.patch
 Patch5: emacs-21.2-s390x.patch
-Patch6: emacs-21.2-menubar-games.patch
 Patch7: emacs-21.2-alloc-blockinput-83600.patch
-Patch8: browse-url-htmlview-84262.patch
 Patch9: emacs-21.3-ppc64.patch
 Patch10: editfns.c-Fformat-multibyte-davej.patch
 Patch11: emacs-21.3-no-rpath.patch
-Patch12: emacs-21.3-lisp-textmodes-ispell-languages.patch
-Patch13: emacs-21.3-gud-libtool-fix.patch
 Patch14: emacs-xim-status-under-window-125413.patch
 Patch15: emacs-21.3-xterm-modifiers-137868.patch
-Patch16: movemail-CAN-2005-0100.patch
 Patch17: emacs-21.3-gcc4.patch
-Patch18: emacs-21.3-latex-mode-hook-144083.patch
+Patch19: emacs-21.4-21.4a-diff.patch
+Patch20: bzero-and-have-stdlib.dpatch
+Patch21: coding-region-leak.dpatch
+Patch22: detect-coding-iso2022.dpatch
+Patch23: fix-batch-mode-signal-handling.dpatch
+Patch24: fix-x-vs-no-x-diffs.dpatch
+Patch25: scroll-margin.dpatch
+Patch26: xfree86-4.3-modifiers.dpatch
+
+# Lisp patches
+Patch106: emacs-21.2-menubar-games.patch
+Patch108: browse-url-htmlview-84262.patch
+Patch112: emacs-21.3-lisp-textmodes-ispell-languages.patch
+Patch113: emacs-21.3-gud-libtool-fix.patch
+Patch118: emacs-21.3-latex-mode-hook-144083.patch
+Patch119: battery-acpi-support.dpatch
+Patch120: pcl-cvs-format.dpatch
+Patch121: python-completion-ignored-extensions.dpatch
+Patch122: save-buffer.dpatch
 
 %description
 Emacs is a powerful, customizable, self-documenting, modeless text
@@ -76,7 +91,6 @@
 Summary: GNU Emacs text editor without X support
 Group: Applications/Editors
 Requires: emacs-common = %{version}-%{release}
-PreReq: %{_sbindir}/alternatives
 
 %description nox
 Emacs is a powerful, customizable, self-documenting, modeless text
@@ -123,38 +137,55 @@
 non-English character set. Input methods for many different character
 sets are included in this package.
 
+%define emacs_libexecdir %{_libexecdir}/emacs/%{version}/%{_arch}-%{_vendor}-%{_os}%{?_gnu}
+
 %prep
 %setup -q -b 1 -a 24 -a 28
 
-%patch2 -p1 -b .s390
-%patch3 -p1 -b .hammer
-%patch4 -p1 -b .sticky
-%patch5 -p1 -b .s390x
+%patch2 -p1 -b .2-s390
+%patch3 -p1 -b .3-hammer
+%patch4 -p1 -b .4-sticky
+%patch5 -p1 -b .5-s390x
 # block input in `allocate_vectorlike' (alloc.c)
-%patch7 -p1 -b .block
-%patch9 -p1 -b .ppc64
-%patch10 -p1 -b .multibyte
-%patch11 -p1 -b .rpath
-%patch14 -p1 -b .StatusArea
-%patch15 -p0 -b .modifier
-%patch16 -p1 -b .fmtstr
-%patch17 -p1 -b .getcwd
+%patch7 -p1 -b .7-block
+%patch9 -p1 -b .9-ppc64
+%patch10 -p1 -b .10-multibyte
+%patch11 -p1 -b .11-rpath
+%patch14 -p1 -b .14-StatusArea
+%patch15 -p0 -b .15-modifier
+%patch17 -p1 -b .17-getcwd
+%patch19 -p1 -b .19-fedora
+%patch20 -p1 -b .20-bzero
+%patch21 -p1 -b .21-leak
+%patch22 -p1 -b .22-iso2022
+%patch23 -p1 -b .23-batch
+%patch24 -p1 -b .24-x-nox
+%patch25 -p1 -b .25-scroll-margin
+%patch26 -p1 -b .26-xmodifier
 
 # patches 2 and 3 touch configure.in
 autoconf-2.13
 
 ## Lisp patches
 # remove game we can't ship
-%patch6 -p1
+%patch106 -p1
 rm lisp/finder-inf.el lisp/play/tetris.el*
 # make browse-url default to htmlview not netscape
-%patch8 -p1
+%patch108 -p1
 # fix names of aspell language dictionaries
-%patch12 -p1
+%patch112 -p1
 # fix running gdb with libtool
-%patch13 -p1
+%patch113 -p1
 # run latex-mode-hook
-%patch18 -p1
+%patch118 -p1
+# battery acpi
+%patch119 -p1
+# pcl-cvs format
+%patch120 -p1
+# .pyc completion
+%patch121 -p1
+# save-buffer
+%patch122 -p1
 
 # install rest of site-lisp files
 ( cd site-lisp
@@ -208,22 +239,28 @@
 %endif
 
 %makeinstall
-
-# bindir/emacs handled by alternatives
-rm $RPM_BUILD_ROOT%{_bindir}/emacs
+# suffix binaries with -x
+mv $RPM_BUILD_ROOT%{_bindir}/emacs{,-x}
+mv $RPM_BUILD_ROOT%{_bindir}/emacs-%{version}{,-x}
+mv $RPM_BUILD_ROOT%{emacs_libexecdir}/fns-%{version}.1{,-x}.el
 
 # rebuild without X support
+# remove the versioned binary with X support so that we end up with .1 suffix for emacs-nox too
+rm src/emacs-%{version}.*
 %configure --without-x
 %__make %{?_smp_mflags}
 
 # install the emacs without X
-install -m 0755 src/emacs-%{version}.2 $RPM_BUILD_ROOT%{_bindir}/emacs-nox-%{version}
-#ln $RPM_BUILD_ROOT%{_bindir}/emacs-nox{-%{version},}
-install -m 0644 etc/DOC-%{version}.2 $RPM_BUILD_ROOT%{_datadir}/emacs/%{version}/etc/
-install -m 0644 lib-src/fns-%{version}.2.el $RPM_BUILD_ROOT%{_libexecdir}/emacs/%{version}/*/
+install -m 0755 src/emacs-%{version}.1 $RPM_BUILD_ROOT%{_bindir}/emacs-%{version}-nox
+ln $RPM_BUILD_ROOT%{_bindir}/emacs{-%{version},}-nox
+install -m 0644 lib-src/fns-%{version}.1.el $RPM_BUILD_ROOT%{emacs_libexecdir}/fns-%{version}.1-nox.el
+
+# install wrapper script
+install -m 0755 %SOURCE30 $RPM_BUILD_ROOT%{_bindir}/emacs-%{version}
+ln -s %{_bindir}/emacs-%{version} $RPM_BUILD_ROOT%{_bindir}/emacs
 
 # make sure movemail isn't setgid
-chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/emacs/%{version}/*/movemail
+chmod 755 $RPM_BUILD_ROOT%{emacs_libexecdir}/movemail
 
 %define site_lisp $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
 
@@ -289,23 +326,6 @@
    
 %define info_files ada-mode autotype ccmode cl dired-x ebrowse ediff efaq elisp emacs eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc speedbar vip viper widget woman
 
-%post
-alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version} 50
-
-%post nox
-alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-nox-%{version} 20
-
-%postun
-if [ $1 -eq 0 ]; then
-  alternatives --remove emacs %{_bindir}/emacs-%{version}
-fi
-
-%postun nox
-if [ $1 -eq 0 ]; then
-  alternatives --remove emacs %{_bindir}/emacs-nox-%{version}
-fi
-
-
 %post common
 for f in %{info_files}; do
   /sbin/install-info %{_infodir}/$f.gz %{_infodir}/dir --section="GNU Emacs" 2> /dev/null || :
@@ -323,42 +343,47 @@
 
 %files
 %defattr(-,root,root)
+%{_bindir}/emacs
 %{_bindir}/emacs-%{version}
-%dir %{_datadir}/emacs/%{version}
-%dir %{_datadir}/emacs/%{version}/etc
-%{_datadir}/emacs/%{version}/etc/DOC-%{version}.1
-%dir %{_libexecdir}/emacs/%{version}/*
-%{_libexecdir}/emacs/%{version}/*/fns-%{version}.1.el
+%{_bindir}/emacs-x
+%{_bindir}/emacs-%{version}-x
+%dir %{_libexecdir}/emacs
+%dir %{_libexecdir}/emacs/%{version}
+%dir %{emacs_libexecdir}
+%{emacs_libexecdir}/fns-%{version}.1-x.el
 %{_datadir}/applications/gnu-emacs.desktop
 %{_datadir}/pixmaps/emacs.png 
 
 %files nox
 %defattr(-,root,root)
-%{_bindir}/emacs-nox-%{version}
+%{_bindir}/emacs
+%{_bindir}/emacs-%{version}
+%{_bindir}/emacs-nox
+%{_bindir}/emacs-%{version}-nox
+%dir %{_datadir}/emacs
 %dir %{_datadir}/emacs/%{version}
 %dir %{_datadir}/emacs/%{version}/etc
-%{_datadir}/emacs/%{version}/etc/DOC-%{version}.2
-%dir %{_libexecdir}/emacs/%{version}/*
-%{_libexecdir}/emacs/%{version}/*/fns-%{version}.2.el
+%dir %{_libexecdir}/emacs
+%dir %{_libexecdir}/emacs/%{version}
+%dir %{emacs_libexecdir}
+%{emacs_libexecdir}/fns-%{version}.1-nox.el
 
 %files -f common-filelist common
 %defattr(-,root,root)
 %config(noreplace) %{_sysconfdir}/skel/.emacs
 %doc etc/NEWS BUGS README 
-%exclude %{_bindir}/emacs-%{version}
-%exclude %{_bindir}/emacs-nox-%{version}
+%exclude %{_bindir}/emacs*
 %{_bindir}/*
 %{_mandir}/*/*
 %{_infodir}/*
 %dir %{_datadir}/emacs
 %dir %{_datadir}/emacs/%{version}
 %{_datadir}/emacs/%{version}/etc
-%exclude %{_datadir}/emacs/%{version}/etc/DOC-%{version}.*
 # quieten startup when -leim and -el aren't installed
 %dir %{_datadir}/emacs/%{version}/leim
 %{_datadir}/emacs/%{version}/site-lisp
 %{_libexecdir}/emacs
-%exclude %{_libexecdir}/emacs/%{version}/*/fns-%{version}.*.el
+%exclude %{emacs_libexecdir}/fns-%{version}.*.el
 %attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/default.el
 %attr(0644,root,root) %config %{_datadir}/emacs/site-lisp/site-start.el
 
@@ -369,6 +394,24 @@
 %defattr(-,root,root)
 
 %changelog
+* Fri Apr  8 2005 Jens Petersen <petersen at redhat.com> - 21.4-1
+- update to 21.4 movemail vulnerability release
+  - no longer need movemail-CAN-2005-0100.patch
+- replace %{_bindir}/emacs alternatives with a wrapper script (Warren Togami)
+  to prevent it from disappearing when upgrading (Michal Jaegermann, 154326)
+  - suffix the X emacs binaries with -x and the no X binaries with -nox
+  - the wrapper script %{_bindir}/emacs-%%version runs emacs-x if installed or
+    otherwise emacs-nox.  %{_bindir}/emacs is a symlink to the wrapper
+- make emacs and emacs-nox own the subdirs in %{_libexecdir}
+- add a bunch of fixes from debian's emacs21_21.4a-1 patch:
+    battery-acpi-support.dpatch, bzero-and-have-stdlib.dpatch,
+    coding-region-leak.dpatch, detect-coding-iso2022.dpatch,
+    fix-batch-mode-signal-handling.dpatch, pcl-cvs-format.dpatch,
+    python-completion-ignored-extensions.dpatch,
+    remote-files-permissions.dpatch, save-buffer.dpatch, scroll-margin.dpatch,
+    xfree86-4.3-modifiers.dpatch
+  - add fix-x-vs-no-x-diffs.dpatch and 
+
 * Wed Apr  6 2005 Jens Petersen <petersen at redhat.com> - 21.3-27
 - use alternatives to switch _bindir/emacs between emacs and emacs-nox
   (Henning Schmiedehausen, #151067)


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/emacs/devel/sources,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- sources	28 Feb 2005 08:09:28 -0000	1.14
+++ sources	10 Apr 2005 07:22:59 -0000	1.15
@@ -1,6 +1,6 @@
 1387a2273fe9a9a160f3a0f63e06dbac  Mule-UCS-current.tar.gz
 a41fdcc6436250b8935fb01af0701cf8  elisp-manual-21-2.8.tar.bz2
-a0bab457cbf5b4f8eb99d1d0a3ada420  emacs-21.3.tar.gz
-1c968c37e22be0f0d8f8cd57cebe5a5e  leim-21.3.tar.gz
 aad009f7cff4019aac9a466ec9b55aaf  php-mode-1.1.0.tgz
 8c41fd80b383e05125a4ac99c896ea99  tramp-2.1.3.tar.gz
+0a68ea5b29bb2f081ba8dd85d37bb9bc  emacs-21.4.tar.gz
+32938cb5a7505d995a1e835639d19707  leim-21.4.tar.gz


--- movemail-CAN-2005-0100.patch DELETED ---




More information about the fedora-cvs-commits mailing list