10 Building Definitions Programmatically

The ‘.alpm’ file format is just the serialization of calls you can make yourself:

(setq sys (alpm-make-system "newlib"))
(alpm-system-set sys 'version "0.1.0")
(alpm-system-set sys 'depends-on '("geometry"))
(alpm-add-file sys "base")
(alpm-add-file sys "extra" '(depends-on ("base")))
(alpm-register-system sys)
(alpm-save-system sys "/home/pjb/lisp/newlib/newlib.alpm")

alpm-save-system’ writes a ‘.alpm’ file that reproduces the definition exactly when loaded.