Skip to content

Commit 60b0a19

Browse files
author
Mathieu Parent
committed
Allow to set a suffix to the Debian package version
Example: CPACK_DEBIAN_PACKAGE_VERSION_SUFFIX=+deb8 make deb
1 parent 91ff50d commit 60b0a19

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CPackConfig.cmake

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# See http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29
22

33
if(CPACK_GENERATOR MATCHES "DEB")
4-
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
5-
# When the DEB-generator runs, we want him to run our install-script
6-
set(CPACK_INSTALL_SCRIPT ${CPACK_DEBIAN_INSTALL_SCRIPT})
4+
set(CPACK_DEBIAN_PACKAGE_VERSION_SUFFIX "$ENV{CPACK_DEBIAN_PACKAGE_VERSION_SUFFIX}")
5+
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${CPACK_DEBIAN_PACKAGE_VERSION_SUFFIX}")
6+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
7+
# When the DEB-generator runs, we want him to run our install-script
8+
set(CPACK_INSTALL_SCRIPT ${CPACK_DEBIAN_INSTALL_SCRIPT})
79
endif()

docs/source/installing.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,9 @@ The packages will be created in the build directory.
199199
`cpack` or `make package`, even on a Unix machine w/ dpkg installed.
200200
Instead, running `source build.sh` on such a machine will generate a
201201
Makefile with a separate 'deb' target, so you can run `make deb` to
202-
generate the appropriate deb package.
202+
generate the appropriate deb package. Additionnaly, you can add a suffix to
203+
the package version, for example:
204+
205+
.. code-block:: bash
206+
207+
CPACK_DEBIAN_PACKAGE_VERSION_SUFFIX=+deb8 make deb

0 commit comments

Comments
 (0)