2006-01-02 07:21:05 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
|
|
|
|
#include "cmCPackSTGZGenerator.h"
|
|
|
|
|
|
|
|
#include "cmake.h"
|
|
|
|
#include "cmGlobalGenerator.h"
|
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
#include "cmSystemTools.h"
|
|
|
|
#include "cmMakefile.h"
|
2006-01-03 00:14:21 +03:00
|
|
|
#include "cmCPackLog.h"
|
2006-01-02 07:21:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
cmCPackSTGZGenerator::cmCPackSTGZGenerator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
cmCPackSTGZGenerator::~cmCPackSTGZGenerator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
|
|
|
|
{
|
2006-01-03 00:14:21 +03:00
|
|
|
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Writing header" << std::endl);
|
2006-01-02 07:21:05 +03:00
|
|
|
*os
|
|
|
|
<< "#!/bin/sh" << std::endl
|
2006-01-04 23:14:09 +03:00
|
|
|
<< "echo \"" << this->GetOption("CPACK_PACKAGE_NAME")
|
2006-01-02 07:21:05 +03:00
|
|
|
<< " - self-extracting archive.\"" << std::endl
|
2006-03-09 00:33:39 +03:00
|
|
|
<< "echo \"If you want to stop extracting, please press <ctrl-C>.\""
|
|
|
|
<< std::endl
|
2006-01-02 07:21:05 +03:00
|
|
|
<< "read line" << std::endl
|
|
|
|
<< "echo \"Extracting... Please wait...\"" << std::endl
|
|
|
|
<< "echo \"\"" << std::endl
|
|
|
|
<< "" << std::endl
|
2006-03-09 00:33:39 +03:00
|
|
|
<< "# take the archive portion of this file and pipe it to tar"
|
|
|
|
<< std::endl
|
|
|
|
<< "# the NUMERIC parameter in this command should be one more"
|
|
|
|
<< std::endl
|
2006-01-02 07:21:05 +03:00
|
|
|
<< "# than the number of lines in this header file" << std::endl
|
2006-02-14 18:28:40 +03:00
|
|
|
<< "tail +18 \"$0\" | gunzip | tar xf -" << std::endl
|
2006-01-02 07:21:05 +03:00
|
|
|
<< "" << std::endl
|
|
|
|
<< "exit 0" << std::endl
|
|
|
|
<< "echo \"\"" << std::endl
|
2006-03-09 00:33:39 +03:00
|
|
|
<< "#-----------------------------------------------------------"
|
|
|
|
<< std::endl
|
2006-01-02 07:21:05 +03:00
|
|
|
<< "# Start of TAR.GZ file" << std::endl
|
2006-03-09 00:33:39 +03:00
|
|
|
<< "#-----------------------------------------------------------"
|
|
|
|
<< std::endl;
|
2006-01-04 23:14:09 +03:00
|
|
|
return this->Superclass::GenerateHeader(os);
|
2006-01-02 07:21:05 +03:00
|
|
|
}
|