|
1 | 1 | #=============================================================================
|
2 |
| -# CMakeDebHelper, Copyright (C) 2013 Sebastian Kienzl |
3 |
| -# http://knzl.de/cmake-debhelper/ |
4 |
| -# Licensed under the GPL v2, see LICENSE |
| 2 | +# Removed content due to licensing/copyright issues |
5 | 3 | #=============================================================================
|
6 |
| - |
7 |
| -# configure() .in-files to the CURRENT_BINARY_DIR |
8 |
| -foreach( _F ${DH_INPUT} ) |
9 |
| - # strip the .in part |
10 |
| - string( REGEX REPLACE ".in$" "" _F_WE ${_F} ) |
11 |
| - configure_file( ${_F} ${_F_WE} @ONLY ) |
12 |
| -endforeach() |
13 |
| - |
14 |
| -# compat and control is only needed for running the debhelpers, |
15 |
| -# CMake is going to make up the one that ends up in the deb. |
16 |
| -file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/compat "9" ) |
17 |
| -if( NOT CPACK_DEBIAN_PACKAGE_NAME ) |
18 |
| - string( TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME ) |
19 |
| -endif() |
20 |
| -file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/control "Package: ${CPACK_DEBIAN_PACKAGE_NAME}\nArchitecture: any\n" ) |
21 |
| - |
22 |
| -# Some debhelpers need fakeroot, we use it for all of them |
23 |
| -find_program( FAKEROOT fakeroot ) |
24 |
| -if( NOT FAKEROOT ) |
25 |
| - message( SEND_ERROR "fakeroot not found, please install" ) |
26 |
| -endif() |
27 |
| - |
28 |
| -find_program( DEBHELPER dh_prep ) |
29 |
| -if( NOT DEBHELPER ) |
30 |
| - message( SEND_ERROR "debhelper not found, please install" ) |
31 |
| -endif() |
32 |
| - |
33 |
| -# Compose a string with a semicolon-seperated list of debhelpers |
34 |
| -foreach( _DH ${DH_RUN} ) |
35 |
| - set( _DH_RUN_SC_LIST "${_DH_RUN_SC_LIST} ${_DH} ;" ) |
36 |
| -endforeach() |
37 |
| - |
38 |
| -# Making sure the debhelpers run each time we change one of ${DH_INPUT} |
39 |
| -add_custom_command( |
40 |
| - OUTPUT dhtimestamp |
41 |
| - |
42 |
| - # dh_prep is needed to clean up, dh_* aren't idempotent |
43 |
| - COMMAND ${FAKEROOT} dh_prep |
44 |
| - |
45 |
| - # I haven't found another way to run a list of commands here |
46 |
| - COMMAND ${FAKEROOT} -- sh -c "${_DH_RUN_SC_LIST}" |
47 |
| - |
48 |
| - # needed to create the files we'll use |
49 |
| - COMMAND ${FAKEROOT} dh_installdeb |
50 |
| - |
51 |
| - COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/dhtimestamp |
52 |
| - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. |
53 |
| - DEPENDS ${DH_INPUT} |
54 |
| - COMMENT "Running debhelpers" |
55 |
| - VERBATIM |
56 |
| -) |
57 |
| - |
58 |
| -add_custom_target( dhtarget ALL |
59 |
| - DEPENDS dhtimestamp |
60 |
| -) |
61 |
| - |
62 |
| -# these files are generated by debhelpers from our templates |
63 |
| -foreach( _F ${DH_GENERATED_CONTROL_EXTRA} ) |
64 |
| - set( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA |
65 |
| - ${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA} |
66 |
| - ${CMAKE_CURRENT_BINARY_DIR}/${CPACK_DEBIAN_PACKAGE_NAME}/DEBIAN/${_F} |
67 |
| - CACHE INTERNAL "" |
68 |
| - ) |
69 |
| -endforeach() |
70 |
| - |
71 |
| -# This will copy the generated dhhelper-files to our to-be-cpacked-directory. |
72 |
| -# CPACK_INSTALL_SCRIPT must be set to the value of CPACK_DEBIAN_INSTALL_SCRIPT in the file |
73 |
| -# pointed to by CPACK_PROJECT_CONFIG_FILE. |
74 |
| -set( CPACK_DEBIAN_INSTALL_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CMakeDebHelperInstall.cmake CACHE INTERNAL "" ) |
0 commit comments