Difference between revisions of "ISFDB Build Process"

From ISFDB
Jump to navigation Jump to search
(add more)
(further explanation -- what a twisted arrangement)
Line 5: Line 5:
 
The '''common/''' Makefile creates subdirectories named '''local/''' in the other 4 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/'''.  It also doesn't copy about half the files (called CLASS_FILES) into '''biblio/'''.
 
The '''common/''' Makefile creates subdirectories named '''local/''' in the other 4 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/'''.  It also doesn't copy about half the files (called CLASS_FILES) into '''biblio/'''.
  
The '''biblio/''' Makefile first creates a 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 it's '''local/''' subdirectory.
+
The '''biblio/''' Makefile first creates a 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 it's '''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 puts their stuff into the respective subdirectories of the cgi-bin directory, and makes sure it exists before they do).
 +
 
 +
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.

Revision as of 05:23, 22 November 2010

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 (install and LOCAL) in each of the following subdirs: common/, biblio/, edit/, mod/, css/, and rest/. (common/ and css/ don't run LOCAL).

The common/ Makefile creates subdirectories named local/ in the other 4 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/. It also doesn't copy about half the files (called CLASS_FILES) into biblio/.

The biblio/ Makefile first creates a 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 it's 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 puts their stuff into the respective subdirectories of the cgi-bin directory, and makes sure it exists before they do).

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.