Debian Codegraph @

attic/Makefile.PL

raw
1 ## -*- cperl -*-
2
3 BEGIN {
4 print "\n === The Ifeffit wrapper, Athena, Artemis, and Hephaestus ===\n\n";
5 ## make sure the pgplot environment is sane... these defaults
6 ## assume that pgplot was installed by Matt's PGPLOT_install
7 $ENV{PGPLOT_DIR} ||= '/usr/local/share/pgplot';
8 $ENV{PGPLOT_DEV} ||= '/XSERVE';
9 }
10
11
12 ## load some necessary modules ...
13 use ExtUtils::MakeMaker;
14 use Config;
15 use File::Copy;
16 use File::Spec;
17 use Getopt::Long;
18
19 ## process the command line switches ....
20 my ($nocpan, $debian, $platform) = (0, 0, q{});
21 ## is this windows? is this Mac?
22
23 my $prefix = q{};
24 &GetOptions('nocpan' => \$nocpan, # flag for building CPAN modules in the bundle
25 'platform=s' => \$platform, # flag for specifying platform
26 'prefix=s' => \$prefix, # specify an installation prefix
27 'help' => \&help,
28 'h' => \&help,
29 'debian' => \$debian, # save Carlo some grief
30 );
31 $platform = lc($platform);
32 ($platform = 'debian') if $debian;
33 if (not $platform) {
34 SWITCH: {
35 ($platform = 'windows'), last SWITCH if (($^O eq 'MSWin32') or ($^O eq 'cygwin'));
36 ($platform = 'darwin'), last SWITCH if (lc($^O) eq 'darwin');
37 $platform = 'unix';
38 };
39 };
40
41
42 ## Set some environment variables to influence how makefiles further
43 ## down in the hierarchy will behave
44 $ENV{INSTALLING_WITH} = 'horae';
45 $ENV{SKIP_ALL_CPAN_MODULES} = $nocpan;
46 print "You are suppressing the installation of the CPAN bundle.\n" if $ENV{SKIP_ALL_CPAN_MODULES};
47 ## this is a leftover from the days when this package was part of the
48 ## ifeffit distro
49 $blib = "blib";
50
51
52 ## refuse to run if the --prefix flag is set AND this is Windows or OSX
53 if ($prefix and ($platform =~ /(?:darwin|windows)/)) {
54 print <<"EOH"
55
56 Yikes!
57
58 Use of the --prefix flag is only allowed on unix machines. If you
59 wish to install this software to a non-standard location on Windows
60 or Mac OSX, you are on your own. You will need to understand how
61 modules are used by perl *and* you will need to modify the Makefile.PL
62 file.
63
64 EOH
65 ;
66 exit;
67 };
68
69
70
71
72 ###====================================================
73 ###
74 ### step 0
75 ###
76 ## clean up any stray pm_to_blib files so that everything gets
77 ## properly rebuilt
78 #my @pm_to_blib = `find ./ -name pm_to_blib`;
79 foreach my $subdir (qw(atp Xtal scripts Chemistry language Absorption)) {
80 my $pm_to_blib = File::Spec->catfile($subdir, "pm_to_blib");
81 unlink($pm_to_blib) if (-e $pm_to_blib);
82 };
83
84
85 ## need to inport ExtUtils::F77 stuff except on a Windows box which
86 ## lacks compilers (such as my own)
87 #unless ($^O eq 'MSWin32') { eval "require ExtUtils::F77; ExtUtils::F77->import" };
88
89 ## ready to start the build process ....
90 ##############################################################################
91
92
93 ###====================================================
94 ###
95 ### step 1
96 ###
97 ## write a comment to the screen to assure the user that this script
98 ## understands what kind of computer it is running on
99 if ($platform eq 'windows') {
100 print "This is Windows.\n";
101 } elsif ($platform eq 'darwin') {
102 print "This is Mac OSX.\n";
103 } else {
104 print "This is $^O.\n";
105 };
106
107
108 ###====================================================
109 ###
110 ### step 2
111 ###
112 ## check that some minimum standards are met: (1) at least perl 5.004,
113 ## (2) Tk is installed and is at least 800.022
114 print "Checking dependencies ...\n";
115 my $stop = 0;
116 if ($] < 5) {
117 warn " Your version of perl ($]) is way too ancient! Athena and Artemis\n".
118 " require Perl5. You can get perl from http://www.perl.com\n";
119 ++$stop;
120 } elsif ($] < 5.005) {
121 warn " Perl version $] is quite old. You may consider updating.\n".
122 " The latest version of Perl can be found at http://www.perl.com\n";
123 };
124 $there = eval 'require Tk;';
125 if (not $there) {
126 warn " Tk is not installed. Download the latest from\n".
127 " http://search.cpan.org/search?module=Tk\n";
128 ++$stop;
129 } elsif ($Tk::VERSION < 800.022) {
130 warn " Athena and Artemis require Tk version 800.022 or later. Download\n".
131 " the latest from http://search.cpan.org/search?module=Tk\n";
132 ++$stop;
133 };
134
135 die "Failed dependencies. Not installing athena and artemis.\n" if $stop;
136 print "Dependencies ok. Cool!\n";
137
138 $|=1;
139
140
141 ###====================================================
142 ###
143 ### step 3
144 ###
145 ## run two small perl scripts that build configuration files in
146 ## various formats from the master config files. these config files
147 ## govern the behavior of the preferences in Athena and Artemis
148 do 'mkathenarc';
149 do 'mkartemisrc';
150
151
152
153 ###====================================================
154 ###
155 ### step 4
156 ###
157 ## assemble programs from their parts. these are simple concatinations
158
159 my $mode = 0755;
160
161 ## ----- build ATHENA
162 (-e "athena") and unlink "athena";
163 open TO, ">athena" or die 'could not open athena for writing\n';
164 foreach my $p (qw(top head main_window draw_properties set_properties file
165 group_ops align pixel calibrate deglitch truncate sa_fluo
166 mee diff lograt peakfit lcf rebin smooth convolve demo
167 macro palettes plot plotstyles project report rc
168 setup mru prefs registry keys teach_ft misc)) {
169 open FROM, "athena_parts/$p.pl" or die "could not open athena_parts/$p.pl for reading\n";
170 foreach my $l (<FROM>) { print TO $l };
171 close FROM
172 };
173 close TO;
174 print "Assembled athena from its parts (athena_parts/).\n";
175 chmod $mode, 'athena';
176
177 ## ----- build ARTEMIS
178 (-e "artemis") and unlink "artemis";
179 open TO, ">artemis" or die 'could not open artemis for writing\n';
180 foreach my $p (qw(top head main_window gds2 feff atoms2 path file athena firstshell
181 data palettes fit plot zip project record macro mru
182 prefs log logview feffit rc misc)) {
183 open FROM, "artemis_parts/$p.pl" or die "could not open artemis_parts/$p.pl for reading\n";
184 foreach my $line (<FROM>) { print TO $line };
185 close FROM
186 };
187 close TO;
188 print "Assembled artemis from its parts (artemis_parts/).\n";
189 chmod $mode, 'artemis';
190
191 ## ----- build HEPHAESTUS
192 (-e "hephaestus") and unlink "hephaestus";
193 open TO, ">hephaestus" or die 'could not open hephaestus.pl for writing\n';
194 foreach my $p (qw(head absorption formula data f1f2 ion transition find line misc)) {
195 open FROM, "hephaestus_parts/$p.pl" or die "could not open parts/$p.pl for reading\n";
196 foreach my $line (<FROM>) { print TO $line };
197 close FROM
198 };
199 close TO;
200 print "Assembled hephaestus from its parts (hephaestus_parts/).\n";
201 chmod $mode, 'hephaestus';
202
203
204
205 ###====================================================
206 ###
207 ### step 5
208 ###
209 ### use the fixin script to fix the #! lines in each of the programs
210 if ($platform ne 'windows') {
211 print "Fixing execution path in the Athena, Artemis, and Hephaestus executables...\n";
212 @ARGV = qw(athena artemis hephaestus ifeffit_shell.pl rdaj lsprj atoms);
213 do 'fixin';
214 };
215
216
217
218 ###====================================================
219 ###
220 ### step 6
221 ###
222 ### a few more small chores
223
224 ## certain situations require information about compilation and
225 ## installation to be fed to WriteMakefile. that info will be put
226 ## into this array, but this array needs to be scoped outside of the
227 ## block beginning "unless ($platform eq 'debian') ... "
228 my @compile = ();
229
230 ## For Debian, the ifeffit wrapper is a separate package and is a
231 ## dependency so we need not do any of the compilation here.
232 if (($platform eq 'debian') and (-e "ifeffit_wrap.c")) {
233 unlink "ifeffit_wrap.c";
234 };
235
236 if (($Tk::VERSION < 804) and ($platform ne 'debian')) {
237 copy "Tk/FBox.pm.save", "Tk/FBox.pm";
238 };
239
240 ## For OSX we want to rely upon the installer package to provide a compiled
241 ## ifeffit_wrap, thus we skip the compilation by unlinking the source
242 if (($platform eq 'darwin') and (-e "ifeffit_wrap.c")) {
243 unlink "ifeffit_wrap.c";
244 };
245
246
247
248 ###====================================================
249 ###
250 ### step 7
251 ###
252 ### figure out how to compile the ifeffit wrapper and set various
253 ### variables that influence the building of the makefiles
254 unless ($platform =~ /(?:debian)/) {
255
256 ## this is done so that MakeMaker does not try to generate Makefile
257 ## lines to compile the wrapper on a Windows box which lacks compilers
258 ## (such as my own).
259 if ($platform eq 'windows') {
260
261 copy "MANIFEST", "MANIFEST.unix";
262 copy "MANIFEST.windows", "MANIFEST";
263 copy "Ifeffit.pm", "Ifeffit.pm.4unix";
264 copy "Ifeffit.pm.4windows", "Ifeffit.pm";
265 } elsif ($platform ne 'darwin') {
266 copy "ifeffit_wrap.c.source", "ifeffit_wrap.c";
267 };
268
269
270 ## figure out where ifeffit thinks pgplot is installed
271
272 my ($compile_flags, $pgplot_location, $iffdir);
273 unless ($platform eq 'windows') {
274 if ($platform eq 'darwin') {
275 $pgplot_location = q{};
276 } else {
277 ($compile_flags, $pgplot_location, $iffdir) = ("", "", `ifeffit -i`);
278 $iffdir =~ s/\s*$//;
279 print STDOUT
280 "Ifeffit's installations directory is $iffdir\n\t(found by capturing \`ifeffit -i\`)\n";
281 open C, "$iffdir/config/Config.mak" or
282 die "Could not open $iffdir/config/Config.mak file for reading\n";
283 while (<C>) {
284 next if (/^\s*\#/);
285 chomp;
286 ($compile_flags .= (split(/=/, $_))[1]) if (/^LIB/);
287 $compile_flags .= " ";
288 ($pgplot_location .= (split(" ", $_))[2]) if (/^LIB_PLT/);
289 };
290 print STDOUT "Compilation flags (from $iffdir/config/Config.mak):\n\t$compile_flags\n";
291 };
292 $pgplot_location =~ s/-L//;
293 if ($pgplot_location) {
294 print STDOUT "PGPLOT directory: $pgplot_location\n";
295 print STDOUT "Fixing fallback for environment variable PGPLOT_DIR in the programs\n";
296 foreach my $name (qw(athena artemis hephaestus)) {
297 open OLD, "< $name.pl";
298 open NEW, "> $name.fixed";
299 while (<OLD>) {
300 s!/usr/local/share/pgplot!$pgplot_location!;
301 print NEW $_;
302 };
303 close OLD; close NEW;
304 rename "$name.fixed", "$name.pl";
305 chmod 0755, "$name.pl";
306 };
307 };
308 };
309
310
311 ## Unix, Windows and OSX+fink have different compilation needs. this
312 ## array attempts to handle them all
313 if ($platform eq 'windows') { # Matt will compile the wrapper for windows
314 @compile = ();
315 } elsif ($platform eq 'darwin') {
316 ## 30-Apr-04 Matt changed to use /Applications/Ifeffit and PGPLOT with
317 ## X11,Aquaterm,and Png devices.
318 ## Using this requires Fink's g77 / libg2c.
319 @compile = ('NAME' => 'Ifeffit',
320 'SKIP' => ['test_dynamic'],
321 'OBJECT' => 'ifeffit_wrap.o',
322 'INSTALLBIN' => '/Applications/Ifeffit/bin',
323 'INSTALLSITEBIN' => '/Applications/Ifeffit/bin',
324 'INSTALLSCRIPT' => '/Applications/Ifeffit/bin',
325 'INC' => '-I/Applications/Ifeffit/share/ifeffit/config',
326 'LDDLFLAGS' => join(" ", $Config{lddlflags},
327 '-framework Foundation',
328 '-framework AppKit'),
329 'LIBS' => join(" ", $Config{ldflags},
330 qw(-L/Applications/Ifeffit/lib
331 -lifeffit
332 -lpgplot_iff
333 -lpng_iff
334 -lz_iff
335 -laquaterm
336 -L/sw/lib
337 -lg2c
338 -L/usr/lib
339 -lgcc
340 -L/usr/X11R6/lib
341 -lX11
342 -lSystem)),
343 );
344 } else { # this should work for all Unixes (other than darwin)
345 if ($prefix) {
346 print STDOUT "Installing to prefix=$prefix\n";
347 @compile = ('OBJECT' => 'ifeffit_wrap.o',
348 'LIBS' => [$compile_flags],
349 'PREFIX' => $prefix,
350 #'INSTALLPRIVLIB' => File::Spec->catfile($prefix, "lib"),
351 #'INSTALLSCRIPT' => File::Spec->catfile($prefix, "bin"),
352 #'INSTALLBIN' => File::Spec->catfile($prefix, "bin"),
353 #'INSTALLMAN1DIR' => File::Spec->catfile($prefix, "man", "man1"),
354 #'INSTALLMAN3DIR' => File::Spec->catfile($prefix, "man", "man3"),
355 #'INSTALLARCHLIB' => File::Spec->catfile($prefix, "lib"),
356 );
357 } else {
358 @compile = ('OBJECT' => 'ifeffit_wrap.o',
359 'LIBS' => [$compile_flags],
360 'INSTALLBIN' => '/usr/local/bin',
361 'INSTALLSCRIPT' => '/usr/local/bin',
362 );
363 };
364 };
365 }; ## end of "unless ($platform =~ /(?:darwin|debian)/)"
366
367
368
369 ###====================================================
370 ###
371 ### step 8
372 ###
373 ### set up the screen message presented after the "make install" stage
374 sub MY::postamble {
375 return "" if ($platform eq 'windows');
376 q(
377 install ::
378 @echo ' '
379 @echo '*****************************************************************************'
380 @echo 'Installation is finished.'
381 @echo 'The following programs have been installed:'
382 @echo ' athena: XAS data processing and manipulation'
383 @echo ' artemis: EXAFS data analysis and error analysis'
384 @echo ' hephaestus: Souped-up periodic table for absorption spectroscopists'
385 @echo ' atoms: CLI tool for making feff.inp files'
386 @echo ' '
387 @echo ' -- This software is copyright (c) 2001-2006, Bruce Ravel --'
388 @echo ' -- Ifeffit is copyright (c) 1992-2006, Matthew Newville --'
389 @echo 'Ifeffit, Athena, and Artemis may be freely redistributed according to'
390 @echo 'the terms of their licenses.'
391 @echo ' '
392 @echo 'Join the Ifeffit Mailing List at'
393 @echo ' http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit/'
394 @echo ' '
395 @echo 'Send bug reports and suggestions to [email protected]. See '
396 @echo ' http://cars9.uchicago.edu/~ravel/software/bugs.html'
397 @echo '*****************************************************************************'
398 )
399 };
400
401
402
403 ###====================================================
404 ###
405 ### step 9
406 ###
407 ### WriteMakefile actually generates the main makefiles
408 if ($^O eq 'linux') {
409 print STDOUT " * Linux users may see one warning about \"No library found for -lg2c\".\n" .
410 " * This can be safely ignored if it only appears once.\n";
411 };
412 WriteMakefile(
413 'DISTNAME' => 'horae',
414 'NAME' => 'Ifeffit',
415 'VERSION_FROM' => 'Ifeffit/Tools.pm', # finds $VERSION
416 @compile,
417 'dist' => { COMPRESS => 'gzip -fv', SUFFIX => 'gz' },
418 EXE_FILES => [qw(athena artemis hephaestus atoms rdaj lsprj)],
419
420 PREREQ_PM => {Tk => 804.027,
421 Archive::Zip => 0,
422 Chemistry::Elements => 0,
423 Compress::Zlib => 0,
424 Config::IniFiles => 0,
425 Math::Combinatorics => 0,
426 Math::Derivative => 0,
427 Math::Round => 0,
428 Math::Spline => 0,
429 Parse::RecDescent => 0,
430 Pod::Escapes => 0,
431 Pod::Simple => 0,
432 STAR::Parser => 0, # am I CPANable?
433 Spreadsheet::WriteExcel => 0,
434 Statistics::Descriptive => 0,
435 Text::Glob => 0,
436 Tie::IxHash => 0,
437 Tie::Watch => 0,
438 Time::Stopwatch => 0,
439 Tk::FileDialog => 0,
440 Tk::GBARR => 0,
441 Tk::HistEntry => 0,
442 Tk::Pod => 0,
443 Tk::Splashscreen => 0,
444 WWWBrowser => 0,
445 ##XML::Simple => 0, # horae_update
446 perlindex => 0,
447
448 Chemistry::Formula => 0,
449 Xray::Absorption => 0,
450 },
451
452 'PM' =>
453 {
454 ## programs, modules, init files, and data
455 # 'athena.pl' => "$blib/bin/athena",
456 # 'artemis.pl' => "$blib/bin/artemis",
457 # 'hephaestus.pl' => "$blib/bin/hephaestus",
458 # 'atoms.pl' => "$blib/bin/atoms",
459 # 'rdaj.pl' => "$blib/bin/rdaj",
460
461 (($platform eq 'debian') ? () :
462 ('ifeffit_shell.pl' => "$blib/bin/ifeffit_shell.pl",
463 'Ifeffit.pm' => "$blib/lib/Ifeffit.pm",)),
464 'Ifeffit/Tools.pm' => "$blib/lib/Ifeffit/Tools.pm",
465 'Ifeffit/FindFile.pm' => "$blib/lib/Ifeffit/FindFile.pm",
466 'Ifeffit/Files.pm' => "$blib/lib/Ifeffit/Files.pm",
467 'Ifeffit/Group.pm' => "$blib/lib/Ifeffit/Group.pm",
468 'Ifeffit/Path.pm' => "$blib/lib/Ifeffit/Path.pm",
469 'Ifeffit/ParseFeff.pm' => "$blib/lib/Ifeffit/ParseFeff.pm",
470 'Ifeffit/Parameter.pm' => "$blib/lib/Ifeffit/Parameter.pm",
471 'Ifeffit/Elements.pm' => "$blib/lib/Ifeffit/Elements.pm",
472 'Ifeffit/ArtemisLog.pm' => "$blib/lib/Ifeffit/ArtemisLog.pm",
473
474 'Ifeffit/Plugins/Filetype/Athena/BESSRC.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/BESSRC.pm",
475 'Ifeffit/Plugins/Filetype/Athena/CMC.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/CMC.pm",
476 'Ifeffit/Plugins/Filetype/Athena/Encoder.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/Encoder.pm",
477 'Ifeffit/Plugins/Filetype/Athena/Lambda.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/Lambda.pm",
478 'Ifeffit/Plugins/Filetype/Athena/SSRL.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/SSRL.pm",
479 'Ifeffit/Plugins/Filetype/Athena/X10C.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/X10C.pm",
480 'Ifeffit/Plugins/Filetype/Athena/X15B.pm' => "$blib/lib/Ifeffit/Plugins/Filetype/Athena/X15B.pm",
481
482 'Ifeffit/lib/athena/athena.config' => "$blib/lib/Ifeffit/lib/athena/athena.config",
483 'Ifeffit/lib/athena/athenarc' => "$blib/lib/Ifeffit/lib/athena/athenarc",
484 'Ifeffit/lib/athena/athena.hints' => "$blib/lib/Ifeffit/lib/athena/athena.hints",
485 'Ifeffit/lib/athena/athena.mee' => "$blib/lib/Ifeffit/lib/athena/athena.mee",
486 'Ifeffit/lib/athena/athena-logo.gif' => "$blib/lib/Ifeffit/lib/athena/athena-logo.gif",
487 'Ifeffit/lib/athena/athena_icon.xbm' => "$blib/lib/Ifeffit/lib/athena/athena_icon.xbm",
488 'Ifeffit/lib/athena/athena_icon.gif' => "$blib/lib/Ifeffit/lib/athena/athena_icon.gif",
489 'Ifeffit/lib/athena/athena_icon.png' => "$blib/lib/Ifeffit/lib/athena/athena_icon.png",
490 'Ifeffit/lib/athena/athena_icon.xpm' => "$blib/lib/Ifeffit/lib/athena/athena_icon.xpm",
491 'Ifeffit/lib/athena/athena_icon.ico' => "$blib/lib/Ifeffit/lib/athena/athena_icon.ico",
492
493 'Ifeffit/lib/artemis/artemis.config' => "$blib/lib/Ifeffit/lib/artemis/artemis.config",
494 'Ifeffit/lib/artemis/artemisrc' => "$blib/lib/Ifeffit/lib/artemis/artemisrc",
495 'Ifeffit/lib/artemis/artemis.hints' => "$blib/lib/Ifeffit/lib/artemis/artemis.hints",
496 'Ifeffit/lib/artemis/artemis-logo.gif' => "$blib/lib/Ifeffit/lib/artemis/artemis-logo.gif",
497 'Ifeffit/lib/artemis/artemis_icon.xbm' => "$blib/lib/Ifeffit/lib/artemis/artemis_icon.xbm",
498 'Ifeffit/lib/artemis/artemis_icon.gif' => "$blib/lib/Ifeffit/lib/artemis/artemis_icon.gif",
499 'Ifeffit/lib/artemis/Artemis.png' => "$blib/lib/Ifeffit/lib/artemis/artemis_icon.png",
500 'Ifeffit/lib/artemis/artemis_icon.xpm' => "$blib/lib/Ifeffit/lib/artemis/artemis_icon.xpm",
501 'Ifeffit/lib/artemis/artemis_icon.ico' => "$blib/lib/Ifeffit/lib/artemis/artemis_icon.ico",
502 'Ifeffit/lib/artemis/artemis_project.readme' => "$blib/lib/Ifeffit/lib/artemis/artemis_project.readme",
503
504 'Ifeffit/lib/hephaestus/absorption.gif' => "$blib/lib/Ifeffit/lib/hephaestus/absorption.gif",
505 'Ifeffit/lib/hephaestus/data.gif' => "$blib/lib/Ifeffit/lib/hephaestus/data.gif",
506 'Ifeffit/lib/hephaestus/f1f2.gif' => "$blib/lib/Ifeffit/lib/hephaestus/f1f2.gif",
507 'Ifeffit/lib/hephaestus/find.gif' => "$blib/lib/Ifeffit/lib/hephaestus/find.gif",
508 'Ifeffit/lib/hephaestus/line.gif' => "$blib/lib/Ifeffit/lib/hephaestus/line.gif",
509 'Ifeffit/lib/hephaestus/formulas.gif' => "$blib/lib/Ifeffit/lib/hephaestus/formulas.gif",
510 'Ifeffit/lib/hephaestus/ion.gif' => "$blib/lib/Ifeffit/lib/hephaestus/ion.gif",
511 'Ifeffit/lib/hephaestus/trans.gif' => "$blib/lib/Ifeffit/lib/hephaestus/trans.gif",
512 'Ifeffit/lib/hephaestus/help.gif' => "$blib/lib/Ifeffit/lib/hephaestus/help.gif",
513 'Ifeffit/lib/hephaestus/transition.gif' => "$blib/lib/Ifeffit/lib/hephaestus/transition.gif",
514 'Ifeffit/lib/hephaestus/vulcan.gif' => "$blib/lib/Ifeffit/lib/hephaestus/vulcan.gif",
515 'Ifeffit/lib/hephaestus/vulcan.ico' => "$blib/lib/Ifeffit/lib/hephaestus/vulcan.ico",
516 'Ifeffit/lib/hephaestus/vulcan.png' => "$blib/lib/Ifeffit/lib/hephaestus/vulcan.png",
517 'Ifeffit/lib/hephaestus/vulcan.xpm' => "$blib/lib/Ifeffit/lib/hephaestus/vulcan.xpm",
518 'Ifeffit/lib/hephaestus/kalziumrc' => "$blib/lib/Ifeffit/lib/hephaestus/kalziumrc",
519 'Ifeffit/lib/hephaestus/hephaestus_icon.xbm' => "$blib/lib/Ifeffit/lib/hephaestus/hephaestus_icon.xbm",
520 'Ifeffit/lib/hephaestus/hephaestus.ini' => "$blib/lib/Ifeffit/lib/hephaestus/hephaestus.ini",
521
522 'Xray/Atoms.pm' => "$blib/lib/Xray/Atoms.pm",
523 'Xray/ATP.pm' => "$blib/lib/Xray/ATP.pm",
524 'Xray/Fluo.pm' => "$blib/lib/Xray/Fluo.pm",
525
526
527 'Ifeffit/lib/artemis.doc/artemis.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis.pod",
528 'Ifeffit/lib/artemis.doc/artemis_afs.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_afs.pod",
529 'Ifeffit/lib/artemis.doc/artemis_athena.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_athena.pod",
530 'Ifeffit/lib/artemis.doc/artemis_atoms.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_atoms.pod",
531 'Ifeffit/lib/artemis.doc/artemis_editme.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_editme.pod",
532 'Ifeffit/lib/artemis.doc/artemis_feffinp.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_feffinp.pod",
533 'Ifeffit/lib/artemis.doc/artemis_fitinfo.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_fitinfo.pod",
534 'Ifeffit/lib/artemis.doc/artemis_gds.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_gds.pod",
535 'Ifeffit/lib/artemis.doc/artemis_intrp.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_intrp.pod",
536 'Ifeffit/lib/artemis.doc/artemis_logview.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_logview.pod",
537 'Ifeffit/lib/artemis.doc/artemis_opparams.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_opparams.pod",
538 'Ifeffit/lib/artemis.doc/artemis_path.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_path.pod",
539 'Ifeffit/lib/artemis.doc/artemis_plot.pod' =>"$blib/lib/Ifeffit/lib/artemis.doc/artemis_plot.pod",
540
541 ## demo projects
542 'examples/athena/demos/align_merge.prj' => "$blib/lib/Ifeffit/lib/demos/align_merge.prj",
543 'examples/athena/demos/calibrate.prj' => "$blib/lib/Ifeffit/lib/demos/calibrate.prj",
544 'examples/athena/demos/clamp.prj' => "$blib/lib/Ifeffit/lib/demos/clamp.prj",
545 'examples/athena/demos/clnorm.prj' => "$blib/lib/Ifeffit/lib/demos/clnorm.prj",
546 'examples/athena/demos/diff.prj' => "$blib/lib/Ifeffit/lib/demos/diff.prj",
547 'examples/athena/demos/dispersive.prj' => "$blib/lib/Ifeffit/lib/demos/dispersive.prj",
548 'examples/athena/demos/deglitch.prj' => "$blib/lib/Ifeffit/lib/demos/deglitch.prj",
549 'examples/athena/demos/linearcombo.prj' => "$blib/lib/Ifeffit/lib/demos/linearcombo.prj",
550 'examples/athena/demos/peakfit.prj' => "$blib/lib/Ifeffit/lib/demos/peakfit.prj",
551 'examples/athena/demos/rbkg.prj' => "$blib/lib/Ifeffit/lib/demos/rbkg.prj",
552 'examples/athena/demos/selfabs.prj' => "$blib/lib/Ifeffit/lib/demos/selfabs.prj",
553 'examples/athena/demos/reports.prj' => "$blib/lib/Ifeffit/lib/demos/reports.prj",
554 'examples/athena/demos/smoothing.prj' => "$blib/lib/Ifeffit/lib/demos/smoothing.prj",
555 'examples/athena/demos/stacked_plot.prj' => "$blib/lib/Ifeffit/lib/demos/stacked_plot.prj",
556 'examples/athena/demos/truncate.prj' => "$blib/lib/Ifeffit/lib/demos/truncate.prj",
557
558 ## non-standard Tk goodies
559 'Tk/PathparamEntry.pm' => "$blib/lib/Tk/PathparamEntry.pm",
560 'Tk/KeyEntry.pm' => "$blib/lib/Tk/KeyEntry.pm",
561 'Tk/RetEntry.pm' => "$blib/lib/Tk/RetEntry.pm",
562 'Tk/SGB.pm' => "$blib/lib/Xray/Tk/SGB.pm",
563 'Tk/TextUndoQuiet.pm' => "$blib/lib/Tk/TextUndoQuiet.pm",
564
565 ## deal with different versions of perl/Tk
566 #((($Tk::VERSION > 804) or ($platform eq 'debian')) ?
567 # () : ('Tk/FBox.pm' => "$blib/lib/Tk/FBox.pm",)),
568
569 },
570 );
571
572
573 ###====================================================
574 ###
575 ### step 10
576 ###
577 ### if an installation prefix was specified at the command line, write
578 ### out files for use in bash and tcsh login scripts directing those
579 ### shells where to find all this stuff
580 if ($prefix) {
581 ## munge the names of the libsdirs to reflect the new prefix
582 (my $sitearch = $Config{installsitearch}) =~ s(^$Config{prefix})($prefix);
583 (my $archlib = $Config{installarchlib}) =~ s(^$Config{prefix})($prefix);
584 prefix_touch_bash($sitearch, $archlib);
585 prefix_touch_tcsh($sitearch, $archlib);
586 print STDOUT "Wrote files horae.bash and horae.tcsh\n";
587 };
588
589
590
591 ###====================================================
592 ###
593 ### step 11
594 ###
595 ### closing message written to the screen
596 my $make = ($^O eq 'MSWin32') ? 'nmake' :'make';
597 print STDOUT $/, "+", "--*--" x 14, "+";
598 print STDOUT "\n| Yay! Now type \"$make\" then \"$make install\" to finish the installation |\n".
599 "| of the Ifeffit wrapper, Athena, Artemis, and Hephaestus. |\n";
600 print STDOUT "+", "--*--" x 14, "+", $/, $/;
601
602
603
604
605
606 ###====================================================
607 ###
608 ### extra stuff
609 ###
610 ### two subroutines used in step 10
611
612 sub prefix_touch_bash {
613 my ($sitearch, $archlib) = @_;
614 open B, ">horae.bash" or die "could not touch horae.bash file\n";
615 print B "#!/bin/sh
616
617 #### Add the contents of this file to the users \$HOME/.profile or to
618 #### the system level profile (/etc/profile, /etc/bashrc, or perhaps
619 #### /etc/profile.local)
620
621 #### one good way of doing this is to put the following line in the
622 #### profile. using a line like this makes it easier to maintain your
623 #### login scripts should the contents of this file change in a
624 #### future horae release:
625 #### test -s /opt/horae/etc/horae.bash \&\& . /opt/horae/etc/horae.bash
626
627 # set the path to include the location of the horae binaries
628 export PATH=\$PATH:\"$prefix/bin/\"
629 # you might also need to put the location of the ifeffit binary in the PATH
630
631 # set manual path and the perl library path
632 export MANPATH=\$MANPATH:\"$prefix/man/\"
633 export PERL5LIB=\$PERL5LIB:\"$sitearch\"
634 export PERL5LIB=\$PERL5LIB:\"$archlib\"
635
636 # uncomment the next two lines and modify them to point to the
637 # location of pgplot on your system
638 #export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\"/usr/local/pgplot/\"
639 #export PGPLOT_DIR=\"/usr/local/pgplot\"
640 export PGPLOT_DEV=\"/xwin\"
641
642 ";
643 close B;
644 };
645
646 sub prefix_touch_tcsh {
647 my ($sitearch, $archlib) = @_;
648 open B, ">horae.tcsh" or die "could not touch horae.tcsh file\n";
649 print B "#!/bin/tcsh
650
651 #### Add the contents of this file to the users \$HOME/.cshrc or to
652 #### the system level profile (/etc/csh.cshrc, /etc/csh.login, or
653 #### perhaps /etc/csh.login.local)
654
655 #### one good way of doing this is to put the following 3 lines in the
656 #### login script. using lines like this makes it easier to maintain
657 #### your login scripts should the contents of this file change in a
658 #### future horae release:
659 #### if ( -r /opt/horae/etc/horae.tcsh ) then
660 #### source /opt/horae/etc/horae.tcsh
661 #### endif
662
663
664 # set the path to include the location of the horae binaries
665 setenv PATH \$PATH\":\"$prefix/bin/
666 # you might also need to put the location of the ifeffit binary in the PATH
667
668 # set manual path and the perl library path
669 setenv MANPATH \$MANPATH\":\"$prefix/man/
670 setenv PERL5LIB \$PERL5LIB\":\"$sitearch
671 setenv PERL5LIB \$PERL5LIB\":\"$archlib
672
673 # uncomment the next two lines and modify them to point to the
674 # location of pgplot on your system
675 #setenv LD_LIBRARY_PATH \$LD_LIBRARY_PATH\":\"/usr/local/pgplot/
676 #setenv PGPLOT_DIR /usr/local/pgplot
677 setenv PGPLOT_DEV /xwin
678
679 ";
680 close B;
681 };
682
683
684 ### help message for --help command line argument
685 sub help {
686 print << 'EOH'
687 This is the build script for the Horae package, which consists of
688 Athena, Artemis, Hephaestus, and the command line version of Atoms.
689 Typically, you can run this script without arguments, however in
690 some situations arguments can be useful.
691
692 flag type purpose
693 -----------------------------------------------------------
694 nocpan boolean do not build CPAN bundle
695 platform string specify the target platform
696 prefix string specify the installation prefix
697 help, h boolean write this message and exit
698
699 The prefix is usually figured out automatically. --prefix=debian is
700 useful for specifying that the build is happening on a debian system or
701 in the context of building a debian package. --prefix=windows or
702 --prefix=darwin may be necessary if the script does not recognize that
703 you are on one of those platforms for some reason.
704
705 EOH
706 ;
707 exit;
708 };