]> code.delx.au - gnu-emacs-elpa/blob - Makefile
b9b49fa1a28734c8c2467671b2d70238e4c45812
[gnu-emacs-elpa] / Makefile
1 # Makefile for GNU Emacs Lisp Package Archive.
2
3 EMACS=emacs
4
5 ARCHIVE_TMP=archive-tmp
6 SITE_DIR=site
7
8 .PHONY: archive-tmp changelogs process-archive archive-full org-fetch clean all do-it
9
10 ## Set up the source files for direct usage, by pointing
11 ## `package-directory-list' to the site/ directory.
12 site: packages
13 mkdir -p $(SITE_DIR)
14 $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
15 --eval "(batch-make-site-dir \"packages\" \"$(SITE_DIR)\")"
16
17 site/%: do-it
18 $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
19 --eval "(progn (setq debug-on-error t) (batch-make-site-package \"$@\"))"
20
21 ## Deploy the package archive to archive/, with packages in
22 ## archive/packages/:
23 archive: archive-tmp
24 $(MAKE) $(MFLAGS) process-archive
25
26 archive-tmp: packages changelogs
27 -rm -r $(ARCHIVE_TMP)
28 mkdir -p $(ARCHIVE_TMP)
29 cp -a packages/. $(ARCHIVE_TMP)/packages
30
31 # Refresh the ChangeLog files. This needs to be done in
32 # the source tree, because it needs the Bzr data!
33 changelogs:
34 cd packages; \
35 $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
36 -f batch-prepare-packages
37
38 process-archive:
39 # FIXME, we could probably speed this up significantly with
40 # rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages
41 # that have indeed changed.
42 cd $(ARCHIVE_TMP)/packages; $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el -f batch-make-archive
43 @cd $(ARCHIVE_TMP)/packages; \
44 for pt in *; do \
45 if [ -d $$pt ]; then \
46 echo "Creating tarball $${pt}.tar" && \
47 tar -cf $${pt}.tar $$pt --remove-files; \
48 fi; \
49 done
50 mkdir -p archive/packages
51 mv archive/packages archive/packages-old
52 mv $(ARCHIVE_TMP)/packages archive/packages
53 chmod -R a+rX archive/packages
54 rm -rf archive/packages-old
55 rm -rf $(ARCHIVE_TMP)
56
57 ## Deploy the package archive to archive/ including the Org daily:
58 archive-full: archive-tmp org-fetch
59 $(MAKE) $(MFLAGS) process-archive
60 #mkdir -p archive/admin
61 #cp admin/* archive/admin/
62
63 org-fetch: archive-tmp
64 cd $(ARCHIVE_TMP)/packages; \
65 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"}'`; \
66 wget -q http://orgmode.org/elpa/$${pkgname}.tar -O $${pkgname}.tar; \
67 if [ -f $${pkgname}.tar ]; then \
68 tar xf $${pkgname}.tar; \
69 rm -f $${pkgname}.tar; \
70 mv $${pkgname} org; \
71 fi
72
73 clean:
74 rm -rf archive $(ARCHIVE_TMP) $(SITE_DIR)
75
76 all: site