Ticket #38276: patch-install.pl.diff
File patch-install.pl.diff, 4.1 KB (added by jul_bsd@…, 11 years ago) |
---|
-
install.pl
old new 1 #! /usr/bin/perl1 #!__PREFIX__/bin/perl -I __PREFIX__/libexec/nfsen -I __DESTDIR____PREFIX__/libexec/nfsen 2 2 # 3 3 # 4 4 # Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung … … 277 277 sub PatchAllScripts { 278 278 279 279 my %GlobList = ( 280 "bin/*" => " $NfConf::INSTPREFIX$NfConf::BINDIR",281 "libexec/*" => " $NfConf::INSTPREFIX$NfConf::LIBEXECDIR"280 "bin/*" => "__DESTDIR____PREFIX__/bin", 281 "libexec/*" => "__DESTDIR____PREFIX__/libexec/nfsen" 282 282 ); 283 283 284 284 foreach my $glob_list ( keys %GlobList ) { … … 328 328 my ( $nfsen_uid, $www_gid ) = @_; 329 329 330 330 print "Setup php and html files.\n"; 331 mkpath(" $NfConf::INSTPREFIX$NfConf::HTMLDIR", 1, 0755) unless -d "$NfConf::INSTPREFIX$NfConf::HTMLDIR";332 die "Could not create HTMl directory ' $NfConf::INSTPREFIX$NfConf::HTMLDIR': $!\n" unless -d "$NfConf::INSTPREFIX$NfConf::HTMLDIR";331 mkpath("__DESTDIR____PREFIX__/www/nfsen", 1, 0755) unless -d "__DESTDIR____PREFIX__/www/nfsen"; 332 die "Could not create HTMl directory '__DESTDIR____PREFIX__/www/nfsen': $!\n" unless -d "__DESTDIR____PREFIX__/www/nfsen"; 333 333 334 334 $CopyRecursive::CopyLink = 1; 335 335 $CopyRecursive::MODE = 0644; 336 336 $CopyRecursive::UID = 0; 337 337 $CopyRecursive::GID = $www_gid; 338 CopyRecursive::dircopy("html", " $NfConf::INSTPREFIX$NfConf::HTMLDIR");339 open CONF, "> $NfConf::INSTPREFIX$NfConf::HTMLDIR/conf.php" || die "Can't open conf.php for writing: $!\n";338 CopyRecursive::dircopy("html", "__DESTDIR____PREFIX__/www/nfsen"); 339 open CONF, ">__DESTDIR____PREFIX__/www/nfsen/conf.php" || die "Can't open conf.php for writing: $!\n"; 340 340 print CONF "<?php\n"; 341 341 print CONF "/* This file was automatically created by the NfSen $nfsen_version install.pl script */\n\n"; 342 342 print CONF "\$COMMSOCKET = \"$NfConf::COMMSOCKET\";\n"; … … 356 356 umask 0002; 357 357 print "\nSetup diretories:\n"; 358 358 my @dirs = ( 359 " $NfConf::INSTPREFIX$NfConf::VARDIR",360 " $NfConf::INSTPREFIX$NfConf::VARDIR/tmp",361 " $NfConf::INSTPREFIX$NfConf::PIDDIR",362 " $NfConf::INSTPREFIX$NfConf::FILTERDIR",363 " $NfConf::INSTPREFIX$NfConf::FORMATDIR",359 "__DESTDIR____PREFIX__/var/nfsen", 360 "__DESTDIR____PREFIX__/var/nfsen/tmp", 361 "__DESTDIR____PREFIX__/var/nfsen/run", 362 "__DESTDIR____PREFIX__/var/nfsen/filters", 363 "__DESTDIR____PREFIX__/var/nfsen", 364 364 "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR", 365 365 "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR/live", 366 366 "$NfConf::INSTPREFIX$NfConf::PROFILEDATADIR", … … 579 579 $CopyRecursive::UID = 0; 580 580 $CopyRecursive::GID = $www_gid; 581 581 $CopyRecursive::MODE = 0755; 582 unlink " $NfConf::BINDIR/nfsen.rc";583 CopyRecursive::dircopy("bin", " $NfConf::INSTPREFIX$NfConf::BINDIR");584 CopyRecursive::dircopy("libexec", " $NfConf::INSTPREFIX$NfConf::LIBEXECDIR");582 unlink "__DESTDIR____PREFIX__/bin/nfsen.rc"; 583 CopyRecursive::dircopy("bin", "__DESTDIR____PREFIX__/bin"); 584 CopyRecursive::dircopy("libexec", "__DESTDIR____PREFIX__/libexec/nfsen"); 585 585 $CopyRecursive::MODE = 0644; 586 CopyRecursive::dircopy("etc", " $NfConf::INSTPREFIX$NfConf::CONFDIR");587 CopyRecursive::dircopy("plugins/backend", " $NfConf::INSTPREFIX$NfConf::BACKEND_PLUGINDIR");588 CopyRecursive::dircopy("plugins/frontend", " $NfConf::INSTPREFIX$NfConf::FRONTEND_PLUGINDIR");586 CopyRecursive::dircopy("etc", "__DESTDIR____PREFIX__/etc"); 587 CopyRecursive::dircopy("plugins/backend", "__DESTDIR____PREFIX__/libexec/nfsen/plugins"); 588 CopyRecursive::dircopy("plugins/frontend", "__DESTDIR____PREFIX__/www/nfsen/plugins"); 589 589 590 if ( $ConfigFile eq "$NfConf::CONFDIR/nfsen.conf" ) {591 print "Keep config file '$ConfigFile'\n";592 } else {593 print "Copy config file '$ConfigFile'\n";594 CopyRecursive::fcopy("$ConfigFile", "$NfConf::CONFDIR/nfsen.conf");595 }596 590 print "\n"; 597 591 598 592 } # End of CopyAllFiles … … 663 657 exit 1; 664 658 } 665 659 666 # check for extra errornoous nfsen.conf file, which may overwrite existing files667 if ( -f "$NfConf::CONFDIR/nfsen.conf" && -f "etc/nfsen.conf" &&668 ( (stat($ConfigFile))[1] != (stat("etc/nfsen.conf"))[1] )) {669 die "Extra nfsen.conf file in etc directory found. Remove errornous file first"670 }671 672 660 Log::LogInit(); 673 661 674 662 my $hints = NfSen::LoadHints();