Changeset 6072
- Timestamp:
- 2003-12-02T11:45:49+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/create_distributions.pl
r3825 r6072 60 60 my $linuxbin = "$ENV{'GSDLHOME'}/bin/linux"; 61 61 62 my $cvsroot = ':ext:[email protected]:/usr/local/global-cvs/gsdl-src';62 # my $cvsroot = ':ext:[email protected]:/usr/local/global-cvs/gsdl-src'; 63 63 64 64 use parsargv; … … 66 66 67 67 use Cwd; 68 68 69 69 70 sub print_usage { … … 109 110 die "\n"; 110 111 } 111 112 112 113 $output_dir = "." unless $output_dir =~ /\w/; 113 114 mkdir ($output_dir, 0777) unless -d $output_dir; … … 120 121 $have_tag = 0; 121 122 } 122 123 123 124 &create_changelog() unless ($nochangelog || $useexistinglog); 124 125 125 126 if (!$only_cols) { 126 127 127 # tag repository128 128 if (!$have_tag) { 129 print STDERR "\ntagging with $cvs_tag\n"; 129 # Tag gsdl repository 130 print STDERR "\ntagging gsdl with $cvs_tag\n"; 130 131 chdir ($ENV{'GSDLHOME'}); 131 132 `cvs tag $cvs_tag`; 132 } 133 134 # cvs export gsdl to $tmpdir 133 134 # Update then tag gli repository 135 chdir (&util::filename_cat($ENV{'GSDLHOME'}, "gli")); 136 print STDERR "\nupdating gli\n"; 137 `cvs update -d`; 138 print STDERR "\ntagging gli with $cvs_tag\n"; 139 `cvs tag -F $cvs_tag`; 140 } 141 142 # Export gsdl to $tmpdir 135 143 print STDERR "\nexporting gsdl ($cvs_tag) to $tmpdir\n\n"; 136 chdir ($tmpdir); 137 `cvs -d $cvsroot export -r $cvs_tag gsdl`; 138 144 chdir($tmpdir); 145 `cvs export -r $cvs_tag gsdl`; 146 # `cvs export -D "1 second ago" gsdl`; 147 148 # Export gli to $tmpdir/gli 149 print STDERR "\nexporting gli ($cvs_tag) to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n"; 150 chdir(&util::filename_cat($tmpdir, "gsdl")); 151 `cvs export -r $cvs_tag gli`; 152 153 # Compile gli 154 print STDERR "\ncompiling gli...\n"; 155 chdir(&util::filename_cat($tmpdir, "gsdl", "gli")); 156 `makegli.sh`; 157 158 # JAR up the gli, then clean up the class files 159 print STDERR "jarring gli...\n"; 160 chdir(&util::filename_cat($tmpdir, "gsdl", "gli", "classes")); 161 `jar cvfm ../GLI.jar META-INF/MANIFEST.MF dictionary.properties images/ org/`; 162 chdir(&util::filename_cat($tmpdir, "gsdl", "gli")); 163 `clean.sh`; 164 165 # Remove bits used by none of the distributions 166 &util::rm(&util::filename_cat($tmpdir, "gsdl", "perllib", "Kea-1.1.4", "aliweb.df")); 167 &util::rm(&util::filename_cat($tmpdir, "gsdl", "perllib", "Kea-1.1.4", "cstr.df")); 168 139 169 # copy ChangeLog into $tmpdir/gsdl 140 &util::cp 141 170 &util::cp(&util::filename_cat($ENV{'GSDLHOME'}, "ChangeLog"), 171 &util::filename_cat($tmpdir, "gsdl")) unless $nochangelog; 142 172 143 173 # edit the VERSION and fnord.cpp files 144 174 &edit_files(); 145 175 146 176 &create_windows_distribution(); 147 177 &create_unix_distribution(); 148 &create_s rc_distribution();178 &create_source_distribution(); 149 179 &create_cdrom_distribution() unless $no_cdrom; 150 180 } … … 153 183 } 154 184 185 155 186 sub create_windows_distribution { 156 my $windows_dist_dir = &util::filename_cat ($output_dir, "gsdl-" . $version_num . "-win32"); 187 print STDERR "Creating Windows distribution...\n"; 188 189 my $windows_dist_dir = &util::filename_cat($output_dir, "gsdl-" . $version_num . "-win32"); 157 190 mkdir ($windows_dist_dir, 0777); 158 191 159 # docs directory and README.TXT160 # &install_docs ($windows_dist_dir, 1); -- just README.TXT for windows web installation 161 &util::cp (&util::filename_cat($docdir, "READMEen.TXT"), $windows_dist_dir); 162 &util::cp (&util::filename_cat($docdir, "READMEfr.TXT"), $windows_dist_dir);163 & util::cp (&util::filename_cat($docdir, "READMEes.TXT"), $windows_dist_dir);192 # empty "collect" directory (just because all the other distributions have one) 193 mkdir (&util::filename_cat($windows_dist_dir, "collect"), 0777); 194 195 # docs directory (with none of the manuals), README.TXT, COPYING and Support.htm 196 &install_docs ($windows_dist_dir, 1); 164 197 165 198 # gsdl directory 166 199 &install_gsdl ($windows_dist_dir); 200 201 # gli directory (in gsdl) 202 &install_gli($windows_dist_dir, "windows"); 167 203 168 204 # src directory … … 182 218 &util::cp (&util::filename_cat ($tmpdemo, "etc", "AZList.txt"), $demoetc); 183 219 &util::cp (&util::filename_cat ($tmpdemo, "etc", "keyword.txt"), $demoetc); 184 &remove_cvs_dirs ($demodir); 185 } 220 } 221 186 222 187 223 sub create_unix_distribution { 188 my $unix_dir = "gsdl-" . $version_num . "-unix"; 189 my $unix_dist_dir = &util::filename_cat ($output_dir, $unix_dir); 224 print STDERR "Creating Unix distribution...\n"; 225 226 my $unix_dist_dir = &util::filename_cat($output_dir, "gsdl-" . $version_num . "-unix"); 190 227 mkdir ($unix_dist_dir, 0777); 191 228 … … 193 230 mkdir (&util::filename_cat($unix_dist_dir, "collect"), 0777); 194 231 195 # docs directory , README.TXT, COPYING and Support.htm232 # docs directory (with none of the manuals), README.TXT, COPYING and Support.htm 196 233 &install_docs ($unix_dist_dir, 1); 197 234 198 235 # gsdl directory 199 236 &install_gsdl ($unix_dist_dir); 237 238 # gli directory (in gsdl) 239 &install_gli($unix_dist_dir, "unix"); 200 240 201 241 # src directory … … 215 255 &util::cp (&util::filename_cat ($tmpdemo, "etc", "keyword.txt"), $demoetc); 216 256 &util::cp (&util::filename_cat ($tmpdemo, "etc", "AZList.txt"), $demoetc); 217 &remove_cvs_dirs ($demodir); 218 219 # tar and gzip it 220 # &zip ($unix_dir, $unix_dir, $output_dir, 2); 221 # &util::rm_r ($unix_dist_dir); 222 } 223 224 sub create_src_distribution { 225 my $src_zip = "gsdl-" . $version_num . "-src"; 226 # we want the COPYING file in the source distribution too 227 &util::cp (&util::filename_cat($docdir, "COPYING"), 228 &util::filename_cat($tmpdir, "gsdl")); 229 # &edit_gsdlsite("/home/gsdl"); 230 &zip ($src_zip, "gsdl", $tmpdir, 2); 231 &util::cp (&util::filename_cat($tmpdir, "$src_zip.tgz"), $output_dir); 232 # remove the COPYING file again to avoid confusion (it's copied to the right 233 # places by install_docs() for other distributions) 234 &util::rm (&util::filename_cat($tmpdir, "COPYING")); 235 } 257 } 258 259 260 sub create_source_distribution { 261 print STDERR "Creating Source distribution...\n"; 262 263 my $source_dist_dir = &util::filename_cat($output_dir, "gsdl-" . $version_num . "-src"); 264 mkdir($source_dist_dir, 0777); 265 266 my $gsdldir = &util::filename_cat ($source_dist_dir, "gsdl"); 267 268 # Copy the entire contents of the exported GSDL directory 269 my $tmpgsdldir = &util::filename_cat($tmpdir, "gsdl"); 270 `cp -r $tmpgsdldir $source_dist_dir`; 271 272 # We want the COPYING file in the source distribution too 273 &util::cp(&util::filename_cat($docdir, "COPYING"), $gsdldir); 274 275 # Remove the copied "images" and "macros" folders and copy over just the core languages 276 my $gsdlimagesdir = &util::filename_cat($source_dist_dir, "gsdl", "images"); 277 &util::rm_r($gsdlimagesdir); 278 &install_only_core_language_images(&util::filename_cat($tmpdir, "gsdl", "images"), $gsdlimagesdir); 279 my $gsdlmacrosdir = &util::filename_cat($source_dist_dir, "gsdl", "macros"); 280 &util::rm_r($gsdlmacrosdir); 281 &install_only_core_language_macros(&util::filename_cat($tmpdir, "gsdl", "macros"), $gsdlmacrosdir); 282 283 # We don't want the compiled GLI classes in the source distribution 284 &util::rm(&util::filename_cat($source_dist_dir, "gsdl", "gli", "GLI.jar")); 285 # chdir(&util::filename_cat($source_dist_dir, "gsdl", "gli")); 286 # `clean.sh`; 287 288 # (We don't include the built demo collection in the source distribution) 289 } 290 236 291 237 292 sub create_cdrom_distribution { 293 print STDERR "Creating CD-ROM distribution...\n"; 294 238 295 my $cdrom_dist_dir = &util::filename_cat ($output_dir, "gsdl-" . $version_num . "-cdrom"); 239 296 mkdir ($cdrom_dist_dir, 0777); 240 297 241 # collect directory (empty for now . we'll add collections manually)298 # collect directory (empty for now; we'll add collections later) 242 299 mkdir (&util::filename_cat ($cdrom_dist_dir, "collect"), 0777); 243 300 244 # docs directory and README.TXT301 # docs directory 245 302 &install_docs ($cdrom_dist_dir, 0); 246 303 247 304 # gsdl directory 248 305 &install_gsdl ($cdrom_dist_dir); 306 307 # gli directory (in gsdl) 308 &install_gli($cdrom_dist_dir, "cdrom"); 249 309 250 310 # src directory … … 267 327 &util::cp (&util::filename_cat ($tmpdemo, "etc", "keyword.txt"), $demoetc); 268 328 &util::cp (&util::filename_cat ($tmpdemo, "etc", "AZList.txt"), $demoetc); 269 &remove_cvs_dirs ($demodir); 270 271 } 329 } 330 272 331 273 332 # isweb is 1 if it's one of the web distributions (i.e. if we don't … … 285 344 &util::cp (&util::filename_cat($docdir, "COPYING"), $install_dir); 286 345 &util::cp (&util::filename_cat($docdir, "Support.htm"), $install_dir); 346 287 347 # don't want manuals for web distributions 288 348 if ($isweb) { 289 my $manfile = &util::filename_cat ($install_dir, "docs", "User-en.pdf"); 290 &util::rm ($manfile) if -e $manfile; 291 $manfile = &util::filename_cat ($install_dir, "docs", "Install-en.pdf"); 292 &util::rm ($manfile) if -e $manfile; 293 $manfile = &util::filename_cat ($install_dir, "docs", "Develop-en.pdf"); 294 &util::rm ($manfile) if -e $manfile; 295 $manfile = &util::filename_cat ($install_dir, "docs", "Paper-en.pdf"); 296 &util::rm ($manfile) if -e $manfile; 297 $manfile = &util::filename_cat ($install_dir, "docs", "User-fr.pdf"); 298 &util::rm ($manfile) if -e $manfile; 299 $manfile = &util::filename_cat ($install_dir, "docs", "Install-fr.pdf"); 300 &util::rm ($manfile) if -e $manfile; 301 $manfile = &util::filename_cat ($install_dir, "docs", "Develop-fr.pdf"); 302 &util::rm ($manfile) if -e $manfile; 303 $manfile = &util::filename_cat ($install_dir, "docs", "Paper-fr.pdf"); 304 &util::rm ($manfile) if -e $manfile; 305 $manfile = &util::filename_cat ($install_dir, "docs", "User-es.pdf"); 306 &util::rm ($manfile) if -e $manfile; 307 $manfile = &util::filename_cat ($install_dir, "docs", "Install-es.pdf"); 308 &util::rm ($manfile) if -e $manfile; 309 $manfile = &util::filename_cat ($install_dir, "docs", "Develop-es.pdf"); 310 &util::rm ($manfile) if -e $manfile; 311 $manfile = &util::filename_cat ($install_dir, "docs", "Paper-es.pdf"); 312 &util::rm ($manfile) if -e $manfile; 313 } 314 315 # don't want doc versions of manuals 349 my @manuals = ("Install-en.pdf", "User-en.pdf", "Develop-en.pdf", "Paper-en.pdf", 350 "Install-fr.pdf", "User-fr.pdf", "Develop-fr.pdf", "Paper-fr.pdf", 351 "Install-es.pdf", "User-es.pdf", "Develop-es.pdf", "Paper-es.pdf", 352 "Install-ru.pdf", "User-ru.pdf", "Develop-ru.pdf", "Paper-ru.pdf", 353 "Install-kz.pdf", "User-kz.pdf", "Paper-kz.pdf"); 354 355 foreach $manual (@manuals) { 356 my $manualfile = &util::filename_cat ($install_dir, "docs", $manual); 357 if (-e $manualfile) { 358 &util::rm($manualfile); 359 } 360 } 361 } 362 363 # Don't want doc versions of manuals 316 364 $rm_docs = "rm -r " . &util::filename_cat ($install_dir, "docs", "*.doc"); 317 365 `$rm_docs`; 318 } 366 367 # Don't want latex versions of manuals 368 $rm_latex = "rm -r " . &util::filename_cat($install_dir, "docs", "latex"); 369 `$rm_latex`; 370 } 371 319 372 320 373 sub install_gsdl { … … 322 375 323 376 my $gsdldir = &util::filename_cat ($install_dir, "gsdl"); 377 mkdir ($gsdldir, 0777); 378 324 379 my $gsdlbindir = &util::filename_cat ($gsdldir, "bin"); 325 mkdir ($gsdldir, 0777);326 380 mkdir ($gsdlbindir, 0777); 327 381 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "bin", "script"), $gsdlbindir); … … 330 384 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "collect"), $gsdldir); 331 385 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "etc"), $gsdldir); 332 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "images"), $gsdldir); 333 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "macros"), $gsdldir); 386 387 my $gsdlimagesdir = &util::filename_cat ($gsdldir, "images"); 388 &install_only_core_language_images(&util::filename_cat($tmpdir, "gsdl", "images"), $gsdlimagesdir); 389 # ...and garish images 390 &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "images", "garish"), $gsdlimagesdir); 391 # &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "images"), $gsdldir); 392 393 my $gsdlmacrosdir = &util::filename_cat ($gsdldir, "macros"); 394 &install_only_core_language_macros(&util::filename_cat($tmpdir, "gsdl", "macros"), $gsdlmacrosdir); 395 # &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "macros"), $gsdldir); 396 397 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "mappings"), $gsdldir); 334 398 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "perllib"), $gsdldir); 335 &util::cp_r (&util::filename_cat ($tmpdir, "gsdl", "mappings"), $gsdldir);336 399 337 400 # untar Ping.tgz … … 364 427 } 365 428 } 429 430 431 sub install_only_core_language_images 432 { 433 my ($source_dir, $target_dir) = @_; 434 mkdir($target_dir, 0777); 435 436 # Copy all the English images (in the "images" directory) 437 opendir(IMAGES_DIR, $source_dir) || die "Error: Could not open directory $source_dir\n"; 438 foreach $file (readdir(IMAGES_DIR)) { 439 my $source_file = &util::filename_cat($source_dir, $file); 440 if (-f $source_file) { # Plain files only (ignore directories) 441 &util::cp($source_file, $target_dir); 442 } 443 } 444 closedir(IMAGES_DIR); 445 446 # Copy the core language (French, Spanish, Russian) images 447 &util::cp_r(&util::filename_cat($source_dir, "es"), $target_dir); 448 &util::cp_r(&util::filename_cat($source_dir, "fr"), $target_dir); 449 &util::cp_r(&util::filename_cat($source_dir, "ru"), $target_dir); 450 } 451 452 453 sub install_only_core_language_macros 454 { 455 my ($source_dir, $target_dir) = @_; 456 mkdir($target_dir, 0777); 457 458 # Language independent (theoretically) macrofiles 459 my @basicmacrofiles = ("about.dm", "authen.dm", "base.dm", "browse.dm", "bsummary.dm", 460 "collect.dm", "dateqry.dm", "docs.dm", "document.dm", "extlink.dm", 461 "garish.dm", "gsdl.dm", "help.dm", "home.dm", "html.dm", 462 "nzdlhome.dm", "pref.dm", "query.dm", "status.dm", "style.dm", 463 "tip.dm", "translang.dm", "users.dm", "yourhome.dm"); 464 465 # Core language (English, French, Spanish, Russian) macrofiles 466 my @corelanguagemacrofiles = ("english.dm", "english2.dm", "french.dm", "french2.dm", 467 "spanish.dm", "spanish2.dm", "russian.dm", "russian2.dm", 468 "yourhome-es.dm", "yourhome-fr.dm"); 469 470 # Copy the macrofiles 471 foreach $file ((@basicmacrofiles, @corelanguagemacrofiles)) { 472 &util::cp(&util::filename_cat($source_dir, $file), $target_dir); 473 } 474 } 475 476 477 sub install_gli 478 { 479 my ($install_dir, $type) = @_; 480 481 # Copy the Greenstone Librarian Interface 482 my $source_dir = &util::filename_cat($tmpdir, "gsdl", "gli"); 483 my $target_dir = &util::filename_cat($install_dir, "gsdl"); 484 &util::cp_r($source_dir, $target_dir); 485 486 if ($type eq "unix") { 487 # Don't need Windows scripts 488 &util::rm(&util::filename_cat($target_dir, "gli", "clean.bat")); 489 &util::rm(&util::filename_cat($target_dir, "gli", "document.bat")); 490 &util::rm(&util::filename_cat($target_dir, "gli", "gli.bat")); 491 &util::rm(&util::filename_cat($target_dir, "gli", "makegli.bat")); 492 493 # Don't need Windows utilities 494 &util::rm_r(&util::filename_cat($target_dir, "gli", "winutil")); 495 } 496 497 if ($type eq "windows") { 498 # Don't need Unix scripts 499 &util::rm(&util::filename_cat($target_dir, "gli", "clean.sh")); 500 &util::rm(&util::filename_cat($target_dir, "gli", "document.sh")); 501 &util::rm(&util::filename_cat($target_dir, "gli", "gli.sh")); 502 &util::rm(&util::filename_cat($target_dir, "gli", "makegli.sh")); 503 } 504 } 505 366 506 367 507 sub install_src {
Note:
See TracChangeset
for help on using the changeset viewer.