X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/c80b4fdd041194064b373918de63d876d789d914..fe623377defcfb3a80ce30b2b4c8f62d9999818f:/Makefile diff --git a/Makefile b/Makefile index 7327f5243..47043f9d3 100644 --- a/Makefile +++ b/Makefile @@ -1,169 +1,74 @@ -# Makefile for emacs-lisp package - -# Copyright (C) 1998, 1999, 2004, 2007 Stefan Monnier - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3, or (at your option) any -# later version. - -# This file is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# load the package-specific settings -include makefile.pkg - -# set up the usual installation paths -prefix = /usr/local -datadir = $(prefix)/share - -# the directory where you install third-party emacs packges -lispdir = $(datadir)/emacs/site-lisp - -# the directory where the .elc files will be installed -elcdir = $(lispdir)/$(PACKAGE) -# the directory where the .el files will be installed -eldir = $(elcdir) - -# the file where the initialization goes. -#startupfile = $(HOME/.emacs -startupfile = $(lispdir)/site-start.el - -# the directory where you installed the elib .elc files. -# This is only needed if your site-start.el (or default.el) does not -# set up elib correctly. -elibdir = $(lispdir)/elib - -# the directory where you install the info doc -infodir = $(prefix)/info -docdir = $(prefix)/doc - -EMACS = emacs -MAKEINFO= makeinfo -TEXI2DVI= texi2dvi -SHELL = /bin/sh -DVIPS = dvips -CP = cp -RM = rm -f -MKDIR = mkdir -p -ETAGS = etags - -###################################################################### -### No changes below this line should be necessary ### -###################################################################### - -ELFLAGS = --eval '(setq load-path (append (list "." "$(elibdir)" "$(lispdir)") load-path))' -ELC = $(EMACS) -batch $(ELFLAGS) -f batch-byte-compile - -ELCFILES = $(ELFILES:.el=.elc) - -TEXEXTS = *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn - -.SUFFIXES: .elc .el .info .ps .dvi .texi -.PHONY: elcfiles info clean distclean default -.PHONY: install_startup install_elc install install_el install_info -.PHONY: dvi postscript - -.el.elc: - $(ELC) $< - -.texi.info: - $(MAKEINFO) $< - -.texi.dvi: - $(TEXI2DVI) $< - -.dvi.ps: - $(DVIPS) -f $< >$@ - -###################################################################### - -default: elcfiles - -elcfiles: $(ELCFILES) -info: $(PACKAGE).info - -install_elc: $(ELCFILES) $(PACKAGE)-startup.el - $(MKDIR) $(elcdir) - for f in $(ELCFILES) $(PACKAGE)-startup.el; do \ - $(CP) $$f $(elcdir)/$$f ;\ - done - -install_el: - $(MKDIR) $(eldir) - for f in $(ELFILES); do \ - $(CP) $$f $(eldir)/$$f ;\ +# Makefile for GNU Emacs Lisp Package Archive. + +EMACS=emacs + +ARCHIVE_TMP=archive-tmp +SITE_DIR=site + +.PHONY: archive-tmp process-archive archive-full org-fetch clean all do-it + +## Set up the source files for direct usage, by pointing +## `package-directory-list' to the site/ directory. +site: packages + mkdir -p $(SITE_DIR) + $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \ + --eval "(batch-make-site-dir \"packages\" \"$(SITE_DIR)\")" + +site/%: do-it + $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \ + --eval "(progn (setq debug-on-error t) (batch-make-site-package \"$@\"))" + +## Deploy the package archive to archive/, with packages in +## archive/packages/: +archive: archive-tmp + $(MAKE) $(MFLAGS) process-archive + +archive-tmp: packages + -rm -r $(ARCHIVE_TMP) + mkdir -p $(ARCHIVE_TMP) + cp -a packages/. $(ARCHIVE_TMP)/packages + +process-archive: + # First, refresh the ChangeLog files. This needs to be done in + # the source tree, because it needs the Bzr data! + cd packages; \ + $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \ + -f batch-prepare-packages + # FIXME, we could probably speed this up significantly with + # rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages + # that have indeed changed. + cd $(ARCHIVE_TMP)/packages; $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el -f batch-make-archive + @cd $(ARCHIVE_TMP)/packages; \ + for pt in *; do \ + if [ -d $$pt ]; then \ + echo "Creating tarball $${pt}.tar" && \ + tar -cf $${pt}.tar $$pt --remove-files; \ + fi; \ done - -install_info: $(PACKAGE).info - $(MKDIR) $(infodir) - $(CP) *.info* $(infodir)/ - -[ ! -w $(infodir)/dir ] \ - || install-info --info-dir=$(infodir)/dir $(PACKAGE).info - -install_startup: - $(MKDIR) $(lispdir) - @if grep $(PACKAGE) $(lispdir)/site-start.el >/dev/null 2>&1 || \ - grep $(PACKAGE) $(startupfile) >/dev/null 2>&1 || \ - grep $(PACKAGE) $(lispdir)/default.el >/dev/null 2>&1; then \ - echo "**********************************************************" ;\ - echo "*** It seems you already have some setup code" ;\ - echo "*** for $(PACKAGE) in your startup files." ;\ - echo "*** Check that it properly loads \"$(PACKAGE)-startup\"" ;\ - echo "**********************************************************" ;\ - else \ - echo 'echo ";; load $(PACKAGE) setup code" >>$(startupfile)' ;\ - echo ";; load $(PACKAGE) setup code" >>$(startupfile) ;\ - echo 'echo "(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile)' ;\ - echo "(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile) ;\ + mkdir -p archive/packages + mv archive/packages archive/packages-old + mv $(ARCHIVE_TMP)/packages archive/packages + chmod -R a+rX archive/packages + rm -rf archive/packages-old + rm -rf $(ARCHIVE_TMP) + +## Deploy the package archive to archive/ including the Org daily: +archive-full: archive-tmp org-fetch + $(MAKE) $(MFLAGS) process-archive + #mkdir -p archive/admin + #cp admin/* archive/admin/ + +org-fetch: archive-tmp + cd $(ARCHIVE_TMP)/packages; \ + pkgname=`curl -s http://orgmode.org/elpa/|perl -ne 'push @f, $$1 if m/(org-\d{8})\.tar/; END { @f = sort @f; print "$$f[-1]\n"}'`; \ + wget -q http://orgmode.org/elpa/$${pkgname}.tar -O $${pkgname}.tar; \ + if [ -f $${pkgname}.tar ]; then \ + tar xf $${pkgname}.tar; \ + rm -f $${pkgname}.tar; \ + mv $${pkgname} org; \ fi -postscript: $(PACKAGE).ps -dvi: $(PACKAGE).dvi -install_dvi: dvi - $(MKDIR) $(docdir) - $(CP) `find . -type f -name '*.dvi' -print` $(docdir)/ - -install: install_elc install_info install_startup install_el - clean: - $(RM) *~ core .\#* $(TEXEXTS) - -TAGS tags: - $(ETAGS) $(ELFILES) - -distclean: clean - $(RM) *.elc *.dvi *.info* *.ps - -###################################################################### -### don't look below ### -###################################################################### - -$(PACKAGE)-startup.el: $(ELFILES) - [ -f $@ ] || echo ' ' >$@ - $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "." - -## - -TAG = $(shell echo v$(VERSION) | tr '.' '_') -ftpdir=/u/monnier/html/elisp/ -cvsmodule=$(shell cat CVS/Repository) -cvsroot=$(shell cat CVS/Root) + rm -rf archive $(ARCHIVE_TMP) $(SITE_DIR) -dist: - cvs tag -F $(TAG) &&\ - cd $(TMP) &&\ - cvs -d $(cvsroot) export -r $(TAG) -d $(PACKAGE)-$(VERSION) $(cvsmodule) &&\ - cd $(PACKAGE)-$(VERSION) &&\ - gmake info $(PACKAGE)-startup.el &&\ - cd .. &&\ - ztar $(PACKAGE)-$(VERSION) &&\ - rm -rf $(PACKAGE)-$(VERSION) - mv $(TMP)/$(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/ - ln -sf $(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/$(PACKAGE).tar.gz +all: site