emacs22 stable port information

Info2: <<
Package: emacs22%type_pkg[uitype]
Version: 22.2
Revision: 1003
Type: uitype (. -nox -gtk)
Description: Flexible real-time text editor
License: GPL
Maintainer: Sebastien Maret
Provides: emacsen
Depends: <<
emacsen-common,
ncurses (>= 5.4-20041023-1006),
libncurses5-shlibs (>= 5.4-20041023-1006),
passwd,
(%type_raw[uitype] = -gtk) libgettext3-shlibs,
(%type_raw[uitype] = -gtk) libiconv,
(%type_raw[uitype] = .) x11,
(%type_raw[uitype] = .) libpng3-shlibs (>= 1:1.2.18-1),
(%type_raw[uitype] = .) libtiff-shlibs,
(%type_raw[uitype] = .) libjpeg-shlibs,
(%type_raw[uitype] = .) giflib-shlibs | (%type_raw[uitype] = .) libungif-shlibs (>= 4.1.0final),
(%type_raw[uitype] = -gtk) x11,
(%type_raw[uitype] = -gtk) libpng3-shlibs (>= 1:1.2.18-1),
(%type_raw[uitype] = -gtk) libtiff-shlibs,
(%type_raw[uitype] = -gtk) libjpeg-shlibs,
(%type_raw[uitype] = -gtk) giflib-shlibs | (%type_raw[uitype] = -gtk) libungif-shlibs (>= 4.1.0final),
(%type_raw[uitype] = -gtk) gtk+2-shlibs (>= 2.12.0-1)
<<
BuildDepends: <<
libncurses5 (>= 5.4-20041023-1006),
(%type_raw[uitype] = -gtk) libgettext3-dev,
(%type_raw[uitype] = -gtk) libiconv-dev,
(%type_raw[uitype] = .) x11-dev,
(%type_raw[uitype] = .) libpng3 (>= 1:1.2.18-1),
(%type_raw[uitype] = .) libtiff,
(%type_raw[uitype] = .) libjpeg,
(%type_raw[uitype] = .) giflib | (%type_raw[uitype] = .) libungif (>= 4.1.0final),
(%type_raw[uitype] = -gtk) libpng3 (>= 1:1.2.18-1),
(%type_raw[uitype] = -gtk) libtiff,
(%type_raw[uitype] = -gtk) libjpeg,
(%type_raw[uitype] = -gtk) giflib | (%type_raw[uitype] = -gtk) libungif (>= 4.1.0final),
(%type_raw[uitype] = -gtk) x11-dev,
(%type_raw[uitype] = -gtk) cairo (>= 1.6-1),
(%type_raw[uitype] = -gtk) expat1,
(%type_raw[uitype] = -gtk) atk1 (>= 1.20.0-1),
(%type_raw[uitype] = -gtk) fontconfig2-dev (>= 2.4.1-1),
(%type_raw[uitype] = -gtk) freetype219 (>= 2.3.5-1),
(%type_raw[uitype] = -gtk) glib2-dev (>= 2.14.0-1),
(%type_raw[uitype] = -gtk) glitz,
(%type_raw[uitype] = -gtk) gtk+2-dev (>= 2.12.0-1),
(%type_raw[uitype] = -gtk) pango1-xft2-ft219-dev (>= 1.18.4-4),
(%type_raw[uitype] = -gtk) pixman (>= 0.10.0-1),
(%type_raw[uitype] = -gtk) pkgconfig (>= 0.21-1)
<<
Conflicts: emacs22, emacs22-nox, emacs22-gtk, emacs22-carbon (<<22.0.50.cvs20060118-1)
Replaces: emacs22, emacs22-nox, emacs22-gtk, emacs22-carbon (<<22.0.50.cvs20060118-1)
Source: mirror:gnu:emacs/emacs-%v.tar.gz
Source-MD5: d6ee586b8752351334ebf072904c4d51
Patch: emacs22.patch
NoSetMAKEFLAGS: true
SetMAKEFLAGS: -j1
SetCPPFLAGS: -I%p/lib/pango-ft219/include/pango-1.0 -I%p/lib/pango-ft219/include -I%p/lib/freetype219/include/freetype2 -I%p/lib/freetype219/include -I%p/lib/fontconfig2/include
NoSetLDFLAGS: true
SetLDFLAGS: -L%p/lib/pango-ft219/lib -L%p/lib/freetype219/lib -L%p/lib/fontconfig2/lib
SetLIBS: -L%p/lib
SetCFLAGS: -Os -pipe
ConfigureParams: --disable-dependency-tracking --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --libexecdir='${prefix}/lib' PKG_CONFIG_PATH="%p/lib/pango-ft219/lib/pkgconfig:%p/lib/fontconfig2/lib/pkgconfig:%p/lib/freetype219/lib/pkgconfig:$PKG_CONFIG_PATH" FREETYPE_CONFIG=%p/lib/freetype219/bin/freetype-config
CompileScript: <<
#!/bin/bash -ev
if [ $UID -ne 0 ]; then echo "%n cannot be built with --build-as-nobody"; exit 1; fi
if [ "%type_raw[uitype]" == "-nox" ]; then
./configure %c --without-carbon --without-x
elif [ "%type_raw[uitype]" == "-gtk" ]; then
./configure %c --without-carbon --with-x --with-x-toolkit=gtk
else
./configure %c --without-carbon --with-x --with-x-toolkit=lucid
fi
# Sync .elc's with patched .el's
(cd src && make bootstrap) || exit
(cd lisp && make recompile EMACS=../src/bootstrap-emacs) || exit
# Compile emacs with new *.elc
make
<<
InstallScript: <<
make install prefix=%i
rm %i/bin/emacs
mv %i/share/man/man1/emacs.1 %i/share/man/man1/emacs.1.emacs22
mv %i/bin/ctags %i/bin/ctags.emacs22
mv %i/share/man/man1/ctags.1 %i/share/man/man1/ctags.1.emacs22
mv %i/bin/emacsclient %i/bin/emacsclient.emacs22
mv %i/share/man/man1/emacsclient.1 %i/share/man/man1/emacsclient.1.emacs22
mv %i/bin/etags %i/bin/etags.emacs22
mv %i/share/man/man1/etags.1 %i/share/man/man1/etags.1.emacs22
mv %i/bin/b2m %i/bin/b2m.emacs22
mv %i/bin/rcs-checkin %i/bin/rcs-checkin.emacs22
mv %i/bin/ebrowse %i/bin/ebrowse.emacs22
mv %i/bin/grep-changelog %i/bin/grep-changelog.emacs22
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/emacs22/site-start.d
mkdir -p %i/share/emacs22
mv %i/share/emacs/%v/site-lisp %i/share/emacs22/
(cd %i/share/emacs/%v; ln -s ../../emacs22/site-lisp site-lisp)
(cd %i/bin; chmod 755 emacs-%v; ln -s emacs-%v emacs22)

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

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

