12 my $version_from = File::Spec->catfile(
13 File::Spec->curdir, 'lib', 'Stem.pm'
16 my $build = BuildStem->new(
17 module_name => 'Stem',
18 dist_version_from => $version_from,
23 'An asynchronous message passing framework for Perl',
26 recursive_test_files => 1,
32 create_makefile_pl => 'passthrough'
37 $build->is_unixish() or
38 die "Stem currently only installs properly on *nix-like platforms.\n";
41 ### ask about the config path and where to install bundled config files
45 Stem configuration files are used to create and initialize Stem Cells.
46 An included program called 'run_stem' will search a default path for
47 a specified config file and use it to get everything going. You can see
48 this in action if you check out Stem's demo scripts.
50 Note that you can easily override this path with either a shell environment
51 variable or a command line agrument. See the documentation on run_stem for
57 conf_path => scalar $build->prompt(
58 "Please enter a list of directory paths separated by ':'\n",
59 '.:~/.stem/conf:/usr/local/stem/conf'
66 Where would you like to install the config files bundled with Stem?
67 If you specify a directory not already in the path above, it will be
68 appended. If this directory does not exist, it will be created.
73 conf_dir => scalar $build->prompt(
74 "Please enter a directory path:\n",
75 '/usr/local/stem/conf'
79 ### add the conf_dir to the conf_path, if necessary
81 my $conf_path = $build->config_data( 'conf_path' );
82 my $conf_dir = $build->config_data( 'conf_dir' );
83 if ( $conf_path =~ /(^|:)\Q$conf_dir\E(:|$)/ ) {
84 $build->config_data( conf_path => "$conf_path:$conf_dir" );
90 ### ask about building the demo scripts
93 Stem comes with a variety of demos to show how to get started and do some
94 basic things. If you wish to try them they will be available in the demo/
95 directory after you run ./Build. In any case, they will not be installed
96 to the system, even after you install the rest of Stem.
101 build_demos => scalar $build->y_n(
102 "Do you want to build the demos?\n", 'y'
107 if ( $build->config_data( 'build_demos' ) ) {
110 ### Try to find telnet
111 my $telnet_path = $build->find_binary( 'telnet' ) || '' ;
112 while ( ! -x $telnet_path && ! $build->_is_unattended() ) {
115 telnet was not found on this system. the demo programs won't run properly
116 without telnet. Please enter a valid path to telnet, or a single <space>
120 $telnet_path = $build->prompt(
121 "Enter the path to telnet "
122 . "(or another compatible telnet client)",
125 last if $telnet_path =~ s/^\w+$//;
127 $build->config_data( telnet_path => $telnet_path || undef ) ;
133 my $xterm_path = $build->find_binary( 'xterm' ) || '' ;
134 while ( ! -x $xterm_path && ! $build->_is_unattended() ) {
137 xterm was not found on this system. the demo programs won't run properly
138 without xterm. Please enter a valid path to xterm or a single <space> to
142 $xterm_path = $build->prompt(
143 "Enter the path to xterm "
144 . "(or another compatible terminal emulator)",
147 last if $xterm_path =~ s/^\w+$//;
149 $build->config_data( xterm_path => $xterm_path || undef ) ;
152 ### Only build ssfe if we have a working C compiler
153 if ( $build->have_c_compiler() ) {
156 ssfe (Split Screen Front End) is a compiled program optionally used by
157 the Stem demonstration scripts that provides a full screen interface
158 with command line editing and history. It is not required to run Stem
159 but it makes the demonstrations easier to work with and they look much
160 nicer. To use ssfe add the '-s' option when you run any demonstration
161 script. You can also use ssfe for your own programs. If you build ssfe
162 it will be installed in the demo/ directory. You may copy it to a place
163 in your $PATH is you wish.
167 build_ssfe => scalar $build->y_n(
168 "Do you want to build ssfe for the demos?\n", 'y'
177 ### NOTE: find out whether or not each of the following
178 ### config_data settings are actually being *used* for anything
180 my $script_dest = $build->install_destination('script') ;
181 my $run_stem_path = File::Spec->catfile( $script_dest, 'run_stem' ) ;
182 $build->config_data( run_stem_path => $run_stem_path ) ;
187 my $bin_path = $build->install_destination('bin') ;
188 $build->config_data( bin_path => $bin_path ) ;
190 $build->config_data( perl_path => $build->config( 'perlpath' ) ) ;
192 # Several different prefixes... which one to use??
193 #$build->config_data( prefix => $build->prefix() ) ;
194 $build->config_data( prefix => $build->config( 'install_base' ) ) ;
197 $build->config_data( config_done => 1 ) ;
200 #print Dumper \%{ $build->config_data() };
203 $build->create_build_script() ;