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/perl
     1#!__PREFIX__/bin/perl -I __PREFIX__/libexec/nfsen -I __DESTDIR____PREFIX__/libexec/nfsen
    22#
    33#
    44#  Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
     
    277277sub PatchAllScripts {
    278278
    279279        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"
    282282        );
    283283
    284284        foreach my $glob_list ( keys %GlobList ) {
     
    328328        my ( $nfsen_uid, $www_gid ) = @_;
    329329
    330330        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";
    333333
    334334        $CopyRecursive::CopyLink = 1;
    335335        $CopyRecursive::MODE     = 0644;
    336336        $CopyRecursive::UID      = 0;
    337337        $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";
    340340        print CONF "<?php\n";
    341341        print CONF "/* This file was automatically created by the NfSen $nfsen_version install.pl script */\n\n";
    342342        print CONF "\$COMMSOCKET = \"$NfConf::COMMSOCKET\";\n";
     
    356356        umask 0002;
    357357        print "\nSetup diretories:\n";
    358358        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",
    364364                "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR",
    365365                "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR/live",
    366366                "$NfConf::INSTPREFIX$NfConf::PROFILEDATADIR",
     
    579579        $CopyRecursive::UID      = 0;
    580580        $CopyRecursive::GID      = $www_gid;
    581581        $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");
    585585        $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");
    589589
    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         }
    596590        print "\n";
    597591
    598592} # End of CopyAllFiles
     
    663657        exit 1;
    664658}
    665659
    666 # check for extra errornoous nfsen.conf file, which may overwrite existing files
    667 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 
    672660Log::LogInit();
    673661
    674662my $hints = NfSen::LoadHints();