From 63213c4501e5475f4cdbfb5dc405a1e2de357617 Mon Sep 17 00:00:00 2001 From: Donald Ephraim Curtis Date: Tue, 13 Dec 2011 21:04:08 -0600 Subject: [PATCH] Completion of reorganization. --- .gitignore | 4 +- .gitmodules | 2 +- README.md | 79 +++++++++++++++++++++++++++---- buildarchive => buildpkg | 0 melpa | 45 +++++++++++++----- package-build.el | 2 +- {archives => packages}/.situbusit | 0 webpage/index.tmpl | 7 +-- 8 files changed, 113 insertions(+), 26 deletions(-) rename buildarchive => buildpkg (100%) rename {archives => packages}/.situbusit (100%) diff --git a/.gitignore b/.gitignore index 102820c4..3405aa55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /sync -/archives/*.tar -/archives/archive-contents +/packages/*.tar +/packages/archive-contents /working/*/ /webpage/index.html /webpage/index.md diff --git a/.gitmodules b/.gitmodules index 65628e6f..e22cd589 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "epkgs"] path = epkgs - url = https://github.com/emacsmirror/epkgs.git + url = https://github.com/milkypostman/epkgs.git diff --git a/README.md b/README.md index bbf1359f..05d70a41 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,82 @@ # MELPA -This is some elisp that helps for building Emacs packages based on -version control -repositories. +Repository of code for *MELPA* or *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp Package Repository* if you're not into the whole brevity thing. -The `buildarchive` script will create an archive file in the -`archives/` folder with version corresponding to the newest revision -available. +### Checking out -Repositories are checked out to the `working/` directory. + git clone git://github.com/milkypostman/melpa.git + git sm init + git sm update + + +## Scripts + +* `buildpkg` -- Create an archive of the package(s) passed as +arguments to the script. Built packages are put in the `packages/` +folder with version corresponding to the newest HEAD revision +available; given according to the `%Y%m%d` format. + +* `melpa` -- All the logic for generating everything in +the repository based on the `pkglist` file. By default this will +update the [epkgs] repository, build all packages listed in `pkglist`, +compile the `index.html` file for the [melpa] website front page, and +sync with the site. + + The following arguments are accepted, + + update + : update the epkgs repository + + clear + : clean out the `packages/` directory + + build + : build all packages in `pkglist` + + index + : build the `index.html` file + + sync + : sync built files with the repository + +[melpa]: http://melpa.milkbox.net + + +## Code + +The `package-build.el` file contains all the heavy lifting. The +scripts above call the `package-build-archive` function from the +command-line to actually build the package(s). + + Alternatively you can +load this file from within Emacs and issues commands from there. + + + + +## Adding Packages + +Feel free to open an Issue requesting packages and I'll see if they +build nicely. + +## Developement + +Fork away! Send me some pull requests. + +### Notes + +Packages end up in the `packages/` directory by default. +This can be configured using the `package-build-archive-dir` variable. + +Repositories are checked out to the `working/` directory by default. +This can be configured using the `package-build-working-dir` variable. All metadata for building the packages is based off the git submodule for the [`epkgs`][epkgs] repository generated by the -[emacsmirror][emacsmirror]. +[emacsmirror][emacsmirror]. *However,* currently the site is not +keeping up-to-date so I have [mirrored the site][mepkgs]. +[mepkgs]: https://github.com/milkypostman/epkgs [emacsmirror]: https://github.com/emacsmirror/ [epkgs]: https://github.com/emacsmirror/epkgs diff --git a/buildarchive b/buildpkg similarity index 100% rename from buildarchive rename to buildpkg diff --git a/melpa b/melpa index 2abf72d4..4b6fdc20 100755 --- a/melpa +++ b/melpa @@ -1,25 +1,32 @@ #!/bin/bash +BASEDIR=`dirname $0` + function melpa_update_epkgs { echo "Updating epkgs..." - cd epkgs + pushd ${BASEDIR}/epkgs git pull - cd .. + popd echo } -function melpa_clear_archives { - echo "*** Clearing the archives folder..." - rm archives/* +function melpa_clear_packages { + echo "*** Clearing the packages folder..." + rm $BASEDIR/packages/* echo } function melpa_build_pkglist { echo "*** Building all packages..." - for pkg in `echo pkglist`; do - ./buildarchive + pushd ${BASEDIR} + for pkg in `cat pkglist`; do + echo "Building package: $pkg" + ./buildpkg $pkg + echo + echo done + popd echo } @@ -31,21 +38,37 @@ function melpa_build_archive { function melpa_sync { echo "*** Pushing changes to the server..." - rsync -avz --delete archives/ milkbox.net:webapps/melpa/packages + rsync -avz --delete packages webpage/index.html milkbox.net:webapps/melpa/ echo } function melpa_generate_html { echo "*** Building webpage..." - cd webpage + pushd ${BASENAME}/webpage awk '{ if(//) while((getline < "../pkglist")>0) print "* " $0 else print}' index.tmpl > index.md pandoc -s --mathml -t html --smart index.md > index.html - cd .. + popd echo } -melpa_generate_html +args=$@ + +if [[ "$#" == "0" ]]; then + args="update clear build html sync" +fi + +for task in $args; do + case $task in + update ) melpa_update_epkgs ;; + clear ) melpa_clear_packages ;; + build ) melpa_build_pkglist ;; + html ) melpa_generate_html ;; + sync ) melpa_sync ;; + esac + shift +done + diff --git a/package-build.el b/package-build.el index 8fc9d41c..02196c21 100644 --- a/package-build.el +++ b/package-build.el @@ -48,7 +48,7 @@ (defvar package-build-working-dir (expand-file-name "working/") "Directory in which to keep checkouts.") -(defvar package-build-archive-dir (expand-file-name "archives/") +(defvar package-build-archive-dir (expand-file-name "packages/") "Directory in which to keep compiled archives.") diff --git a/archives/.situbusit b/packages/.situbusit similarity index 100% rename from archives/.situbusit rename to packages/.situbusit diff --git a/webpage/index.tmpl b/webpage/index.tmpl index c6d89ad8..54678a85 100644 --- a/webpage/index.tmpl +++ b/webpage/index.tmpl @@ -1,8 +1,9 @@ -% milkypostman's ELPA for HEAD +% MELPA +# MELPA -# Melpa +*MELPA* or *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp Package Repository* if you're not into the whole brevity thing. -Melpa is a repository for development versions of Emacs packages (hot +MELPA is a repository for development versions of Emacs packages (hot from the repo). ## Installing