From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: [PATCH] ELPA: Support for building Package Variants and Package Upload. Date: Sat, 28 May 2011 19:25:35 +0530 Message-ID: <81oc2nq694.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQJzN-0007CM-1p for emacs-orgmode@gnu.org; Sat, 28 May 2011 09:55:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQJzL-0004Ty-Fu for emacs-orgmode@gnu.org; Sat, 28 May 2011 09:55:36 -0400 Received: from mail-px0-f179.google.com ([209.85.212.179]:43856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQJzL-0004Tt-4w for emacs-orgmode@gnu.org; Sat, 28 May 2011 09:55:35 -0400 Received: by pxi2 with SMTP id 2so1481118pxi.38 for ; Sat, 28 May 2011 06:55:34 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Attaching an improvement to my earlier patch - http://patchwork.newartisans.com/patch/377/ The earlier patch can now be ignored. Jambunathan K. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ELPA-Support-for-building-Package-Variants-and-Packa.patch Content-Description: elpa.patch >From 2ba0a7341c7968f38086cec3d7d3e8f0a95960ad Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Wed, 18 May 2011 23:55:13 +0530 Subject: [PATCH] ELPA: Support for building Package Variants and Package Upload. * Makefile (PKG_TAG): Package version. Use YYMMDD as the default version. (PKG_SEP, PKG_FLAVOUR): New config variables for building various flavours of org, for eg., org-odt20110518.tar, (PKG_FILES): Removed (PKG_LISP_FILES, PKG_INFO_FILES): These files end up in the root dir. (PKG_DOC_FILES): Optional. These files end up in the doc dir. (PKG_DATA_DIRS): Optional. Extra directories to be distributed with tarball. For example, org-odt package uses this to distribute rnc schema files, default styles file and unit test files. (PKG_README_ORG_FILE): README file. (PKG_EL_DIR): Load path for package.el and package-x.el. Useful if the build machine runs an Emacs machine that doesn't ship with package manager (for example Emacs-23.x) (PKG_UPLOAD_DIR): Package tarball is copied here. This is presumably the 'pub' dir of the webserver hosting the package. (pkg-info, pkg-doc, pkg-data, pkg-readme, pkg-upload): New targets subsumed within pkg target. (pkg): Modified. Use the above targets. * doc/ReleaseNotes.org: New file used to build package README file. --- Makefile | 124 ++++++++++++++++++++++++++++++++++++++++++++------ doc/ReleaseNotes.org | 38 +++++++++++++++ 2 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 doc/ReleaseNotes.org diff --git a/Makefile b/Makefile index 9693fd3..984c515 100644 --- a/Makefile +++ b/Makefile @@ -170,18 +170,58 @@ TEXIFILES = doc/org.texi INFOFILES = doc/org # Package Manager (ELPA) + +# Common Usage + +# |---------------------------------------+----------------------+--------------| +# | Invocation | Output | Side-Effects | +# |---------------------------------------+----------------------+--------------| +# | make pkg | org-20110518.tar | | +# | make PKG_TAG=7.3 pkg | org-7.3.tar | | +# | make PKG_FLAVOUR=odt pkg | org-odt-20110518.tar | | +# |---------------------------------------+----------------------+--------------| + +# Advanced Usage + +# make PKG_EL_DIR="~/elisp" PKG_UPLOAD_DIR="~/packages/" PKG_TAG=7.3 pkg + +# Invocation shown above builds org-7.3.tar and uploads the same to +# "~/packages" using package-x.el in "~/elisp/". + +ifndef PKG_TAG PKG_TAG = $(shell date +%Y%m%d) +endif + +ifdef PKG_FLAVOUR +PKG_SEP = - +endif + +PKG_BNAME = org +PKG_QNAME = $(PKG_BNAME)$(PKG_SEP)$(PKG_FLAVOUR) +PKG_FNAME = $(PKG_QNAME)-$(PKG_TAG) + PKG_DOC = "Outline-based notes management and organizer" PKG_REQ = "nil" -PKG_FILES = $(LISPFILES0) \ - doc/dir doc/org \ - doc/pdflayout.sty \ - doc/org.pdf \ - doc/orgguide.pdf \ - doc/orgcard.tex \ - doc/orgcard.pdf \ - doc/orgcard_letter.pdf +PKG_LISP_FILES = $(LISPFILES0) +PKG_INFO_FILES = doc/org doc/dir +PKG_DOC_FILES = doc/org.pdf \ + doc/org.html \ + doc/orgguide.pdf \ + doc/orgcard.txt \ + doc/orgcard.pdf \ + doc/orgcard_letter.pdf + +PKG_DATA_DIRS = +PKG_README_ORG_FILE = doc/ReleaseNotes.org +PKG_README_HTML_FILE = $(PKG_README_ORG_FILE:.org=.html) + +# PKG_EL_DIR = +PKG_UPLOAD_DIR = packages + +ifdef PKG_EL_DIR +BATCH_EXTRA = -eval "(setq load-path (cons (expand-file-name \"$(PKG_EL_DIR)\") load-path))" +endif .SUFFIXES: .el .elc .texi SHELL = /bin/sh @@ -402,14 +442,68 @@ distfile: pkg: @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi + echo "Building $(PKG_FNAME).tar ..." touch doc/org.texi doc/orgcard.tex # force update - ${MAKE} info - ${MAKE} doc - rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar - $(MKDIR) org-$(PKG_TAG) - cp -r $(PKG_FILES) org-$(PKG_TAG) - echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el - tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files + rm -rf $(PKG_FNAME) $(PKG_FNAME).tar + $(MKDIR) $(PKG_FNAME) + cp -r $(PKG_LISP_FILES) $(PKG_FNAME) + ${MAKE} pkg-info + ${MAKE} pkg-doc + ${MAKE} pkg-data + ${MAKE} pkg-readme + echo "(define-package \"$(PKG_QNAME)\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > $(PKG_FNAME)/$(PKG_QNAME)-pkg.el + tar cf $(PKG_FNAME).tar $(PKG_FNAME) --remove-files + ${MAKE} pkg-upload + +pkg-data: $(PKG_DATA_DIRS) + @if [ "X$(PKG_DATA_DIRS)" = "X" ]; \ + then echo "*** WARNING: PKG_DATA_DIRS not defined ***"; \ + else \ + git clean -dfx $<; \ + mkdir -p $(PKG_FNAME)/$<; \ + cp -r $