Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 1 | # Copyright (c) 2019 Cisco and/or its affiliates. |
| 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain a copy of the License at: |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 8 | # Unless required by applicable law or agreed to in writing, software |
| 9 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
| 14 | get_cmake_property(VPP_COMPONENTS COMPONENTS) |
| 15 | string(REPLACE ";" " " VPP_COMPONENTS "${VPP_COMPONENTS}") |
| 16 | |
| 17 | execute_process( |
| 18 | COMMAND date -R |
| 19 | OUTPUT_VARIABLE TIMESTAMP |
| 20 | OUTPUT_STRIP_TRAILING_WHITESPACE |
| 21 | ) |
| 22 | |
| 23 | foreach(f rules changelog) |
| 24 | configure_file( |
| 25 | ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f}.in |
| 26 | ${CMAKE_BINARY_DIR}/debian/${f} |
| 27 | ) |
| 28 | endforeach() |
| 29 | |
Damjan Marion | 72de626 | 2019-01-23 15:58:53 +0100 | [diff] [blame] | 30 | foreach(f control copyright vpp.preinst vpp.postrm vpp.postinst vpp.service) |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 31 | file(COPY |
| 32 | ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f} |
| 33 | DESTINATION ${CMAKE_BINARY_DIR}/debian |
| 34 | ) |
| 35 | endforeach() |
| 36 | |
| 37 | file(WRITE ${CMAKE_BINARY_DIR}/debian/compat "9\n") |
| 38 | |
| 39 | add_custom_target(package-deb |
| 40 | COMMENT "Building .deb packages..." |
| 41 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
| 42 | COMMAND "dpkg-buildpackage" "-us" "-uc" "-b" |
Damjan Marion | 7ec2fe2 | 2019-01-22 09:10:16 +0100 | [diff] [blame] | 43 | USES_TERMINAL |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 44 | ) |