emacs21 stable port .patch

diff -u -Naur emacs/Makefile.in emacs.fink/Makefile.in
--- emacs/Makefile.in Thu Nov 11 15:04:25 2004
+++ emacs.fink/Makefile.in Thu Nov 11 16:42:09 2004
@@ -418,7 +418,7 @@
(cd $${dir}; tar -chf - . ) \
| (cd $${dest}; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \
- find $${dest} -exec chown $${LOGNAME:-$$USERNAME} {} ';' ;\
+ find $${dest} -exec chown root:admin {} ';' ;\
for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
chmod a+rx $${subdir} ; \
rm -rf $${subdir}/RCS ; \
@@ -458,7 +458,7 @@
echo "Copying etc/DOC-* to ${docdir} ..." ; \
(cd ./etc; tar -chf - DOC*) \
|(cd ${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
+ (cd $(docdir); chown root:admin DOC*; chmod a+r DOC*; \
if test "`echo DOC-*`" != "DOC-*"; then rm DOC; fi); \
else true; fi
-unset CDPATH; \
@@ -470,7 +470,7 @@
echo "Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
|(cd ${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd ${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ (cd ${lispdir}; find . -exec chown root:admin {} ';') ; \
else true; fi
-unset CDPATH; \
thisdir=`/bin/pwd`; \
diff -u -Naur emacs/fix-info emacs.fink/fix-info
--- emacs/fix-info Wed Dec 31 19:00:00 1969
+++ emacs.fink/fix-info Thu Nov 11 16:48:48 2004
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
+ eintr elisp emacs emacs-mime emacs-xtra eshell eudc flymake forms \
+ gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve \
+ smtpmail speedbar tramp vip viper widget woman
+do
+ ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
diff -u -Naur emacs/lisp/startup.el emacs.fink/lisp/startup.el
--- emacs/lisp/startup.el Thu Nov 11 15:04:25 2004
+++ emacs.fink/lisp/startup.el Thu Nov 11 16:42:09 2004
@@ -278,6 +278,10 @@
(defvar pure-space-overflow nil
"Non-nil if building Emacs overflowed pure space.")

+(defconst fink-emacs-flavor 'emacs21
+ "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
(defun normal-top-level-add-subdirs-to-load-path ()
"Add all subdirectories of current directory to `load-path'.
More precisely, this uses only the subdirectories whose names
@@ -786,8 +790,19 @@
;; Run the site-start library if it exists. The point of this file is
;; that it is run before .emacs. There is no point in doing this after
;; .emacs; that is useless.
- (if site-run-file
- (load site-run-file t t))
+
+ ;; (if site-run-file
+ ;; (load site-run-file t t))
+
+ ;; Fink version of site-start.
+ (if site-run-file
+ (progn
+ ;; Load all the fink package snippets.
+ ;; It's in here because we want -q to kill it too.
+ (if (load "fink-startup" t t nil)
+ (fink-startup fink-emacs-flavor))
+ ;; Now the normal site file...
+ (load site-run-file t t nil)))

;; Sites should not disable this. Only individuals should disable
;; the startup message.
diff -u -Naur emacs/mangle-info emacs.fink/mangle-info
--- emacs/mangle-info Wed Dec 31 19:00:00 1969
+++ emacs.fink/mangle-info Thu Nov 11 16:42:09 2004
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-21";
+
+my $x = <>;
+if(!($x =~ m/^(\s*START-INFO-DIR-ENTRY\s+\*\s*[^:]+:\s*)\(([^\)]+)\)/mo)) {
+ die "Couldn't find START-INFO-DIR-ENTRY.";
+}
+
+print ${PREMATCH};
+print "$1($prefix/$2)";
+print ${POSTMATCH};

emacs21 _unstable_ port information

Package: emacs21
Version: 21.3.50-20041117
Revision: 1003
Distribution: 10.3, 10.4
Architecture: powerpc
Description: Flexible real-time text editor, v21.3, with X11 support
License: GPL
Maintainer: Christian Swinehart
Provides: emacsen
Depends: emacsen-common, x11, libpng3-shlibs (>= 1.2.5-4), libtiff-shlibs, libjpeg-shlibs, ncurses (>= 5.4-20041023-1006), libncurses5-shlibs (>= 5.4-20041023-1006)
BuildDepends: libpng3 (>= 1.2.5-4), libtiff, libjpeg, libncurses5 (>= 5.4-20041023-1006)
Conflicts: emacs21-nox, emacs21-xaw3d, emacs21-gtk
Replaces: emacs, emacs-nox, emacs21-nox, emacs21-xaw3d, emacs21-gtk
Source: mirror:sourceforge:fink/emacs-%v.tar.gz
SourceDirectory: emacs
Source-MD5: db66ea5f75e6b1ee97d158e3d6845611
Patch: emacs21.patch
NoSetMAKEFLAGS: true
SetMAKEFLAGS: -j1
ConfigureParams: --without-carbon --with-x --without-gif --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --libexecdir='${prefix}/lib' --with-x-toolkit=lucid --without-toolkit-scroll-bars
GCC: 4.0
CompileScript: <<
./configure %c
make
<<
InstallScript: <<
make install prefix=%i
rm %i/bin/emacs
mv %i/share/man/man1/emacs.1 %i/share/man/man1/emacs.1.emacs21
mv %i/bin/ctags %i/bin/ctags.emacs21
mv %i/share/man/man1/ctags.1 %i/share/man/man1/ctags.1.emacs21
mv %i/bin/emacsclient %i/bin/emacsclient.emacs21
mv %i/bin/etags %i/bin/etags.emacs21
mv %i/share/man/man1/etags.1 %i/share/man/man1/etags.1.emacs21
mv %i/bin/b2m %i/bin/b2m.emacs21
mv %i/bin/rcs-checkin %i/bin/rcs-checkin.emacs21
mv %i/bin/ebrowse %i/bin/ebrowse.emacs21
mv %i/bin/grep-changelog %i/bin/grep-changelog.emacs21
mkdir -p %i/share/doc/%n
install -m 644 README %i/share/doc/%n/
install -m 644 src/COPYING %i/share/doc/%n/COPYING

mkdir -p %i/etc/emacs
mkdir -p %i/etc/emacs21/site-start.d
mkdir -p %i/share/emacs21
mv %i/share/emacs/21.3.50/site-lisp %i/share/emacs21/
(cd %i/share/emacs/21.3.50; ln -s ../../emacs21/site-lisp site-lisp)
(cd %i/bin; chmod 755 emacs-%v; ln -s emacs-21.3.50 emacs21)

mv %i/share/info %i/share/emacs-21.info
mkdir -p %i/share/info
mv %i/share/emacs-21.info %i/share/info/emacs-21
rm %i/share/info/emacs-21/dir %i/share/info/emacs-21/dir.old
chmod 755 mangle-info
chmod 755 fix-info
./fix-info %i/share/info/emacs-21

chown -R root:admin %i/share/emacs/21.3.50/etc
chown -R root:admin %i/share/emacs/21.3.50/lisp
chown -R root:admin %i/share/emacs/21.3.50/leim
chmod 755 %i/share/emacs/21.3.50/leim/ja-dic
chmod 755 %i/share/emacs/21.3.50/leim/quail
rm %i/share/emacs/site-lisp/subdirs.el
<<
#
PostInstScript: <<
mkdir -p %p/etc/lisp/emacs/21.3.50/site-lisp
mkdir -p %p/etc/lisp/emacs/site-lisp
update-alternatives --install %p/bin/emacs emacs %p/bin/emacs21 40 --slave %p/share/man/man1/emacs.1 emacs.1 %p/share/man/man1/emacs.1.emacs21
update-alternatives --install %p/bin/ctags ctags %p/bin/ctags.emacs21 40 --slave %p/share/man/man1/ctags.1 ctags.1 %p/share/man/man1/ctags.1.emacs21
update-alternatives --install %p/bin/etags etags %p/bin/etags.emacs21 60 --slave %p/share/man/man1/etags.1 etags.1 %p/share/man/man1/etags.1.emacs21
update-alternatives --install %p/bin/emacsclient emacsclient %p/bin/emacsclient.emacs21 40
update-alternatives --install %p/bin/b2m b2m %p/bin/b2m.emacs21 40
update-alternatives --install %p/bin/rcs-checkin rcs-checkin %p/bin/rcs-checkin.emacs21 40
update-alternatives --install %p/bin/ebrowse ebrowse %p/bin/ebrowse.emacs21 40
update-alternatives --install %p/bin/grep-changelog grep-changelog %p/bin/grep-changelog.emacs21 40

# redundant but apparently necessary since doing it in the build script
# isn't actually making the change when the .deb is unpacked (why?)
chmod 755 %p/share/emacs/21.3.50/leim/ja-dic
chmod 755 %p/share/emacs/21.3.50/leim/quail

# Regiser ourselves with emacsen-common
%p/lib/emacsen-common/emacs-install emacs21

# Since we're placing our info files in a subdirectory of %p/share/info
# we need to manually add each doc to the info dir-file
for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
eintr elisp emacs emacs-mime emacs-xtra eshell eudc flymake forms \
gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve \
smtpmail speedbar tramp vip viper widget woman
do
install-info --infodir=%p/share/info --section Emacs Emacs %p/share/info/emacs-21/${file}
done
<<
PreRmScript: <<
# Manually remove all of our info docs from the dir-file
for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
eintr elisp emacs emacs-mime emacs-xtra eshell eudc flymake forms \
gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve \
smtpmail speedbar tramp vip viper widget woman
do
install-info --infodir=%p/share/info --remove-exactly emacs-21/${file}
done

if [ $1 != "upgrade" ]; then
update-alternatives --remove emacs %p/bin/emacs21
update-alternatives --remove emacsclient %p/bin/emacsclient.emacs21
update-alternatives --remove ctags %p/bin/ctags.emacs21
update-alternatives --remove etags %p/bin/etags.emacs21
update-alternatives --remove b2m %p/bin/b2m.emacs21
update-alternatives --remove rcs-checkin %p/bin/rcs-checkin.emacs21
update-alternatives --remove ebrowse %p/bin/ebrowse.emacs21
update-alternatives --remove grep-changelog %p/bin/grep-changelog.emacs21
%p/lib/emacsen-common/emacs-remove emacs21
fi
<<
#
DescDetail: <<
GNU Emacs is an extensible, customizable, self-documenting real-time
display editor. Through its extensibility, it is actually much more
than an editor. You can use it as a file manager, mail reader, web
browser, and for many other tasks. Some people even use it to control
their coffee machine.

This package installs GNU Emacs with support for the X window
system. If you don't want X11 support, install the emacs21-nox
package instead.
<<
DescPackaging: <<
Using libungif for gif images causes problems, so we disregard it
if present.

update-alternatives is used for emacs, emacsclient, ctags, etags, b2m
rcs-checkin, ebrowse, and grep-changelog to allow parallel installation
of emacs21 & xemacs.

Its info files are installed into the emacs21 subdirectory of
/share/info for the same reason.

Since this package comes from the CVS repository none of the elisp files
are byte-compiled by default. So before making the source tarball used by
fink the CVS version must first be `make bootstrap'ed then the .elc's
produced are injected into a fresh copy of the source tree and tarred
up again.

Original package by Christoph Pfister
<<
DescPort: <<
The patchfile modifies startup.el, and brings in the scripts fix-info and
mangle-info, in order to implement our emacs packaging system.

This version of emacs21 does not compile on intel, although the earlier
version (in the stable tree) does. Go figure.
<<
Homepage: http://www.emacswiki.org/cgi-bin/wiki

emacs21 _unstable_ port .patch

diff -u -Naur emacs/Makefile.in emacs.fink/Makefile.in
--- emacs/Makefile.in Thu Nov 11 15:04:25 2004
+++ emacs.fink/Makefile.in Thu Nov 11 16:42:09 2004
@@ -418,7 +418,7 @@
(cd $${dir}; tar -chf - . ) \
| (cd $${dest}; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \
- find $${dest} -exec chown $${LOGNAME:-$$USERNAME} {} ';' ;\
+ find $${dest} -exec chown root:admin {} ';' ;\
for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
chmod a+rx $${subdir} ; \
rm -rf $${subdir}/RCS ; \
@@ -458,7 +458,7 @@
echo "Copying etc/DOC-* to ${docdir} ..." ; \
(cd ./etc; tar -chf - DOC*) \
|(cd ${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
+ (cd $(docdir); chown root:admin DOC*; chmod a+r DOC*; \
if test "`echo DOC-*`" != "DOC-*"; then rm DOC; fi); \
else true; fi
-unset CDPATH; \
@@ -470,7 +470,7 @@
echo "Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
|(cd ${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd ${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ (cd ${lispdir}; find . -exec chown root:admin {} ';') ; \
else true; fi
-unset CDPATH; \
thisdir=`/bin/pwd`; \
diff -u -Naur emacs/fix-info emacs.fink/fix-info
--- emacs/fix-info Wed Dec 31 19:00:00 1969
+++ emacs.fink/fix-info Thu Nov 11 16:48:48 2004
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
+ eintr elisp emacs emacs-mime emacs-xtra eshell eudc flymake forms \
+ gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve \
+ smtpmail speedbar tramp vip viper widget woman
+do
+ ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
diff -u -Naur emacs/lisp/startup.el emacs.fink/lisp/startup.el
--- emacs/lisp/startup.el Thu Nov 11 15:04:25 2004
+++ emacs.fink/lisp/startup.el Thu Nov 11 16:42:09 2004
@@ -278,6 +278,10 @@
(defvar pure-space-overflow nil
"Non-nil if building Emacs overflowed pure space.")

+(defconst fink-emacs-flavor 'emacs21
+ "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
(defun normal-top-level-add-subdirs-to-load-path ()
"Add all subdirectories of current directory to `load-path'.
More precisely, this uses only the subdirectories whose names
@@ -786,8 +790,19 @@
;; Run the site-start library if it exists. The point of this file is
;; that it is run before .emacs. There is no point in doing this after
;; .emacs; that is useless.
- (if site-run-file
- (load site-run-file t t))
+
+ ;; (if site-run-file
+ ;; (load site-run-file t t))
+
+ ;; Fink version of site-start.
+ (if site-run-file
+ (progn
+ ;; Load all the fink package snippets.
+ ;; It's in here because we want -q to kill it too.
+ (if (load "fink-startup" t t nil)
+ (fink-startup fink-emacs-flavor))
+ ;; Now the normal site file...
+ (load site-run-file t t nil)))

;; Sites should not disable this. Only individuals should disable
;; the startup message.
diff -u -Naur emacs/mangle-info emacs.fink/mangle-info
--- emacs/mangle-info Wed Dec 31 19:00:00 1969
+++ emacs.fink/mangle-info Thu Nov 11 16:42:09 2004
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-21";
+
+my $x = <>;
+if(!($x =~ m/^(\s*START-INFO-DIR-ENTRY\s+\*\s*[^:]+:\s*)\(([^\)]+)\)/mo)) {
+ die "Couldn't find START-INFO-DIR-ENTRY.";
+}
+
+print ${PREMATCH};
+print "$1($prefix/$2)";
+print ${POSTMATCH};