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";
40 This script will ask you various questions in order to properly
41 configure, build and install Stem on your system. Whenever a question
42 is asked, the default answer will be shown inside [brackets].
43 Pressing enter will accept the default answer. If a choice needs to be
44 made from a list of values, that list will be inside (parentheses).
46 If you have already configured Stem in a previous build, you can put
47 use_defaults=1 on the Build command line and you won't be prompted for
48 any answers and the previous settings will be used.
50 If you want to force a new build, run Build clean.
52 ----------------------------------------------------------------------------
60 Stem configuration files are used to create and initialize Stem Cells
61 (objects). Stem needs to know the list of directories to search to
62 find its configurations files.
64 Note that the default has a single absolute path. You can test Stem
65 configurations easily setting this path when executing run_stem. You
66 can override or modify the path time with either a shell environment
67 variable or on the command line of run_stem. See the documentation on
68 run_stem for how so do this.
70 The first directory in the list is where the standard Stem
71 configuration files will be installed.
73 Enter a list of absolute directory paths separated by ':'.
77 my $conf_path = $build->prompt(
78 "What directories do you want Stem to search for configuration files?\n",
79 '.:./conf:~/.stem/conf:/usr/local/stem/conf'
81 $build->config_data(conf_path => $conf_path);
90 print "\n\nChecking to see if you have a good C compiler...\n\n" ;
91 if ( $build->have_c_compiler() ) {
95 ssfe (Split Screen Front End) is a compiled program optionally used by
96 the Stem demonstration scripts that provides a full screen interface
97 with command line editing and history. It is not required to run Stem
98 but it makes the demonstrations easier to work with and they look much
99 nicer. To use ssfe add the '-s' option when you run any demonstration
100 script. You can also use ssfe for your own programs. Install ssfe in
101 some place in your $PATH ($conf->{'bin_path'} is where Stem executables
102 are being installed) so it can be used by the demo scripts. The ssfe
103 install script will do this for you or you can do it manually after
107 my $install_ssfe = $build->y_n("Do you want to install ssfe?\n", 'y');
108 $build->config_data(install_ssfe => $install_ssfe);
109 if ( $install_ssfe ) {
111 # Do horrible, nasty things.
112 # This really should be done with a proper makefile.
125 Stem comes with a variety of demos to show how to get started and do some
129 my $install_demos = $build->y_n("\nDo you want to install the demos?\n",'n');
130 $build->config_data( install_demos => $install_demos ) ;
131 $build->config_data( build_demos => $install_demos ) ;
132 if ( $install_demos ) {
134 my $demo_dir = $build->prompt(
135 "\nWhere do you want to install the demo scripts?\n",
136 '/usr/local/stem/demo'
138 $build->config_data(demo_dir => $demo_dir);
139 $build->install_path()->{demo} ||= $demo_dir;
143 my $demo_conf_dir = $build->prompt(
144 "\nWhere do you want to install the demo config files?\n",
145 '/usr/local/stem/conf'
147 $build->config_data(demo_conf_dir => $demo_conf_dir);
148 $build->install_path()->{conf} ||= $demo_conf_dir;
149 $build->add_build_element('conf');
151 my $cur_conf_path = $build->config_data('conf_path') ;
152 my $new_conf_path = $cur_conf_path =~ /(^|:)$demo_conf_dir(:|$)/ ?
153 $cur_conf_path : "$cur_conf_path:$demo_conf_dir" ;
154 $build->config_data( conf_path => $new_conf_path ) ;
158 my $telnet_path = $build->find_binary( 'telnet' ) || '' ;
159 while ( ! -x $telnet_path && ! $build->_is_unattended() ) {
163 telnet was not found on this system. you can't run the demo programs
164 without telnet. Make sure you enter a valid path to telnet or some other
167 NOTE: If you don't have an telnet, you can still run the demo scripts
168 by hand. Run a *_demo script and see what telnet commands it
169 issues. The run those telnet commands using your telnet or another
173 $telnet_path = $build->prompt(
174 "Enter the path to telnet "
175 . "(or another compatible telnet client)",
179 $build->config_data( telnet_path => $telnet_path ) ;
183 my $xterm_path = $build->find_binary( 'xterm' ) || '' ;
184 while ( ! -x $xterm_path && ! $build->_is_unattended() ) {
188 xterm was not found on this system. you can't run the demo programs
189 without xterm. Make sure you enter a valid path to xterm or some other
192 NOTE: If you don't have an xterm, you can still run the demo scripts
193 by hand. Run a *_demo script and see what commands it issues. Take the
194 part after the -e and run that command in its own terminal window.
197 $xterm_path = $build->prompt(
198 "Enter the path to xterm "
199 . "(or another compatible terminal emulator)",
203 $build->config_data( xterm_path => $xterm_path ) ;
209 my $script_dest = $build->install_destination('script') ;
210 my $run_stem_path = File::Spec->catfile( $script_dest, 'run_stem' ) ;
211 $build->config_data( run_stem_path => $run_stem_path ) ;
216 my $bin_path = $build->install_destination('bin') ;
217 $build->config_data( bin_path => $bin_path ) ;
219 $build->config_data( perl_path => $build->config( 'perlpath' ) ) ;
221 # Several different prefixes... which one to use??
222 #$build->config_data( prefix => $build->prefix() ) ;
223 $build->config_data( prefix => $build->config( 'install_base' ) ) ;
226 $build->config_data( config_done => 1 ) ;
229 #print Dumper \%{ $build->config_data() };
232 $build->create_build_script() ;