This is needed for ports bulk, and could be useful for multiuser boxes
where people want to run different emacs versions.  Here's a first step
to make this possible.  emacs21 users are the affected, I hope they
won't mind writing shell aliases/functions/wrapper scripts to keep their
habits.

Next, cleaning up the rest of the ports tree...

Comments welcome.

Index: emacs21/Makefile
===================================================================
RCS file: /cvs/ports/editors/emacs21/Makefile,v
retrieving revision 1.73
diff -u -p -r1.73 Makefile
--- emacs21/Makefile    24 Jan 2014 12:08:55 -0000      1.73
+++ emacs21/Makefile    8 Jul 2014 19:53:58 -0000
@@ -6,12 +6,13 @@ COMMENT-leim=         Library of Emacs Input Me
 
 VERSION=               21.4
 DISTNAME=              emacs-${VERSION}
+PKGSPEC-main=          emacs->=21,<22
 PKGNAME-main=          ${DISTNAME}
 FULLPKGNAME-el=                emacs-el-${VERSION}
 FULLPKGPATH-el=                editors/emacs21,-el
 FULLPKGNAME-leim=      emacs-leim-${VERSION}
 FULLPKGPATH-leim=      editors/emacs21,-leim
-REVISION-main=         27
+REVISION-main=         28
 REVISION-el=           7
 REVISION-leim=         7
 
@@ -44,7 +45,7 @@ CONFIGURE_ENV=                CPPFLAGS="-I${LOCALBASE}
 
 MAKE_ENV=              INSTALL_EMACS="${INSTALL_SCRIPT}"
 
-SUBST_VARS=            GCCARCH VERSION
+SUBST_VARS=            GCCARCH PKGSPEC VERSION
 
 WANTLIB-main=          c m ncurses ossaudio
 
@@ -65,11 +66,22 @@ PKG_ARCH-el=                *
 
 NO_TEST=               Yes
 
+post-extract:
+       perl -pi -e 's,"etags,"etags-${VERSION},' \
+           ${WRKSRC}/lisp/progmodes/idlwave.el \
+           ${WRKSRC}/lisp/progmodes/cperl-mode.el
+.for f in ccmode cl ediff efaq emacs gnus mh-e reftex sc vip viper
+       perl -pi -e 's/^${f}/${f}-${VERSION}/' ${WRKSRC}/info/${f}
+.endfor
+       perl -pi -e \
+           's,^\* ([^:]*): \(([^\)]*)\),* $${1} ${VERSION:R}: 
($${2}-${VERSION}),i' \
+           ${WRKSRC}/info/*
+
 post-build:
        cd ${WRKSRC}; src/emacs -batch -f batch-byte-compile \
            lisp/mail/mh-{funcs,utils}.el
 
 post-install:
-       chmod -t ${PREFIX}/bin/emacs
+       chmod -t ${PREFIX}/bin/emacs-${VERSION}
 
 .include <bsd.port.mk>
Index: emacs21/patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/editors/emacs21/patches/patch-Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile_in
--- emacs21/patches/patch-Makefile_in   16 Aug 2004 23:34:02 -0000      1.2
+++ emacs21/patches/patch-Makefile_in   8 Jul 2014 19:11:25 -0000
@@ -1,12 +1,47 @@
 $OpenBSD: patch-Makefile_in,v 1.2 2004/08/16 23:34:02 pvalchev Exp $
---- Makefile.in.orig   Tue Aug  3 02:14:28 2004
-+++ Makefile.in        Tue Aug  3 02:15:39 2004
-@@ -328,7 +328,7 @@ install-arch-dep: mkdir
+--- Makefile.in.orig   Sat Oct 19 03:21:01 2002
++++ Makefile.in        Tue Jul  8 21:11:12 2014
+@@ -328,10 +328,7 @@ install-arch-dep: mkdir
            exec_prefix=${exec_prefix} bindir=${bindir} \
            libexecdir=${libexecdir} archlibdir=${archlibdir} \
            INSTALL_STRIP=${INSTALL_STRIP})
 -      ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/emacs-${version}
+-      -chmod 1755  ${bindir}/emacs-${version}
+-      rm -f ${bindir}/$(EMACS)
+-      -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS)
 +      ${INSTALL_EMACS} src/emacs ${bindir}/emacs-${version}
