Putting Emacs/W3 in ELPA?
Steinar Bang <[email protected]> Sun, 22 Feb 2009 12:47:01 +0100
| Newsgroups | gmane.emacs.w3.devel |
|---|---|
| Organization | Probably a good idea |
| Message-ID | <[email protected]> |
Hi, I would like Emacs/W3 to be uploaded to ELPA (Emacs Lisp Package Archive) http://tromey.com/elpa/ This is because ELPA makes it very easy to quickly install the packages I want on different emacsen, on different platforms. I just do `M-x package-list-packages RET' to open a dired-like buffer, listing all emacs lisp packages on offer at ELPA, then mark the packages you'd like to install with `i' and then finally `x' to install them. I've already prepared an ELPA package and sendt to Tom Tromey, the maintainer of ELPA. But he prefers to have upstream approval, and also that the upstream maintainers upload new version directly to ELPA. To ease that task, I'm enclosing some diffs to the current git repo for ELPA. The diffs are originally from Tom Tromey, but I've modified them to make them run on debian etch (and lenny). The diffs make it possible to just do: make elpa to get a w3-$VERSION.tar file in the w3 directory that can be uploaded to ELPA. An ELPA package consists of a directory with all .el files and all info files, and a *-pkg.el file, containing package meta-info. It must be possible to byte compile all of the .el files by making load-path include the package directory. My modifications to Tom's original Makefile.in diffs, are: - Don't depend on .elc for building elpa - Use ginstall-info rather than install-info to create a dir.info file, since install-info on debian is a different version with different arguments, that's a part of the dpkg package - Generate a w3-pkg.el file - Added an elpaclean target that will delete the w3-pkg.el, the ELPA package, and any staging directories, and made clean also do elpaclean The w3.el change is, according to Tom, to make w3 adjust to the different directory layout it finds in ELPA. Here are the git diffs: diff --git a/Makefile.in b/Makefile.in index 449d657..42098f8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,9 +31,12 @@ distclean: clean for x in $(SUBDIRS); do ( cd $$x && $(MAKE) $@ ); done $(RM) config.* Makefile -clean: +clean: elpaclean for x in $(SUBDIRS); do ( cd $$x && $(MAKE) $@ ); done +elpaclean: + $(RM) $(ELPA_PACKAGE_DEF) $(DIRNAME).tar + dotemacs: @if (grep ";;; Emacs/W3 Configuration" $(DOTEMACS) 2>&1) >/dev/null; then \ echo Emacs/W3 setup already exists in $(DOTEMACS); \ @@ -102,3 +105,28 @@ _pkg.el: Makefile @echo ";;;###autoload" > _pkg.el @echo "(package-provide '$(PACKAGE)" >> pkg.el @echo " :version $(VERSION)" >> pkg.el + +############################################################################### +# ELPA +############################################################################### +ELPA_PACKAGE_DEF=lisp/w3-pkg.el + +elpa: info $(ELPA_PACKAGE_DEF) + rm -fr /tmp/$(DIRNAME) + mkdir /tmp/$(DIRNAME) + cp $(srcdir)/lisp/*.el /tmp/$(DIRNAME) + rm -f /tmp/$(DIRNAME)/docomp.el + rm -f /tmp/$(DIRNAME)/custom-load.el + rm -f /tmp/$(DIRNAME)/auto-autoloads.el + cp texi/*.info /tmp/$(DIRNAME)/ + tar cf - etc | (cd /tmp/$(DIRNAME); tar xf -) + rm -f /tmp/$(DIRNAME)/etc/Makefile + rm -f /tmp/$(DIRNAME)/etc/Makefile.in + ginstall-info /tmp/$(DIRNAME)/w3.info /tmp/$(DIRNAME)/dir + ginstall-info /tmp/$(DIRNAME)/w3-faq.info /tmp/$(DIRNAME)/dir + rm -f /tmp/$(DIRNAME)/dir.old + ( cd /tmp; tar cf - $(DIRNAME) ) | cat > $(DIRNAME).tar + rm -fr /tmp/$(DIRNAME) + +$(ELPA_PACKAGE_DEF): + echo "(define-package \"w3\" \"$(VERSION)\" \"A web browser written entirely in Emacs Lisp\")" > $(ELPA_PACKAGE_DEF) diff --git a/lisp/w3.el b/lisp/w3.el index b33623d..387600b 100644 --- a/lisp/w3.el +++ b/lisp/w3.el @@ -5,7 +5,7 @@ ;; Keywords: faces, help, comm, news, mail, processes, mouse, hypermedia ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Copyright (c) 1996, 97, 98, 99, 2001, 2007, 2008 Free Software Foundation, Inc. +;;; Copyright (c) 1996, 97, 98, 99, 2001, 2007, 2008, 2009 Free Software Foundation, Inc. ;;; Copyright (c) 1993 - 1996 by William M. Perry <[email protected]> ;;; ;;; This file is part of GNU Emacs. @@ -1710,6 +1710,9 @@ BUFFER, the end of BUFFER, nil, and (current-buffer), respectively." (if (fboundp 'locate-data-directory) (locate-data-directory "w3")) data-directory + ;; For ELPA. + (expand-file-name "etc" w3-lisp) + (concat data-directory "w3/") (expand-file-name "../../w3" data-directory) w3-lisp