+More at http://elpa.gnu.org/packages/$pkg.html
+ENDDOC
+}
+
+cd ../elpa
+
+# Fetch changes.
+git pull || signal_error "git pull failed"
+
+# Remember we're inside the "elpa" branch which we don't want to trust,
+# So always refer to the makefile and admins files from $builddir".
+
+# Setup and update externals.
+emacs --batch -l "$buildir/admin/archive-contents.el" \
+ -f archive-add/remove/update-externals
+
+make -f "$buildir/GNUmakefile" check_copyrights ||
+ signal_error "check_copyright failed"
+
+cd "$buildir"
+
+rsync -av --delete \
+ --exclude=ChangeLog \
+ --exclude=.git \
+ --exclude='*.elc' \
+ --exclude='*~' \
+ --exclude='*-autoloads.el' \
+ ../elpa/packages ./
+
+# Refresh the ChangeLog files. This needs to be done in
+# the source tree, because it needs the VCS data!
+emacs -batch -l admin/archive-contents.el \
+ -eval '(archive-prepare-packages "../elpa")'