-       -chmod 1755  ${bindir}/emacs-${version}
-       rm -f ${bindir}/$(EMACS)
-       -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS)
+       -unset CDPATH; \
+       for f in `cd lib-src && echo fns-*.el`; do \
+         if test -r lib-src/$$f ; then \
+@@ -432,8 +429,9 @@ install-arch-indep: mkdir info
+          cd ${srcdir}/info ; \
+          for f in ada-mode* autotype* ccmode* cl* dired-x* ebrowse* ediff* 
efaq* emacs* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* 
reftex* sc* speedbar* vip* widget* woman*; do \
+            (cd $${thisdir}; \
+-            ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
+-            chmod a+r ${infodir}/$$f); \
++            manual=$${f%-[0-9]*} subpage=$${f#$$manual}; \
++            ${INSTALL_DATA} ${srcdir}/info/$$f 
${infodir}/$$manual-${version}$$subpage; \
++            chmod a+r ${infodir}/$$manual-${version}$$subpage); \
+          done); \
+       else true; fi
+       -unset CDPATH; \
+@@ -442,7 +440,7 @@ install-arch-indep: mkdir info
+       then \
+         for f in ada-mode autotype ccmode cl dired-x ebrowse ediff efaq emacs 
emacs-mime eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc 
speedbar vip viper widget woman; do \
+           (cd $${thisdir}; \
+-           ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
++           ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f-${version}); \
+         done; \
+       else true; fi
+       -chmod -R a+r ${datadir}/emacs ${COPYDESTS} ${infodir}
+@@ -450,8 +448,8 @@ install-arch-indep: mkdir info
+       cd ${srcdir}/etc; \
+       for page in emacs etags ctags gfdl ; do \
+         (cd $${thisdir}; \
+-         ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 
${man1dir}/$${page}${manext}; \
+-         chmod a+r ${man1dir}/$${page}${manext}); \
++         ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 
${man1dir}/$${page}-${version}${manext}; \
++         chmod a+r ${man1dir}/$${page}-${version}${manext}); \
+       done
+ 
+ ### Install LEIM files.  Although they are machine-independent, we
Index: emacs21/patches/patch-lib-src_Makefile_in
===================================================================
RCS file: emacs21/patches/patch-lib-src_Makefile_in
diff -N emacs21/patches/patch-lib-src_Makefile_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ emacs21/patches/patch-lib-src_Makefile_in   8 Jul 2014 19:53:31 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- lib-src/Makefile.in.orig   Fri May 31 18:45:17 2002
++++ lib-src/Makefile.in        Tue Jul  8 21:53:27 2014
+@@ -296,12 +296,12 @@ install: ${archlibdir}
+       @echo
+       @echo "Installing utilities for users to run."
+       for file in ${INSTALLABLES} ; do \
+-        $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/$${file} ; \
+-        chmod a+rx ${bindir}/$${file}; \
++        $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} 
${bindir}/$${file}-${version} ; \
++        chmod a+rx ${bindir}/$${file}-${version}; \
+       done
+       for file in ${INSTALLABLE_SCRIPTS} ; do \
+-        $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
+-        chmod a+rx ${bindir}/$${file}; \
++        $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}-${version} ; 
\
++        chmod a+rx ${bindir}/$${file}-${version}; \
+       done
+ 
+ uninstall:
Index: emacs21/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/editors/emacs21/pkg/PLIST-main,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-main
--- emacs21/pkg/PLIST-main      14 Dec 2006 09:07:56 -0000      1.2
+++ emacs21/pkg/PLIST-main      8 Jul 2014 19:43:16 -0000
@@ -1,59 +1,60 @@
 @comment $OpenBSD: PLIST-main,v 1.2 2006/12/14 09:07:56 steven Exp $
 @pkgpath ${BASE_PKGPATH}
-bin/b2m
-bin/ctags
-bin/ebrowse
-bin/emacs
-bin/emacs-${VERSION}
-bin/emacsclient
-bin/etags
-bin/grep-changelog
-bin/rcs-checkin
-@info info/ada-mode
-@info info/autotype
-@info info/ccmode
-@info info/cl
-@info info/dired-x
-@info info/ebrowse
-@info info/ediff
-@info info/efaq
-@info info/emacs
-@info info/emacs-mime
-@info info/eshell
-@info info/eudc
-@info info/forms
-@info info/gnus
-@info info/idlwave
-@info info/info
-@info info/message
-@info info/mh-e
-@info info/pcl-cvs
-@info info/reftex
-@info info/sc
-@info info/speedbar
-@info info/vip
-@info info/viper
-@info info/widget
-@info info/woman
+@option no-default-conflict
+@conflict ${PKGSPEC}
+@bin bin/b2m-${VERSION}
+@bin bin/ctags-${VERSION}
+@bin bin/ebrowse-${VERSION}
+@bin bin/emacs-${VERSION}
+@bin bin/emacsclient-${VERSION}
+@bin bin/etags-${VERSION}
+bin/grep-changelog-${VERSION}
+bin/rcs-checkin-${VERSION}
+@info info/ada-mode-${VERSION}
+@info info/autotype-${VERSION}
+@info info/ccmode-${VERSION}
+@info info/cl-${VERSION}
+@info info/dired-x-${VERSION}
+@info info/ebrowse-${VERSION}
+@info info/ediff-${VERSION}
+@info info/efaq-${VERSION}
+@info info/emacs-${VERSION}
+@info info/emacs-mime-${VERSION}
+@info info/eshell-${VERSION}
+@info info/eudc-${VERSION}
+@info info/forms-${VERSION}
+@info info/gnus-${VERSION}
+@info info/idlwave-${VERSION}
+@info info/info-${VERSION}
+@info info/message-${VERSION}
+@info info/mh-e-${VERSION}
+@info info/pcl-cvs-${VERSION}
+@info info/reftex-${VERSION}
+@info info/sc-${VERSION}
+@info info/speedbar-${VERSION}
+@info info/vip-${VERSION}
+@info info/viper-${VERSION}
+@info info/widget-${VERSION}
+@info info/woman-${VERSION}
 libexec/emacs/
 libexec/emacs/${VERSION}/
 libexec/emacs/${VERSION}/${GCCARCH}/
