CMakeLists.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. project(movim)
  2. cmake_minimum_required(VERSION 2.8)
  3. exec_program("cat ../VERSION | cut -d . -f 1 2>/dev/null"
  4. OUTPUT_VARIABLE MOVIM_VERSION_MAJOR)
  5. exec_program("cat ../VERSION | cut -d . -f 2 2>/dev/null"
  6. OUTPUT_VARIABLE MOVIM_VERSION_MINOR)
  7. exec_program("git rev-parse --short HEAD 2>/dev/null"
  8. OUTPUT_VARIABLE MOVIM_VERSION_PATCH)
  9. set(VERSION_MAJOR "${MOVIM_VERSION_MAJOR}")
  10. set(VERSION_MINOR "${MOVIM_VERSION_MINOR}")
  11. set(VERSION_PATCH "${MOVIM_VERSION_PATCH}")
  12. #install(DIRECTORY "config" DESTINATION "/etc/${CMAKE_PROJECT_NAME}")
  13. install(DIRECTORY "debian/etc" DESTINATION "/")
  14. install(DIRECTORY "debian/lib" DESTINATION "/")
  15. install(DIRECTORY "app" DESTINATION "/usr/share/${CMAKE_PROJECT_NAME}")
  16. install(DIRECTORY "src" DESTINATION "/var/lib/${CMAKE_PROJECT_NAME}")
  17. install(DIRECTORY "system" DESTINATION "/usr/share/${CMAKE_PROJECT_NAME}")
  18. install(DIRECTORY "lib" DESTINATION "/var/lib/${CMAKE_PROJECT_NAME}")
  19. install(DIRECTORY "locales" DESTINATION "/var/lib/${CMAKE_PROJECT_NAME}")
  20. install(DIRECTORY "themes" DESTINATION "/var/lib/${CMAKE_PROJECT_NAME}")
  21. install(DIRECTORY "vendor" DESTINATION "/var/lib/${CMAKE_PROJECT_NAME}" REGEX ".git" EXCLUDE)
  22. install(FILES index.php bootstrap.php daemon.php linker.php mud.php composer.json "VERSION" DESTINATION "/usr/share/${CMAKE_PROJECT_NAME}")
  23. install(FILES "config/db.example.inc.php" DESTINATION "/etc/${CMAKE_PROJECT_NAME}")
  24. # package settings
  25. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Kick Ass Social Network, decentralized and fully based on XMPP ")
  26. set(CPACK_PACKAGE_VENDOR "Jaussoin Timothée")
  27. set(CPACK_PACKAGE_CONTACT "edhelas@movim.eu")
  28. set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
  29. set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
  30. set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
  31. set(CPACK_RESOURCE_FILE_LICENSE "../COPYING")
  32. set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}")
  33. set(ACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}")
  34. set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Kickass distributed social networking platform that protect your privacy an comes with a set of awesome features.")
  35. set(CPACK_DEBIAN_PACKAGE_DEPENDS "php5 (>= 5.4.0), php5-gd (>= 5.4.0), php5-curl (>= 5.4.0), php5-imagick (>= 3.0.0), dbconfig-common(>= 1.8.0)")
  36. set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Jaussoin Timothée <edhelas@movim.eu>")
  37. set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://movim.eu/")
  38. SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debian/conffiles;${CMAKE_CURRENT_SOURCE_DIR}/debian/config;${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm;${CMAKE_CURRENT_SOURCE_DIR}/debian/templates;")
  39. set(PACK "DEB" CACHE STRING "Generate a Package")
  40. set(CPACK_GENERATOR ${PACK})
  41. include(CPack)