cmCPackRPMGenerator.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCPackRPMGenerator_h
  11. #define cmCPackRPMGenerator_h
  12. #include "cmCPackGenerator.h"
  13. /** \class cmCPackRPMGenerator
  14. * \brief A generator for RPM packages
  15. * The idea of the CPack RPM generator is to use
  16. * as minimal C++ code as possible.
  17. * Ideally the C++ part of the CPack RPM generator
  18. * will only 'execute' (aka ->ReadListFile) several
  19. * CMake macros files.
  20. */
  21. class cmCPackRPMGenerator : public cmCPackGenerator
  22. {
  23. public:
  24. cmCPackTypeMacro(cmCPackRPMGenerator, cmCPackGenerator);
  25. /**
  26. * Construct generator
  27. */
  28. cmCPackRPMGenerator();
  29. virtual ~cmCPackRPMGenerator();
  30. static bool CanGenerate()
  31. {
  32. #ifdef __APPLE__
  33. // on MacOS enable CPackRPM iff rpmbuild is found
  34. return cmSystemTools::FindProgram("rpmbuild") != "" ? true : false;
  35. #else
  36. // legacy behavior on other systems
  37. return true;
  38. #endif
  39. }
  40. protected:
  41. virtual int InitializeInternal();
  42. virtual int PackageFiles();
  43. /**
  44. * This method factors out the work done in component packaging case.
  45. */
  46. int PackageOnePack(std::string initialToplevel, std::string packageName);
  47. /**
  48. * The method used to package files when component
  49. * install is used. This will create one
  50. * archive for each component group.
  51. */
  52. int PackageComponents(bool ignoreGroup);
  53. /**
  54. * Special case of component install where all
  55. * components will be put in a single installer.
  56. */
  57. int PackageComponentsAllInOne();
  58. virtual const char* GetOutputExtension() { return ".rpm"; }
  59. virtual bool SupportsComponentInstallation() const;
  60. virtual std::string GetComponentInstallDirNameSuffix(
  61. const std::string& componentName);
  62. };
  63. #endif