-libexec/emacs/${VERSION}/${GCCARCH}/cvtmail
-libexec/emacs/${VERSION}/${GCCARCH}/digest-doc
-libexec/emacs/${VERSION}/${GCCARCH}/emacsserver
-libexec/emacs/${VERSION}/${GCCARCH}/fakemail
+@bin libexec/emacs/${VERSION}/${GCCARCH}/cvtmail
+@bin libexec/emacs/${VERSION}/${GCCARCH}/digest-doc
+@bin libexec/emacs/${VERSION}/${GCCARCH}/emacsserver
+@bin libexec/emacs/${VERSION}/${GCCARCH}/fakemail
 libexec/emacs/${VERSION}/${GCCARCH}/fns-${VERSION}.1.el
-libexec/emacs/${VERSION}/${GCCARCH}/hexl
-libexec/emacs/${VERSION}/${GCCARCH}/movemail
-libexec/emacs/${VERSION}/${GCCARCH}/profile
+@bin libexec/emacs/${VERSION}/${GCCARCH}/hexl
+@bin libexec/emacs/${VERSION}/${GCCARCH}/movemail
+@bin libexec/emacs/${VERSION}/${GCCARCH}/profile
 libexec/emacs/${VERSION}/${GCCARCH}/rcs2log
-libexec/emacs/${VERSION}/${GCCARCH}/sorted-doc
+@bin libexec/emacs/${VERSION}/${GCCARCH}/sorted-doc
 libexec/emacs/${VERSION}/${GCCARCH}/vcdiff
-libexec/emacs/${VERSION}/${GCCARCH}/yow
-@man man/man1/ctags.1
-@man man/man1/emacs.1
-@man man/man1/etags.1
-@man man/man1/gfdl.1
+@bin libexec/emacs/${VERSION}/${GCCARCH}/yow
+@man man/man1/ctags-${VERSION}.1
+@man man/man1/emacs-${VERSION}.1
+@man man/man1/etags-${VERSION}.1
+@man man/man1/gfdl-${VERSION}.1
 share/emacs/
 share/emacs/${VERSION}/
 share/emacs/${VERSION}/etc/
@@ -1079,5 +1080,3 @@ share/emacs/${VERSION}/lisp/xscheme.elc
 share/emacs/${VERSION}/lisp/xt-mouse.elc
 share/emacs/${VERSION}/site-lisp/
 share/emacs/${VERSION}/site-lisp/subdirs.el
-share/emacs/site-lisp/
-share/emacs/site-lisp/subdirs.el
Index: emacs/Makefile
===================================================================
RCS file: /cvs/ports/editors/emacs/Makefile,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile
--- emacs/Makefile      9 Jan 2014 14:53:29 -0000       1.44
+++ emacs/Makefile      8 Jul 2014 19:52:09 -0000
@@ -4,7 +4,8 @@ COMMENT=                GNU editor: extensible, custom
 
 VERSION=               24.3
 DISTNAME=              emacs-${VERSION}
-REVISION=              4
+PKGSPEC=               emacs->=24
+REVISION=              5
 
 CATEGORIES=            editors
 
@@ -39,7 +40,7 @@ CFLAGS+=              -fno-pie
 MAKE_ENV=              INSTALL_EMACS="${INSTALL_SCRIPT}" \
                        LOGNAME="${SHAREOWN}"
 
-SUBST_VARS=            GCCARCH VERSION
+SUBST_VARS=            GCCARCH PKGSPEC VERSION
 
 MODULES=               devel/gettext
 LIB_DEPENDS=           devel/libexecinfo security/gnutls textproc/libxml
Index: emacs/pkg/PLIST
===================================================================
RCS file: /cvs/ports/editors/emacs/pkg/PLIST,v
retrieving revision 1.14
diff -u -p -r1.14 PLIST
--- emacs/pkg/PLIST     9 Jan 2014 14:53:29 -0000       1.14
+++ emacs/pkg/PLIST     8 Jul 2014 19:52:09 -0000
@@ -1,4 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.14 2014/01/09 14:53:29 jca Exp $
+@pkgpath ${BASE_PKGPATH}
+@option no-default-conflict
+@conflict ${PKGSPEC}
 @pkgpath editors/emacs22,-main
 @pkgpath editors/emacs22,-el
 @pkgpath editors/emacs23,-main


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to