# # cgimake config file # Copyright (c) 1999 by Barrie Slaymaker, rbs@telerama.com # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the README file. # # Configuration Options: set these to reasonable values for your system # # These are read once at cgimake startup and affect all cgimake projects. # Most of the items here can be overridden on a per-project basis, as well. # # To override these on a per-project basis, create a directory with the # project's name in the same directory as this file, then place a # cgimake.conf file in that directory and override those values that # you want to change on a per-project basis. # # # $email_errors # # If set, this is the address to email Safari errors to. # $email_errors="barries" ; # # $work_root # # cgimake generally needs a working area for all of the intermediate and # final files to reside in. $work_root is it. # # $work_root = '/var/spool/safari' ; # $work_root = 'c:\\tmp\\safari' ; # # If this is _not_ overridden, then the project name is appended to this. # #$work_root = '/var/spool/safari' ; $work_root = "/home/barries/src/safari/test/spool" ; $work_root .= "/$project" if defined( $project ) && length( $project ) ; # # $lib_root # # cgimake generally needs a working area for all of the intermediate and # final files to reside in. $work_root is it. # # $lib_root = '/usr/local/lib/safari' ; # $lib_root = 'c:\\tmp\\safari' ; # #$lib_root = '/usr/local/lib/safari' ; $lib_root = "$config_dir" ; $lib_root .= "/$project" if defined( $project ) && length( $project ) ; # # $output_root # # This defines the prefix prepended to all targets passed in via cgi. The # files under this root will be files that can be catted to the sender, # including http headers like Content-type. # # The makefile should only use this directory for final files. All # intermediate files should be kept under other subdirs of $work_root. # # Don't put a leading or trailing slash in here: it needs to be relative, # and the path appended to this already has a leading slash. # # $output_root = "http" ; # $output_root = "http" ; # # $lock_root # # This defines the root of the lockfiles hierarchy. See $lock_mode. # # $lock_root = "lock" ; # $lock_root = "lock" ; # # $make_path # # The full path to your maker. Don't forget to use native path syntax or # your system's shell might hiccup (or barf). # # Examples: # # $make_path = '/usr/bin/make' ; # $make_path = 'c:\\bin\\make.exe' ; # $make_path = '/usr/bin/make' ; # # $make_options # # These are options passed to make with the targets. Unless you really # want the Makefile to appear in your cgi-bin directory (a moderately bad # idea), you should place it somewhere else and pass an option to make to # tell it where to find it. It's also a good idea to suppress builtin # rules unless you need them, for speed and so they don't trip you up. # # Example: # # $make_options = "--file=$lib_root/conf/Makefile" ; # $make_options = "--file=$lib_root\\conf\\Makefile" ; # $make_options = "--file=$lib_root/Makefile --no-builtin-rules" ; # # $bin_dir # # Where to find executables that aren't in the normal PATH. This is pushed # on to $ENV{PATH} before make is run. You probably need this to be # blank on systems other than DOS or Unix. # @path_prefix = ( "$project/bin", "bin" ) ; # # target_fixup() # # This is a subroutine that is applied to each target before # it is passed to make. Typical things to do here are # # - convert from URL file separators to your local filesystem's separators, # - make sure the path begins with a separator # - prevent '..' like constructs from causing security holes. # # If you need to run on multiple platforms, take a look at File::Spec # for a nice collection of helper routines. # # This routine can modify $_, but it must return the full name of the target, # so 'return $_' is a (dangerous) minimal sub here. Prepending an absolute # path prefix is a pretty darn good idea, as is ensuring that there are # not too many '..' equivalents in the target's path. File::Spec can help # here too. # # Examples (should really use File::Spec here, but it's not standard in # older perls): # # # Unixian # sub target_fixup { # error( "No '..' allowed in target" ) if m@(^|/)\.\.(/|$)@ ; # $_ = '/' . $_ unless m@^/@ ; # return $output_root . $_ ; # } # # # DOSish # sub target_fixup { # s@[\\/]+@\\@g ; # Tilt to native seps # $_ = '\\' . $_ unless m@^\\@ ; # error( "No '..' allowed in target" ) if m@(^|\\)\.\.(\\|$)@ ; # return $_ ; # } # sub target_fixup { $_ = '/' . $_ unless m@^/@ ; error( "No '..' allowed in target" ) if m@(^|/)\.\.(/|$)@ ; return $_ ; } # # $lock_mode # # 'global' is the most conservative setting and should be suitable for # most developer groups: it serializes all accesses using a single lock. # This assumes that make will exit fairly quickly, since it should rarely # need to do anything. # # 'targets' is a little more fine-grained than 'global': it locks on a # per target basis. This assumes that targets don't share intermediate # files, since that would allow two make instances to try to update the # same intermediate file. # # 'external' means that this script should do no locking. This is good for # high bandwidth sites if file locking can be provided in make or in the # makefile. # # $lock_mode = 'global' ; # # $lock_mode = 'targets' ; # # $lock_mode = 'external' ; # $lock_mode = 'targets' ; # # $result_mode # # 'make' means that the output of the make command will be returned. This # can also be done by adding a query term "result=make". # # 'targets' means that the target files will be bulk copied to stdout. # This can also be done by adding a query term "result=targets". # # 'nomake' is like 'targets', but prevents make from being run. # # Setting the query term overrides this configuration setting if you use # ||=, using = causes the query term setting to be ignored. # $result_mode ||= 'targets' ; # # $log_debug # # Turns on lots of printing to this process's log file. # $log_debug = 1 ; # # %env_override # # Provides additional and replacement environment variables. # %env_override = ( ) ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 181 | Barrie Slaymaker | cgimake can now mail copies of error reports to an administrator | ||
#4 | 178 | Barrie Slaymaker |
Modified cgimake to get the project name out of the target name if one isn't supplied. This makes it so that Apache's mod_rewrite is no longer needed to extract the project name from the URL and place it in the QUERY_STRING, and so that you can call cgimake from the command line and place the project name in the target path: cgimake /perl/_head/Default/depot/ Modified cgimake to work easily from the command line Fixed some minor bugs in assembling paths that were causing // to appear in paths when no project is specified. Fixed minor bug that cause cgimake to try to read a bogus config file when there is no $project Tweaked p4_get to provide a more reasonable level of verbosity. Updated the apache doc to reflect the simpler, non-rewrite technique. Added targets to fetch a new _head revision if the head change number has changed. Need to check in p4_update. |
||
#3 | 168 | Barrie Slaymaker | Added YAPC paper, slides | ||
#2 | 165 | Barrie Slaymaker | Applied Greg KH's license patch. | ||
#1 | 162 | Barrie Slaymaker | First code & documentation checkin |