Pacman DB Viewer

A web view for Pacman package databases.


This setup uses Quicklisp, bower, systemd, GNU Screen, SBCL and Lighttpd to get things running. This is not the only way to do it, but it is the way I've set it up.

  1. Clone pacman-db-viewer into your quicklisp local-projects directory and install the bower dependencies.
    cd ~/quicklisp/local-projects
    git clone git://
    cd pacman-db-viewer
    bower install
  2. Create a file ~/start-pacman-db-viewer.lisp and put the following contents in it:
    (ql:quickload "pacman-db-viewer")
    (setf pacman-db-viewer-config:*database-file* #P"/path/to/pacman.db.tar.gz")
    (defparameter *urlmap* (make-instance '<clack-app-urlmap>))
    (mount *urlmap*  "/packages/" (pacman-db-viewer:get-app))
    (defvar *handler* (clack:clackup *urlmap* :port 8028))

    The /packages/ path and 8028 port are both just suggestions. You can use whichever values you like.

    If you have any other clack-based applications you can easily add them by adding more mount calls.

  3. Create a service file in ~/.config/systemd/user/ named pacman-db-viewer.service. Put the following contents in it:
    Description=Pacman DB Viewer
    ExecStart=/usr/bin/screen -D -m /usr/bin/sbcl --load /path/to/start-pacman-db-viewer.lisp
  4. Start and enable the service:
    systemctl --user start pacman-db-viewer
    systemctl --user enable pacman-db-viewer

    It can take a while to start if you install the dependencies for the first time or if you've just updated your quicklisp dists.

    Note: Just in case you don't already have that, be sure to enable user lingering for whichever user you use to run this service:

    sudo loginctl enable-linger username

    Where username should be replaced with whichever username you use to run pacman-db-viewer.

  5. Setup a reverse proxy in lighttpd.conf:
    server.modules += ( "mod_proxy" )
    $HTTP["host"] =~ "^(www\.)?example\.com" {
        $HTTP["url"] =~ "^/packages/?" {
            proxy.server = ( "" => (( "host" => "",
                                      "port" => 2028 )) )

    Where you'd replace with your own domain (which you probably already have setup), packages with whichever path you specified in start-pacman-db-viewer.lisp, and the port you specified there as well.

Author: Tom Willemse

Created: 2015-02-08 Sun 16:52

Emacs (Org mode 8.2.10)