File: win_install_mine.pl

package info (click to toggle)
papaya 0.97.20031122-5.5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,536 kB
  • ctags: 4,163
  • sloc: cpp: 23,715; sh: 11,142; ansic: 6,359; python: 1,667; makefile: 608; yacc: 318; perl: 168; sed: 109; csh: 10
file content (119 lines) | stat: -rw-r--r-- 3,493 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/perl

# Create an associative array of source and destination for the files
# that need to be installed, including whole directories

# $SRC_PREFIX is prepended to all source files.
# $DST_PREFIX is prepended to all destination files.

$SRC_PREFIX = '/home/allenc/papaya';
$DST_PREFIX = '/home/allenc/papaya-mine';

%base_files = ( 
	       'po/es.UTF-8.gmo' , 'locale/es/LC_MESSAGES/papaya.mo',
	       'share/papaya-logo-newbie-mine.xpm' , 'papaya-logo-newbie.xpm',
	       'share/splash-mine.xpm' , 'splash.xpm',
	       'share/mcw.dat-mine' , 'mcw.dat',
	       'share/gtkrc' , 'gtkrc',
	       'share/papayarc-mine' , 'papayarc',
	       'share/papayarc-mine-2', 'prefs/mine',
	       'share/plugins.conf', 'plugins.conf'
	      );

%binary_files = (
		 'win32/Release/papaya.exe' , 'papaya.exe',
		 'win32/BSX/Release/BSX.dll' , 'plugins/',
		 'win32/Clock/Release/Clock.dll' , 'plugins/',
		 'win32/ConnectionTimer/Release/ConnectionTimer.dll' , 'plugins/',
		 'win32/Fraction/Release/Fraction.dll' , 'plugins/',
		 'win32/Friends/Release/Friends.dll' , 'plugins/',
		 'win32/GrepFilter/Release/GrepFilter.dll' , 'plugins/',
		 'win32/LagIndicator/Release/LagIndicator.dll' , 'plugins/',
		 'win32/MudLog/Release/MudLog.dll' , 'plugins/',
		 'win32/Multi/Release/Multi.dll' , 'plugins/',
		 'win32/PromptPlugin/Release/PromptPlugin.dll' , 'plugins/',
		 'win32/Python/Release/Python.dll' , 'plugins/',
		 'win32/Speedwalk/Release/Speedwalk.dll' , 'plugins/',
		 'win32/SpellStacker/Release/SpellStacker.dll' , 'plugins/',
		 'win32/Spells/Release/Spells.dll' , 'plugins/',
		 'win32/TurfProtocol/Release/TurfProtocol.dll' , 'plugins/',
		 'win32/required_files/*' , ''
		);

%doc_files = (
	      'doc/manual/manual.pdf' , 'doc/manual.pdf'
	     );

%extra_files = (
		'share/mudlist.txt' , 'mudlist.txt'
	       );

@doc_make = ( "cd $SRC_PREFIX/doc/manual && pdflatex manual.tex" );
@po_make = ( "cd $SRC_PREFIX/po && make" );

foreach $doc (@doc_make) {
#  system("$doc");
}

foreach $po (@po_make) {
#  system("$po");
}

system("rm -rf $DST_PREFIX");
mkdir($DST_PREFIX);

foreach $key (keys %base_files) {
  $src = "$SRC_PREFIX/$key";
  $dst = "$DST_PREFIX/$base_files{$key}";

  # If $dst has a / in it, attempt to make the directory up to the last /
  $index = rindex($dst, '/');
  if ($index != -1) {
    $directory = substr($dst, 0, $index);
    system ("mkdir -p $directory");
  }
  
  system("cp -a $src $dst");
}

foreach $key (keys %binary_files) {
  $src = "$SRC_PREFIX/$key";
  $dst = "$DST_PREFIX/$binary_files{$key}";

  # If $dst has a / in it, attempt to make the directory up to the last /
  $index = rindex($dst, '/');
  if ($index != -1) {
    $directory = substr($dst, 0, $index);
    system ("mkdir -p $directory");
  }
  
  system("cp -a $src $dst");
}

foreach $key (keys %doc_files) {
  $src = "$SRC_PREFIX/$key";
  $dst = "$DST_PREFIX/$doc_files{$key}";

  # If $dst has a / in it, attempt to make the directory up to the last /
  $index = rindex($dst, '/');
  if ($index != -1) {
    $directory = substr($dst, 0, $index);
    system ("mkdir -p $directory");
  }
  
  system("cp -a $src $dst");
}

foreach $key (keys %extra_files) {
  $src = "$SRC_PREFIX/$key";
  $dst = "$DST_PREFIX/$extra_files{$key}";

  # If $dst has a / in it, attempt to make the directory up to the last /
  $index = rindex($dst, '/');
  if ($index != -1) {
    $directory = substr($dst, 0, $index);
    system ("mkdir -p $directory");
  }
  
  system("cp -a $src $dst");
}