| 364 | } |
| 365 | |
| 366 | int cmCPackRPMGenerator::PackageComponentsAllInOne( |
| 367 | std::string const& compInstDirName) |
| 368 | { |
| 369 | int retval = 1; |
| 370 | /* Reset package file name list it will be populated during the |
| 371 | * component packaging run*/ |
| 372 | this->packageFileNames.clear(); |
| 373 | std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); |
| 374 | |
| 375 | if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE")) { |
| 376 | this->SetOption("CPACK_RPM_DEBUGINFO_PACKAGE", "ON"); |
| 377 | } |
| 378 | |
| 379 | cmCPackLogger(cmCPackLog::LOG_VERBOSE, |
| 380 | "Packaging all groups in one package..." |
| 381 | "(CPACK_COMPONENTS_ALL_[GROUPS_]IN_ONE_PACKAGE is set)" |
| 382 | << std::endl); |
| 383 | |
| 384 | // The ALL GROUPS in ONE package case |
| 385 | std::string localToplevel(initialTopLevel); |
| 386 | std::string packageFileName( |
| 387 | cmSystemTools::GetParentDirectory(this->toplevel)); |
| 388 | std::string outputFileName( |
| 389 | std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + |
| 390 | this->GetOutputExtension()); |
| 391 | // all GROUP in one vs all COMPONENT in one |
| 392 | localToplevel += "/" + compInstDirName; |
| 393 | |
| 394 | /* replace the TEMP DIRECTORY with the component one */ |
| 395 | this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel); |
| 396 | packageFileName += "/" + outputFileName; |
| 397 | /* replace proposed CPACK_OUTPUT_FILE_NAME */ |
| 398 | this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName); |
| 399 | /* replace the TEMPORARY package file name */ |
| 400 | this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", packageFileName); |
| 401 | |
| 402 | if (!compInstDirName.empty()) { |
| 403 | // Tell CPackRPM.cmake the path where the component is. |
| 404 | std::string component_path = cmStrCat('/', compInstDirName); |
| 405 | this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", component_path); |
| 406 | } |
| 407 | |
| 408 | if (this->ReadListFile("Internal/CPack/CPackRPM.cmake")) { |
| 409 | this->AddGeneratedPackageNames(); |
| 410 | } else { |
| 411 | cmCPackLogger(cmCPackLog::LOG_ERROR, |
| 412 | "Error while execution CPackRPM.cmake" << std::endl); |
| 413 | retval = 0; |
| 414 | } |
| 415 | |
| 416 | return retval; |
| 417 | } |
| 418 | |
| 419 | int cmCPackRPMGenerator::PackageFiles() |
| 420 | { |
no test coverage detected