11 # I wonder if I should add the ability to put the Docs and Design etc
12 # directories in apropriate spots, like
13 # /usr/local/share/stem (site) or /usr/share/stem (vendor)
17 my $version_from = File::Spec->catfile( File::Spec->curdir, 'lib', 'Stem.pm' );
19 my $build = BuildStem->new(
20 #my $build = $class->new(
21 module_name => 'Stem',
22 dist_version_from => $version_from,
23 requires => \%requires,
24 dist_abstract => 'ABSTRACT GOES HERE',
27 recursive_test_files => 1,
28 create_makefile_pl => 'passthrough'
33 $build->is_unixish() || die "Stem currently only installs properly on *nix-like platforms.\n";
35 ### this will come in handy for some refactoring...
36 ## $build->config( 'install_base' )
42 This script will ask you various questions in order to properly
43 configure, build and install Stem on your system. Whenever a question
44 is asked, the default answer will be shown inside [brackets].
45 Pressing enter will accept the default answer. If a choice needs to be
46 made from a list of values, that list will be inside (parentheses).
48 If you have already configured Stem in a previous build, you can put
49 use_defaults=1 on the Build command line and you won't be prompted for
50 any answers and the previous settings will be used.
52 If you want to force a new build, run Build clean.
54 ----------------------------------------------------------------------------
60 Stem comes with a utility called 'run_stem' which takes care of things
61 like initalizing Stem with a configuration file and controlling it's
62 operation via various parameters you can pass in as environment
63 variables or command line arguments.
65 Stem configuration files are used to create and initialize Stem Cells
66 (objects). run_stem can search a path list for config files, so you
67 can set that list of directories here.
69 Note that you can easily override this path with either a shell environment
70 variable or on the command line of run_stem. See the documentation on
71 run_stem for how so do this.
73 The last directory in the list is where the standard and demo Stem
74 configuration files will be installed.
76 Please enter a list of directory paths separated by ':'.
80 my $conf_path = $build->prompt(
81 "What directories do you want Stem to search for configuration files?\n",
82 '.:~/.stem/conf:/usr/local/stem/conf'
84 $build->config_data(conf_path => $conf_path);
93 print "\n\nChecking to see if you have a good C compiler...\n\n" ;
94 if ( $build->have_c_compiler() ) {
98 ssfe (Split Screen Front End) is a compiled program optionally used by
99 the Stem demonstration scripts that provides a full screen interface
100 with command line editing and history. It is not required to run Stem
101 but it makes the demonstrations easier to work with and they look much
102 nicer. To use ssfe add the '-s' option when you run any demonstration
103 script. You can also use ssfe for your own programs. Install ssfe in
104 some place in your $PATH ($conf->{'bin_path'} is where Stem executables
105 are being installed) so it can be used by the demo scripts. The ssfe
106 install script will do this for you or you can do it manually after
110 my $install_ssfe = $build->y_n("Do you want to install ssfe?\n", 'y');
111 $build->config_data(install_ssfe => $install_ssfe);
112 if ( $install_ssfe ) {
114 # Do horrible, nasty things.
115 # This really should be done with a proper makefile.
128 Stem comes with a variety of demos to show how to get started and do some
132 my $install_demos = $build->y_n("\nDo you want to install the demos?\n",'n');
133 $build->config_data( install_demos => $install_demos ) ;
134 $build->config_data( build_demos => $install_demos ) ;
135 if ( $install_demos ) {
137 my $demo_dir = $build->prompt(
138 "\nWhere do you want to install the demo scripts?\n",
139 '/usr/local/stem/demo'
141 $build->config_data(demo_dir => $demo_dir);
142 $build->install_path()->{demo} ||= $demo_dir;
146 my $demo_conf_dir = $build->prompt(
147 "\nWhere do you want to install the demo config files?\n",
148 '/usr/local/stem/conf'
150 $build->config_data(demo_conf_dir => $demo_conf_dir);
151 $build->install_path()->{conf} ||= $demo_conf_dir;
152 $build->add_build_element('conf');
154 my $cur_conf_path = $build->config_data('conf_path') ;
155 my $new_conf_path = $cur_conf_path =~ /(^|:)$demo_conf_dir(:|$)/ ?
156 $cur_conf_path : "$cur_conf_path:$demo_conf_dir" ;
157 $build->config_data( conf_path => $new_conf_path ) ;
161 my $telnet_path = $build->find_binary( 'telnet' ) || '' ;
162 while ( ! -x $telnet_path && ! $build->_is_unattended() ) {
166 telnet was not found on this system. you can't run the demo programs
167 without telnet. Make sure you enter a valid path to telnet or some other
170 NOTE: If you don't have an telnet, you can still run the demo scripts
171 by hand. Run a *_demo script and see what telnet commands it
172 issues. The run those telnet commands using your telnet or another
176 $telnet_path = $build->prompt(
177 "Enter the path to telnet "
178 . "(or another compatible telnet client)",
182 $build->config_data( telnet_path => $telnet_path ) ;
186 my $xterm_path = $build->find_binary( 'xterm' ) || '' ;
187 while ( ! -x $xterm_path && ! $build->_is_unattended() ) {
191 xterm was not found on this system. you can't run the demo programs
192 without xterm. Make sure you enter a valid path to xterm or some other
195 NOTE: If you don't have an xterm, you can still run the demo scripts
196 by hand. Run a *_demo script and see what commands it issues. Take the
197 part after the -e and run that command in its own terminal window.
200 $xterm_path = $build->prompt(
201 "Enter the path to xterm "
202 . "(or another compatible terminal emulator)",
206 $build->config_data( xterm_path => $xterm_path ) ;
212 my $script_dest = $build->install_destination('script') ;
213 my $run_stem_path = File::Spec->catfile( $script_dest, 'run_stem' ) ;
214 $build->config_data( run_stem_path => $run_stem_path ) ;
219 my $bin_path = $build->install_destination('bin') ;
220 $build->config_data( bin_path => $bin_path ) ;
222 $build->config_data( perl_path => $build->config( 'perlpath' ) ) ;
224 # Several different prefixes... which one to use??
225 #$build->config_data( prefix => $build->prefix() ) ;
226 $build->config_data( prefix => $build->config( 'install_base' ) ) ;
229 $build->config_data( config_done => 1 ) ;
232 #print Dumper \%{ $build->config_data() };
235 $build->create_build_script() ;