Browse Source

A complete tool for building Emacs packages

master
Peter J. Jones 7 years ago
parent
commit
2eb3fc7ef3
4 changed files with 79 additions and 0 deletions
  1. 22
    0
      LICENSE.md
  2. 0
    0
      README.md
  3. 13
    0
      defpkg.sh
  4. 44
    0
      elpkg.mk

+ 22
- 0
LICENSE.md View File

@@ -0,0 +1,22 @@
# License

Copyright (C) 2012 Peter Jones <pjones@pmade.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 0
README.md View File


+ 13
- 0
defpkg.sh View File

@@ -0,0 +1,13 @@
#!/bin/sh

################################################################################
NAME=$1
ELFILE=$2
ELPKG=`dirname $0`
VERSION=`$ELPKG/version.sh $ELFILE`
DESC=`head -1 $ELFILE | sed -E 's/^.*-- *//'`
DEPS=`[ -r deps.el ] && cat deps.el`

###############################################################################
printf '(define-package "%s" "%s" "%s" %s)\n' \
"$NAME" "$VERSION" "$DESC" "$DEPS"

+ 44
- 0
elpkg.mk View File

@@ -0,0 +1,44 @@
################################################################################
CORE_FILE ?= lisp/$(NAME).el
ELPKG ?= elpkg
VERSION ?= $(shell $(ELPKG)/version.sh $(CORE_FILE))
PACKAGE ?= $(NAME)-$(VERSION)
TARBALL ?= $(PACKAGE).tar
PKG_FILES ?= $(shell git ls-files|egrep -vi '.git|makefile|elpkg')
EL_FILES ?= $(shell git ls-files|egrep '\.el$$')

################################################################################
EMACS = emacs
EMACS_FLAGS = -q --no-site-file --batch
EMACS_FLAGS += --eval "(add-to-list 'load-path \"lisp\")"
EMACS_FLAGS += -f package-initialize
EMACS_FLAGS += -f batch-byte-compile

################################################################################
.PHONEY: all clean compile

################################################################################
all: $(TARBALL)

################################################################################
compile: $(EL_FILES:.el=.elc)

################################################################################
clean:
rm -rf $(TARBALL) $(PACKAGE)
rm -f $(EL_FILES:.el=.elc)

################################################################################
$(PACKAGE): $(PKG_FILES)
mkdir $@
cp $(PKG_FILES) $@
$(ELPKG)/defpkg.sh $(NAME) $@/$(notdir $(CORE_FILE)) > $@/$(NAME)-pkg.el

################################################################################
$(TARBALL): $(PACKAGE)
tar -cf $@ $<

################################################################################
%.elc: %.el
@ echo emacs compile $<
@ $(EMACS) $(EMACS_FLAGS) $<

Loading…
Cancel
Save