# Register ourselves with emacsen-common
%p/lib/emacsen-common/emacs-install emacs22

# 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 erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url \
vip viper widget woman
do
install-info --infodir=%p/share/info --section Emacs Emacs %p/share/info/emacs-22/${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 erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url vip \
viper widget woman
do
install-info --infodir=%p/share/info --remove-exactly emacs-22/${file}
done

if [ $1 != "upgrade" ]; then
update-alternatives --remove emacs %p/bin/emacs22
update-alternatives --remove emacsclient %p/bin/emacsclient.emacs22
update-alternatives --remove ctags %p/bin/ctags.emacs22
update-alternatives --remove etags %p/bin/etags.emacs22
update-alternatives --remove b2m %p/bin/b2m.emacs22
update-alternatives --remove rcs-checkin %p/bin/rcs-checkin.emacs22
update-alternatives --remove ebrowse %p/bin/ebrowse.emacs22
update-alternatives --remove grep-changelog %p/bin/grep-changelog.emacs22
%p/lib/emacsen-common/emacs-remove emacs22
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.
<<
DescPackaging: <<
update-alternatives is used for emacs, emacsclient, ctags, etags, b2m
rcs-checkin, ebrowse, and grep-changelog to allow parallel installation
of emacs22 & xemacs.

Its info files are installed into the emacs22 subdirectory of
%p/share/info for the same reason.

Original packages by Christoph Pfister and Christian Swinehart
<<
ConfFiles: %p/var/games/emacs22/tetris-scores %p/var/games/emacs22/snake-scores
DescPort: <<
The patchfile modifies startup.el, and brings in the scripts fix-info
and mangle-info, in order to implement our emacs packaging system.
<<
Homepage: http://www.gnu.org/software/emacs/
<<

emacs22 stable port .patch

diff -ruN --exclude '*~' emacs-22.2/Makefile.in emacs-22.2.patched/Makefile.in
--- emacs-22.2/Makefile.in 2008-01-10 13:15:24.000000000 +0100
+++ emacs-22.2.patched/Makefile.in 2008-04-07 14:16:57.000000000 +0200
@@ -438,7 +438,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 ; \
@@ -478,7 +478,7 @@
echo "Copying etc/DOC-* to $(DESTDIR)${docdir} ..." ; \
(cd ./etc; tar -chf - DOC*) \
|(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)$(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
+ (cd $(DESTDIR)$(docdir); chown root:admin DOC*; chmod a+r DOC*; \
if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
else true; fi
-unset CDPATH; \
@@ -490,7 +490,7 @@
echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
|(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ (cd $(DESTDIR)${lispdir}; find . -exec chown root:admin {} ';') ; \
else true; fi
-unset CDPATH; \
if [ -n "${GZIP_PROG}" ]; \
diff -ruN --exclude '*~' emacs-22.2/configure emacs-22.2.patched/configure
--- emacs-22.2/configure 2008-03-01 20:28:11.000000000 +0100
+++ emacs-22.2.patched/configure 2008-04-07 14:16:57.000000000 +0200
@@ -1807,7 +1807,7 @@
etcdir='${datadir}/emacs/${version}/etc'
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
docdir='${datadir}/emacs/${version}/etc'
-gamedir='${localstatedir}/games/emacs'
+gamedir='${localstatedir}/games/emacs22'

gameuser=games

@@ -13958,9 +13958,9 @@
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
+#if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
HAVE_GIF=yes
-fi
+#fi

fi

diff -ruN --exclude '*~' emacs-22.2/fix-info emacs-22.2.patched/fix-info
--- emacs-22.2/fix-info 1970-01-01 01:00:00.000000000 +0100
+++ emacs-22.2.patched/fix-info 2008-04-07 14:16:57.000000000 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
+ elisp eintr emacs emacs-mime eshell eudc flymake \
+ forms gnus idlwave info message mh-e newsticker org pcl-cvs \
+ pgg reftex sc ses sieve speedbar tramp vip viper widget \
+ woman smtpmail url rcirc erc
+do
+ ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
\ No newline at end of file
diff -ruN --exclude '*~' emacs-22.2/leim/Makefile.in emacs-22.2.patched/leim/Makefile.in
--- emacs-22.2/leim/Makefile.in 2008-01-10 13:15:30.000000000 +0100
+++ emacs-22.2.patched/leim/Makefile.in 2008-04-07 14:18:15.000000000 +0200
@@ -253,7 +253,7 @@
done) \
else true; fi
-chmod -R a+r ${INSTALLDIR}
- -find ${INSTALLDIR} -exec chown $${LOGNAME:-$$USERNAME} '{}' ';'
+ -find ${INSTALLDIR} -exec chown root:admin '{}' ';'

clean mostlyclean:
rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \
diff -ruN --exclude '*~' emacs-22.2/lisp/startup.el emacs-22.2.patched/lisp/startup.el
--- emacs-22.2/lisp/startup.el 2008-03-07 18:01:12.000000000 +0100
+++ emacs-22.2.patched/lisp/startup.el 2008-04-07 14:16:57.000000000 +0200
@@ -291,6 +291,10 @@

(defvar normal-top-level-add-subdirs-inode-list nil)

+(defconst fink-emacs-flavor 'emacs22
+ "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
(defvar no-blinking-cursor nil)

(defvar default-frame-background-mode)
@@ -826,9 +830,19 @@
;; be loaded from site-run-file and wants to test if -q was given
;; should check init-file-user instead, since that is already set.
;; See cus-edit.el for an example.
- (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 screen.
(setq inhibit-startup-screen nil)
diff -ruN --exclude '*~' emacs-22.2/mangle-info emacs-22.2.patched/mangle-info
--- emacs-22.2/mangle-info 1970-01-01 01:00:00.000000000 +0100
+++ emacs-22.2.patched/mangle-info 2008-04-07 14:16:57.000000000 +0200
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-22";
+
+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};
+
diff -ruN --exclude '*~' emacs-22.2/src/Makefile.in emacs-22.2.patched/src/Makefile.in
--- emacs-22.2/src/Makefile.in 2008-01-10 13:16:14.000000000 +0100
+++ emacs-22.2.patched/src/Makefile.in 2008-04-07 14:16:57.000000000 +0200
@@ -441,7 +441,7 @@

#if HAVE_GIF
#ifndef LIBGIF
-#define LIBGIF -lungif
+#define LIBGIF -lgif
#endif /* not defined LIBGIF */
#else /* not HAVE_GIF */
#define LIBGIF

emacs22 _unstable_ port information

Info2: <<
Package: emacs22%type_pkg[uitype]
Version: 22.2
Revision: 1003
Type: uitype (. -nox -gtk)
Description: Flexible real-time text editor
License: GPL
Maintainer: Sebastien Maret
Provides: emacsen
Depends: <<
emacsen-common,
ncurses (>= 5.4-20041023-1006),
libncurses5-shlibs (>= 5.4-20041023-1006),
passwd,
(%type_raw[uitype] = -gtk) libgettext3-shlibs,
(%type_raw[uitype] = -gtk) libiconv,
(%type_raw[uitype] = .) x11,
(%type_raw[uitype] = .) libpng3-shlibs (>= 1:1.2.18-1),
(%type_raw[uitype] = .) libtiff-shlibs,
(%type_raw[uitype] = .) libjpeg-shlibs,
(%type_raw[uitype] = .) giflib-shlibs | (%type_raw[uitype] = .) libungif-shlibs (>= 4.1.0final),
(%type_raw[uitype] = -gtk) x11,
(%type_raw[uitype] = -gtk) libpng3-shlibs (>= 1:1.2.18-1),
(%type_raw[uitype] = -gtk) libtiff-shlibs,
(%type_raw[uitype] = -gtk) libjpeg-shlibs,
(%type_raw[uitype] = -gtk) giflib-shlibs | (%type_raw[uitype] = -gtk) libungif-shlibs (>= 4.1.0final),
(%type_raw[uitype] = -gtk) gtk+2-shlibs (>= 2.12.0-1)
<<
BuildDepends: <<
libncurses5 (>= 5.4-20041023-1006),
(%type_raw[uitype] = -gtk) libgettext3-dev,
(%type_raw[uitype] = -gtk) libiconv-dev,
(%type_raw[uitype] = .) x11-dev,
(%type_raw[uitype] = .) libpng3 (>= 1:1.2.18-1),
(%type_raw[uitype] = .) libtiff,
(%type_raw[uitype] = .) libjpeg,
(%type_raw[uitype] = .) giflib | (%type_raw[uitype] = .) libungif (>= 4.1.0final),
(%type_raw[uitype] = -gtk) libpng3 (>= 1:1.2.18-1),
(%type_raw[uitype] = -gtk) libtiff,
(%type_raw[uitype] = -gtk) libjpeg,
(%type_raw[uitype] = -gtk) giflib | (%type_raw[uitype] = -gtk) libungif (>= 4.1.0final),
(%type_raw[uitype] = -gtk) x11-dev,
(%type_raw[uitype] = -gtk) cairo (>= 1.6-1),
(%type_raw[uitype] = -gtk) expat1,
(%type_raw[uitype] = -gtk) atk1 (>= 1.20.0-1),
(%type_raw[uitype] = -gtk) fontconfig2-dev (>= 2.4.1-1),
(%type_raw[uitype] = -gtk) freetype219 (>= 2.3.5-1),
(%type_raw[uitype] = -gtk) glib2-dev (>= 2.14.0-1),
(%type_raw[uitype] = -gtk) glitz,
(%type_raw[uitype] = -gtk) gtk+2-dev (>= 2.12.0-1),
(%type_raw[uitype] = -gtk) pango1-xft2-ft219-dev (>= 1.18.4-4),
(%type_raw[uitype] = -gtk) pixman (>= 0.10.0-1),
(%type_raw[uitype] = -gtk) pkgconfig (>= 0.21-1)
<<
Conflicts: emacs22, emacs22-nox, emacs22-gtk, emacs22-carbon (<<22.0.50.cvs20060118-1)
Replaces: emacs22, emacs22-nox, emacs22-gtk, emacs22-carbon (<<22.0.50.cvs20060118-1)
Source: mirror:gnu:emacs/emacs-%v.tar.gz
Source-MD5: d6ee586b8752351334ebf072904c4d51
Patch: emacs22.patch
NoSetMAKEFLAGS: true
SetMAKEFLAGS: -j1
SetCPPFLAGS: -I%p/lib/pango-ft219/include/pango-1.0 -I%p/lib/pango-ft219/include -I%p/lib/freetype219/include/freetype2 -I%p/lib/freetype219/include -I%p/lib/fontconfig2/include
NoSetLDFLAGS: true
SetLDFLAGS: -L%p/lib/pango-ft219/lib -L%p/lib/freetype219/lib -L%p/lib/fontconfig2/lib
SetLIBS: -L%p/lib
SetCFLAGS: -Os -pipe
ConfigureParams: --disable-dependency-tracking --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --libexecdir='${prefix}/lib' PKG_CONFIG_PATH="%p/lib/pango-ft219/lib/pkgconfig:%p/lib/fontconfig2/lib/pkgconfig:%p/lib/freetype219/lib/pkgconfig:$PKG_CONFIG_PATH" FREETYPE_CONFIG=%p/lib/freetype219/bin/freetype-config
CompileScript: <<
#!/bin/bash -ev
if [ $UID -ne 0 ]; then echo "%n cannot be built with --build-as-nobody"; exit 1; fi
if [ "%type_raw[uitype]" == "-nox" ]; then
./configure %c --without-carbon --without-x
elif [ "%type_raw[uitype]" == "-gtk" ]; then
./configure %c --without-carbon --with-x --with-x-toolkit=gtk
else
./configure %c --without-carbon --with-x --with-x-toolkit=lucid
fi
# Sync .elc's with patched .el's
(cd src && make bootstrap) || exit
(cd lisp && make recompile EMACS=../src/bootstrap-emacs) || exit
# Compile emacs with new *.elc
make
<<
InstallScript: <<
make install prefix=%i
rm %i/bin/emacs
mv %i/share/man/man1/emacs.1 %i/share/man/man1/emacs.1.emacs22
mv %i/bin/ctags %i/bin/ctags.emacs22
mv %i/share/man/man1/ctags.1 %i/share/man/man1/ctags.1.emacs22
mv %i/bin/emacsclient %i/bin/emacsclient.emacs22
mv %i/share/man/man1/emacsclient.1 %i/share/man/man1/emacsclient.1.emacs22
mv %i/bin/etags %i/bin/etags.emacs22
mv %i/share/man/man1/etags.1 %i/share/man/man1/etags.1.emacs22
mv %i/bin/b2m %i/bin/b2m.emacs22
mv %i/bin/rcs-checkin %i/bin/rcs-checkin.emacs22
mv %i/bin/ebrowse %i/bin/ebrowse.emacs22
mv %i/bin/grep-changelog %i/bin/grep-changelog.emacs22
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/emacs22/site-start.d
mkdir -p %i/share/emacs22
mv %i/share/emacs/%v/site-lisp %i/share/emacs22/
(cd %i/share/emacs/%v; ln -s ../../emacs22/site-lisp site-lisp)
(cd %i/bin; chmod 755 emacs-%v; ln -s emacs-%v emacs22)

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

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

# Register ourselves with emacsen-common
%p/lib/emacsen-common/emacs-install emacs22

# 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 erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url \
vip viper widget woman
do
install-info --infodir=%p/share/info --section Emacs Emacs %p/share/info/emacs-22/${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 erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url vip \
viper widget woman
do
install-info --infodir=%p/share/info --remove-exactly emacs-22/${file}
done

if [ $1 != "upgrade" ]; then
update-alternatives --remove emacs %p/bin/emacs22
update-alternatives --remove emacsclient %p/bin/emacsclient.emacs22
update-alternatives --remove ctags %p/bin/ctags.emacs22
update-alternatives --remove etags %p/bin/etags.emacs22
update-alternatives --remove b2m %p/bin/b2m.emacs22
update-alternatives --remove rcs-checkin %p/bin/rcs-checkin.emacs22
update-alternatives --remove ebrowse %p/bin/ebrowse.emacs22
update-alternatives --remove grep-changelog %p/bin/grep-changelog.emacs22
%p/lib/emacsen-common/emacs-remove emacs22
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.
<<
DescPackaging: <<
update-alternatives is used for emacs, emacsclient, ctags, etags, b2m
rcs-checkin, ebrowse, and grep-changelog to allow parallel installation
of emacs22 & xemacs.

Its info files are installed into the emacs22 subdirectory of
%p/share/info for the same reason.

Original packages by Christoph Pfister and Christian Swinehart
<<
ConfFiles: %p/var/games/emacs22/tetris-scores %p/var/games/emacs22/snake-scores
DescPort: <<
The patchfile modifies startup.el, and brings in the scripts fix-info
and mangle-info, in order to implement our emacs packaging system.
<<
Homepage: http://www.gnu.org/software/emacs/
<<

emacs22 _unstable_ port .patch

diff -ruN --exclude '*~' emacs-22.2/Makefile.in emacs-22.2.patched/Makefile.in
--- emacs-22.2/Makefile.in 2008-01-10 13:15:24.000000000 +0100
+++ emacs-22.2.patched/Makefile.in 2008-04-07 14:16:57.000000000 +0200
@@ -438,7 +438,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 ; \
@@ -478,7 +478,7 @@
echo "Copying etc/DOC-* to $(DESTDIR)${docdir} ..." ; \
(cd ./etc; tar -chf - DOC*) \
|(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)$(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
+ (cd $(DESTDIR)$(docdir); chown root:admin DOC*; chmod a+r DOC*; \
if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
else true; fi
-unset CDPATH; \
@@ -490,7 +490,7 @@
echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
|(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ (cd $(DESTDIR)${lispdir}; find . -exec chown root:admin {} ';') ; \
else true; fi
-unset CDPATH; \
if [ -n "${GZIP_PROG}" ]; \
diff -ruN --exclude '*~' emacs-22.2/configure emacs-22.2.patched/configure
--- emacs-22.2/configure 2008-03-01 20:28:11.000000000 +0100
+++ emacs-22.2.patched/configure 2008-04-07 14:16:57.000000000 +0200
@@ -1807,7 +1807,7 @@
etcdir='${datadir}/emacs/${version}/etc'
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
docdir='${datadir}/emacs/${version}/etc'
-gamedir='${localstatedir}/games/emacs'
+gamedir='${localstatedir}/games/emacs22'

gameuser=games

@@ -13958,9 +13958,9 @@
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
+#if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
HAVE_GIF=yes
-fi
+#fi

fi

diff -ruN --exclude '*~' emacs-22.2/fix-info emacs-22.2.patched/fix-info
--- emacs-22.2/fix-info 1970-01-01 01:00:00.000000000 +0100
+++ emacs-22.2.patched/fix-info 2008-04-07 14:16:57.000000000 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
+ elisp eintr emacs emacs-mime eshell eudc flymake \
+ forms gnus idlwave info message mh-e newsticker org pcl-cvs \
+ pgg reftex sc ses sieve speedbar tramp vip viper widget \
+ woman smtpmail url rcirc erc
+do
+ ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
\ No newline at end of file
diff -ruN --exclude '*~' emacs-22.2/leim/Makefile.in emacs-22.2.patched/leim/Makefile.in
--- emacs-22.2/leim/Makefile.in 2008-01-10 13:15:30.000000000 +0100
+++ emacs-22.2.patched/leim/Makefile.in 2008-04-07 14:18:15.000000000 +0200
@@ -253,7 +253,7 @@
done) \
else true; fi
-chmod -R a+r ${INSTALLDIR}
- -find ${INSTALLDIR} -exec chown $${LOGNAME:-$$USERNAME} '{}' ';'
+ -find ${INSTALLDIR} -exec chown root:admin '{}' ';'

clean mostlyclean:
rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \
diff -ruN --exclude '*~' emacs-22.2/lisp/startup.el emacs-22.2.patched/lisp/startup.el
--- emacs-22.2/lisp/startup.el 2008-03-07 18:01:12.000000000 +0100
+++ emacs-22.2.patched/lisp/startup.el 2008-04-07 14:16:57.000000000 +0200
@@ -291,6 +291,10 @@

(defvar normal-top-level-add-subdirs-inode-list nil)

+(defconst fink-emacs-flavor 'emacs22
+ "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
(defvar no-blinking-cursor nil)

(defvar default-frame-background-mode)
@@ -826,9 +830,19 @@
;; be loaded from site-run-file and wants to test if -q was given
;; should check init-file-user instead, since that is already set.
;; See cus-edit.el for an example.
- (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 screen.
(setq inhibit-startup-screen nil)
diff -ruN --exclude '*~' emacs-22.2/mangle-info emacs-22.2.patched/mangle-info
--- emacs-22.2/mangle-info 1970-01-01 01:00:00.000000000 +0100
+++ emacs-22.2.patched/mangle-info 2008-04-07 14:16:57.000000000 +0200
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-22";
+
+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};
+
diff -ruN --exclude '*~' emacs-22.2/src/Makefile.in emacs-22.2.patched/src/Makefile.in
--- emacs-22.2/src/Makefile.in 2008-01-10 13:16:14.000000000 +0100
+++ emacs-22.2.patched/src/Makefile.in 2008-04-07 14:16:57.000000000 +0200
@@ -441,7 +441,7 @@

#if HAVE_GIF
#ifndef LIBGIF
-#define LIBGIF -lungif
+#define LIBGIF -lgif
#endif /* not defined LIBGIF */
#else /* not HAVE_GIF */
#define LIBGIF