ISFDB Build Process

The ISFDB software build process is configured by two files: INSTALLDIRS and common/localdefs.py. The build process is started by running make install in the base directory (i.e. isfdb2/ assuming you checked it out of CVS).

The base directory Makefile simply runs make with two targets (LOCAL and then install) in each of the following subdirs: common/, biblio/, edit/, mod/, css/, nightly/, and rest/. (common/ and css/ don't run LOCAL).

The common/ Makefile creates subdirectories named local/ in the other 5 directories (except css/), then copies nearly all the files in common/ into each of the other directories. It doesn't copy isfdblib.py anywhere, and it copies localdefs.py into the local subdirs, as well as copying it into css/ and scripts/.

The biblio/ Makefile first uses the contents of the file TARGETS to create a new file, .TARGETS, that defines a list of the contents of the directory, but with local/ prepended, and the .py extension replaced with .cgi. It then runs make on local.mk and install.mk. local.mk runs install.py (copied from common/ above) on all the files listed in .TARGETS (i.e. all the files). See below for what install.py does. Then it copies some of the files (called LIBS and MYLIBS) in biblio/ into its local/ subdirectory. Then it does the following to the cgi-bin directory (specified as INSTALL_CGI in INSTALLDIRS): it removes any .pyc files there, copies the contents of local/ into it, sets the permissions on all the .py files to rw--r--r-- and all the .cgi files to rwx-r-xr-x.

The edit/, mod/ and rest/ Makefiles do the same except they put their stuff into the respective subdirectories of the cgi-bin directory, and make sure it exists before they do. The nightly/ Makefile does the same except it uses a different version of install.pyy -- see below.

The css/ Makefile runs index_install.py, which replaces "HTMLHOST" in index_stub with the value from localdefs.py and outputs the result as index.html, then copies a few of the files in the directory into the INSTALL_HTML directory.

The install.py script replaces "_PYTHONLOC" in the files with the location of the python binary (as specified in each local.mk file), and puts the altered copy into the given location, with .cgi as the extension. It then (redundantly with the local.mk files) sets the permissions to rwx-r-xr-x. The nightly/ Makefile uses a special file, install_nightly.py, instead of install.py because the Python file that it copies remains a .py file rather than getting converted to .cgi.