NOTE: This page is in progress, not all of the things listed have been done yet,
this is just the plan. See the todo for current status.
I(taggart) have overhauled the build and install system. The new system is less complicated while achiving the same result, does things in a more FOSS-like manner, is more easily extensible and hackable, and most importantly will make generating packages easier.
The old system:
“make install” copies files into an “install/” directory in the build tree
the install.sh script does the install and setup including copying all the files from the “install/” dir to their final location and setting their ownership/permissions; setting up the database, repository, and configuration files; making sure that user/group exist; etc
the check.sh script does checks on the runtime system to make sure that things are installed correctly.
The new system:
“make install” in each source directory copies files directly to where they should go and sets there ownership and permissions, all done using install(1).
on the runtime system after the files are installed the new “fo-postinstall” script does the required setup to go from a set of installed files to a working system.
after the postinstall script has run, or at any time desired, the “fo-installcheck” script checks that the system is installed and configured properly.
Split install into build time actions and post install actions
switch all makefiles to use coreutils’ install(1) rather than doing things by hand. Install into final location (DESTDIR dependent) rather than pseudoroot for mkinstall to use.
define INSTALL, INSTALL_PROGRAM, INSTALL_DATA (GCS 7.2.3) as part of implementing above
Get rid of makefile variables for: mkdir, rm, cp, ...
Make each makefile recurse into those directly below it.
Currently the top level makefile does everything, it will be easier to understand if we push the details into the directories. This means creating some new simple makefiles in some of the directories. We now use subdir targets instead of for loops, it’s less complicated, easier to read, less likely to make typos, and allows for parallel builds. This also gets rid of:
extra info echo in each makefile loops, the output make generates is sufficent: “make[1]: Entering directory `..../dir’”
extra directory tests in all makefile loops, test no longer needed due to using subdir targets
Makefile cleanup
adopt GCS makefile target names, make sure expected targets exist
CFLAGS needs to be moved to last in each use so users can use CFLAGS to override stuff (GCS 7.2.3)
things that are required for compliation can’t go in CFLAGS, because users expect to be able to use that, use something independent (like the ALL_CFLAGS example in GCS 7.2.3)
implement way to add directory specific things to CFLAGS
get rid of all the CFLAGS debugging stuff in each makefile, you can now set CFLAGS on the make command line at any level in the hierarchy and it will be used from that point down
in the process of dealing with the above, clean up the existing CFLAGS2
make sure boilerplate is consistant
make sure PHONY targets are all declared
Remove details specific to our own working environment
I’ve completely replaced the mkinstall.sh script. Here is a list of what it did and where that functionality has moved.
make sure that $PROJECTUSER and $PROJECTGROUP exist, if not create them. We do this in fo-postinstall now.
removed obsolete licenses and old ui. We don’t do this anymore, it is now assumed that if you are using the upstream install process that you will “make uninstall” the previous version before installing, just leave any cruft extra around, or maybe we’ll write a postrm script. People using packages won’t have this problem only the “expert” upstream users with a really old install.
install dirs, files, and links and set their ownership and permissions. We do this as part of “make install” now.
“force install”. We always install all dirs/files, writing over any existing files, with the exception of conffiles. If a conffile doesn’t exist it installs a fresh one, if it does it just issues a warning and installs in $file.new.
In the fresh install or “DESTDIR is pseudoroot” cases, this results in them getting a new conffile
In the “repeat make install” case, they get a warning and a new conffile they can merge by hand.
test dir/file/link existance, ownership, and permissions. The new “make install” should set things in a known good state, and the new selftest agent will also check for a few critical things.
-
create/chown/chmod $VARDATADIR, $PROJECTHOME, and $REPODIR. This is done in the top level Makefile “make install” now.
create /etc/default/fossology file. Done in the scheduler Makefile now.
create $DATADIR/dbconnect/$PROJECT. Done in the scheduler Makefile now.
create Depth.conf, Hosts.conf, and RepPath.conf in $REPOCONF. These are now created in $SYSCONFDIR/$PROJECT/ by fo-postinstall and we removed the leading capital to be consistant with other config files (and fixed other places in the code/documentation that use the caps).
test for existance of above config files and that RepPath exists and is a proper repository. This can move to the scheduler/selftest agent.
create scheduler.conf. mkconfig is now called on the runtime system via postinstall, added instructions to the README.
create proxy.conf. Checking for the existance of *_proxy environment variables is problematic, if we do it at build time those results will likely be wrong at runtime, and doing it at runtime via a postinstall script those variables won’t be set anyway. So we just create a file with commented out examples and have the scheduler Makefile install it.
initialize the database. Now done in fo-postinstall.
create License.bsam. This has to happen on the runtime system post install. Need to move to it’s own script and called from fo-postinstall
added www-data to $PROJECTGROUP. Moved to postinstall.
initialize agents. Moved to postinstall. should be plugin-like 
Additional instructions:
check for php5. Added check to fo-runtime-test
configure web server. This is explained in README
put web server user in $PROJECTGROUP and restart. Can’t automate reliably, added to README
human check of config files. Added to README.
Cleaned up the mkcheck.sh script. Here is a list of what it did and what has changed.
look for headers and libraries. The build errors are verbose enough that this isn’t needed, removed.
check for user and group and that user is in group. Left alone.
check for all files and permissions/ownership. This only applies to installs where everything is on the same system (upstream but not necessarily packages). Reimplemented this to work at runtime rather than install time.
check that conffiles exist and have correct ownership/permissions. Left alone.
if www-data group exists check that $PROJECTUSER is in www-data group. Left alone.
have ununpack check for it’s dependencies. 
check that the scheduler works. 
check repo permissions. 
rename check.sh to fo-installcheck and install.sh to fo-postinstall and have the top level Makefile install them.
Test all changes and make sure the build/install works as expected.
Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P.
FOSSology Project documentation is licensed under the GNU Free Documentation License Version 1.2
|