diff options
author | Alexander Smorkalov <alexander.smorkalov@itseez.com> | 2016-05-10 12:17:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-13 14:46:02 (GMT) |
commit | 2d5896530b7353496e728eb7751ef05c305287e7 (patch) | |
tree | 4b5e48f6b051dca5543a574ed9277b386f385474 /Source/CPack/cmCPackDebGenerator.cxx | |
parent | 5fdd7d21f432e7a43a0cfa1a26da2d92217c7a60 (diff) | |
download | CMake-2d5896530b7353496e728eb7751ef05c305287e7.zip CMake-2d5896530b7353496e728eb7751ef05c305287e7.tar.gz CMake-2d5896530b7353496e728eb7751ef05c305287e7.tar.bz2 |
CPack/Deb generation of DEBIAN/shlibs control file
DEBIAN/shlibs control file generation if the package
contains libraries
Diffstat (limited to 'Source/CPack/cmCPackDebGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 0911713..839115e 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -227,6 +227,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne() } packageFiles = gl.GetFiles(); + int res = createDeb(); if (res != 1) { @@ -281,9 +282,8 @@ int cmCPackDebGenerator::PackageFiles() int cmCPackDebGenerator::createDeb() { // debian-binary file - std::string dbfilename; - dbfilename += this->GetOption("GEN_WDIR"); - dbfilename += "/debian-binary"; + const std::string strGenWDIR(this->GetOption("GEN_WDIR")); + const std::string dbfilename = strGenWDIR + "/debian-binary"; { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(dbfilename.c_str()); out << "2.0"; @@ -291,9 +291,7 @@ int cmCPackDebGenerator::createDeb() } // control file - std::string ctlfilename; - ctlfilename = this->GetOption("GEN_WDIR"); - ctlfilename += "/control"; + std::string ctlfilename = strGenWDIR + "/control"; // debian policy enforce lower case for package name // mandatory entries: @@ -405,7 +403,18 @@ int cmCPackDebGenerator::createDeb() out << std::endl; } - const std::string strGenWDIR(this->GetOption("GEN_WDIR")); + const std::string shlibsfilename = strGenWDIR + "/shlibs"; + + const char* debian_pkg_shlibs = this->GetOption( + "GEN_CPACK_DEBIAN_PACKAGE_SHLIBS"); + const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") + && debian_pkg_shlibs && *debian_pkg_shlibs; + if( gen_shibs ) + { + cmGeneratedFileStream out(shlibsfilename.c_str()); + out << debian_pkg_shlibs; + out << std::endl; + } cmArchiveWrite::Compress tar_compression_type = cmArchiveWrite::CompressGZip; const char* debian_compression_type = @@ -605,6 +614,21 @@ int cmCPackDebGenerator::createDeb() return 0; } + // adds generated shlibs file + if( gen_shibs ) + { + if( !control_tar.Add(shlibsfilename, strGenWDIR.length(), ".") ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error adding file to tar:" << std::endl + << "#top level directory: " + << strGenWDIR << std::endl + << "#file: \"shlibs\"" << std::endl + << "#error:" << control_tar.GetError() << std::endl); + return 0; + } + } + // for the other files, we use // -either the original permission on the files // -either a permission strictly defined by the Debian policies |