[cmake-commits] alex committed cmCPackDebGenerator.cxx 1.3 1.4 cpack.cxx 1.32 1.33

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jul 27 09:00:01 EDT 2007


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv13797/Source/CPack

Modified Files:
	cmCPackDebGenerator.cxx cpack.cxx 
Log Message:

ENH: deb generator can now generate deb packages
-remove the unscriptable commands also from the cpack cmake
-use CPACK_PACKAGE_CONTACT in CMakeCPack.cmake, it's used in the nsis and
the deb generator
-make set_properties() scriptable
-use a non-const char array for adding the python modules

Alex


Index: cpack.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cpack.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cpack.cxx	26 Jul 2007 12:40:51 -0000	1.32
+++ cpack.cxx	27 Jul 2007 12:59:59 -0000	1.33
@@ -218,6 +218,7 @@
     "Read CPack config file: " << cpackConfigFile.c_str() << std::endl);
 
   cmake cminst;
+  cminst.RemoveUnscriptableCommands();
   cmGlobalGenerator cmgg;
   cmgg.SetCMakeInstance(&cminst);
   cmLocalGenerator* cmlg = cmgg.CreateLocalGenerator();

Index: cmCPackDebGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackDebGenerator.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmCPackDebGenerator.cxx	25 Jul 2007 17:08:17 -0000	1.3
+++ cmCPackDebGenerator.cxx	27 Jul 2007 12:59:59 -0000	1.4
@@ -52,39 +52,36 @@
     out << std::endl; // required for valid debian package
     }
 
-  // debian policy enforce lower case for package name
-  //      IF(NOT DEBIAN_PACKAGE_NAME)
-  //  STRING(TOLOWER
-  //    ${CPACK_PACKAGE_NAME}
-  //    DEBIAN_PACKAGE_NAME
-  //    )
-
   // control file
   std::string ctlfilename;
   ctlfilename = toplevel;
   ctlfilename += "/control";
+
+  // debian policy enforce lower case for package name
+  std::string debian_pkg_name = cmsys::SystemTools::LowerCase( this->GetOption("DEBIAN_PACKAGE_NAME") );
+  const char* debian_pkg_version = this->GetOption("DEBIAN_PACKAGE_VERSION");
+  const char* debian_pkg_arch = this->GetOption("DEBIAN_PACKAGE_ARCHITECTURE");
+  const char* debian_pkg_dep  = this->GetOption("DEBIAN_PACKAGE_DEPENDS");
+  const char* maintainer = this->GetOption("DEBIAN_PACKAGE_MAINTAINER");
+  const char* desc = this->GetOption("DEBIAN_PACKAGE_DESCRIPTION");
+
     { // the scope is needed for cmGeneratedFileStream
     cmGeneratedFileStream out(ctlfilename.c_str());
-    out << "Package: ${DEBIAN_PACKAGE_NAME}\n";
-    out << "Version: ${CPACK_PACKAGE_VERSION}\n";
+    out << "Package: " << debian_pkg_name << "\n";
+    out << "Version: " << debian_pkg_version << "\n";
     out << "Section: devel\n";
     out << "Priority: optional\n";
-    out << "Architecture: ${DEBIAN_ARCHITECTURE}\n";
-    out << "Depends: ${DEBIAN_PACKAGE_DEPENDS}\n";
-    out << "Maintainer: ${CPACK_NSIS_CONTACT}\n";
-    out << "Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n";
-    out << "${DEBIAN_PACKAGE_NAME} was packaged by UseDebian and CMake.\n";
+    out << "Architecture: " << debian_pkg_arch << "\n";
+    out << "Depends: " << debian_pkg_dep << " \n";
+    out << "Maintainer: " << maintainer << "\n";
+    out << "Description: " << desc << "\n";
+    out << " " << debian_pkg_name << " was packaged by CMake.\n";
     out << std::endl;
     }
 
-  std::string output;
-  std::string cmd;
-//   cmd = this->GetOption("CPACK_DEB_COMMAND");
-//   cmsys::SystemTools::ReplaceString(cmd, "<ARCHIVE>", outFileName);
-//   cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>", "deb.filelist");
-
-  cmd = cmakeExecutable;
+  std::string cmd = cmakeExecutable;
   cmd += " -E tar cfz data.tar.gz ./usr";
+  std::string output;
   int retVal = -1;
   int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
     &retVal, toplevel, this->GeneratorVerbose, 0);
@@ -151,6 +148,7 @@
   cmd += "\" debian-binary control.tar.gz data.tar.gz";
   res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
     &retVal, toplevel, this->GeneratorVerbose, 0);
+
   return 1;
 }
 



More information about the Cmake-commits mailing list