Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Bernhard M. Wiedemann | 3d14f03 | 2019-12-05 16:51:26 +0100 | [diff] [blame] | 2 | : ${VPP_BUILD_USER:=$(whoami)} |
| 3 | : ${VPP_BUILD_HOST:=$(hostname)} |
| 4 | DATE_FMT="+%Y-%m-%dT%H:%M:%S" |
| 5 | SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" |
| 6 | VPP_BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT") |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 7 | |
| 8 | cat > ${1} << __EOF__ |
| 9 | /* |
| 10 | * Copyright (c) 2018 Cisco and/or its affiliates. |
| 11 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 12 | * you may not use this file except in compliance with the License. |
| 13 | * You may obtain a copy of the License at: |
| 14 | * |
| 15 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 16 | * |
| 17 | * Unless required by applicable law or agreed to in writing, software |
| 18 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 20 | * See the License for the specific language governing permissions and |
| 21 | * limitations under the License. |
| 22 | */ |
| 23 | |
| 24 | #ifndef included_vpp_app_version_h |
| 25 | #define included_vpp_app_version_h |
| 26 | |
Bernhard M. Wiedemann | 3d14f03 | 2019-12-05 16:51:26 +0100 | [diff] [blame] | 27 | #define VPP_BUILD_DATE "$VPP_BUILD_DATE" |
| 28 | #define VPP_BUILD_USER "$VPP_BUILD_USER" |
| 29 | #define VPP_BUILD_HOST "$VPP_BUILD_HOST" |
Damjan Marion | 6077c97 | 2019-01-28 17:55:59 +0100 | [diff] [blame] | 30 | #define VPP_BUILD_TOPDIR "$(git rev-parse --show-toplevel 2> /dev/null)" |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 31 | #define VPP_BUILD_VER "$(scripts/version)" |
| 32 | #endif |
| 33 | __EOF__ |