From: Mark Abraham Date: Sat, 5 Jul 2014 12:24:28 +0000 (+0200) Subject: Fix tarball and install, particularly for INSTALL X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=4b3f691f3d02ae19957c4e015d7ea6376b69a2aa;p=alexxy%2Fgromacs.git Fix tarball and install, particularly for INSTALL Getting the INSTALL file generated from the markdown, into the tarball via CPack and not otherwise installed is a bit tricky. I did this manually for 5.0, but this automates things. CPack source archives use a mechanism that acts on whole directories. So we put INSTALL into its own output directory (as we do for generated HTML), and the directory-globbing mechanism takes care of it fine. Added some documentation for why we need to do this. Added more CPack-time checks that the tarball will be complete. Prevented installation of .gitattributes. Change-Id: I77c645faf7b292a085165bdd1598741dae6972a5 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 832dcb44ce..b7b8f27856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,9 +137,13 @@ set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/admin/InstallWelcome.txt") # Its GPL/LGPL, so they do not have to agree to a license for mere usage, but some installers require this... set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/admin/InstallInfo.txt") -set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$") +set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;") set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackInit.cmake") -set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final") +# CPack source archives include only the directories we list here. +# This variable is a list of pairs of names of source and destination +# directories. Most of these are used for content GROMACS generates as +# part of the configuration or build. +set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final;${CMAKE_BINARY_DIR}/install-guide/final;/") set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org") #must come after all cpack settings! diff --git a/CPackInit.cmake b/CPackInit.cmake index 779124f2a1..7d3985f994 100644 --- a/CPackInit.cmake +++ b/CPackInit.cmake @@ -36,13 +36,15 @@ if(CPACK_SOURCE_PACKAGE_FILE_NAME) #building source package get_filename_component(CMAKE_BINARY_DIR ${CPACK_OUTPUT_CONFIG_FILE} PATH) if (NOT EXISTS "${CMAKE_BINARY_DIR}/share/man/man1/gmx-view.1" OR - NOT EXISTS "${CMAKE_BINARY_DIR}/INSTALL" OR - NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/online.html") + NOT EXISTS "${CMAKE_BINARY_DIR}/install-guide/final/INSTALL" OR + NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/online.html" OR + NOT EXISTS "${CMAKE_BINARY_DIR}/src/programs/completion/gmx-completion.bash" OR + NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/programs/gmx-view.html") message(FATAL_ERROR - "To create a complete source package all man and HTML pages need " - "to be generated, and the INSTALL file generated. " - "Run 'make man html' to build these parts. You can also set " - "GMX_BUILD_HELP=ON to automatically build the HTML parts. " - "The latter also requires you to execute 'make install-guide'.") + "To create a complete source package, bash completions, " + "man and HTML pages, and INSTALL need to be generated. " + "Run 'make completion man html install-guide' to build " + "these parts. You can also configure with " + "GMX_BUILD_HELP=ON to automatically build the HTML parts.") endif() endif() diff --git a/install-guide/CMakeLists.txt b/install-guide/CMakeLists.txt index a54d82cd14..fb5faaa7e0 100644 --- a/install-guide/CMakeLists.txt +++ b/install-guide/CMakeLists.txt @@ -68,10 +68,13 @@ if(INSTALL_GUIDE_BUILD_IS_POSSIBLE) VERBATIM ) - # Make the INSTALL file for CPack for the tarball + # Make the INSTALL file for CPack for the tarball. This gets put + # into the tarball via the CPack rules in the top-level + # CMakeLists.txt add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/INSTALL - COMMAND pandoc -t plain -o ../INSTALL install-guide.md + OUTPUT final/INSTALL + COMMAND ${CMAKE_COMMAND} -E make_directory final + COMMAND pandoc -t plain -o final/INSTALL install-guide.md DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/install-guide.md VERBATIM ) @@ -80,7 +83,7 @@ if(INSTALL_GUIDE_BUILD_IS_POSSIBLE) add_custom_target(install-guide DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/install-guide.html - ${CMAKE_BINARY_DIR}/INSTALL + final/INSTALL VERBATIM ) endif()