summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/gnupg/drop-unknown-suffix.inc
blob: dc8f31869c7ca8333fb593db094c0d60cac5b202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#

#
# This .inc file is used to remove unknown suffix in runtime version
# for gnupg and its related packages.
#
# In these packages, if autogen.sh is run outside of a git repo,
# the find-version function always assumes that the package is a
# beta version and adds the suffix '-unknown' to the version number.
#
# This .inc file modifies autogen.sh to:
# 1. Replace beta=yes with beta=no
# 2. Replace tmp="-unknown" with tmp=""
#

do_configure:prepend() {
    if [ -f ${S}/autogen.sh ]; then
        sed -i \
            -e 's/^\([[:space:]]*\)beta=yes$/\1beta=no/' \
            -e 's/^\([[:space:]]*\)tmp="-unknown"$/\1tmp=""/' \
            ${S}/autogen.sh
    else
        bbwarn "autogen.sh not found in ${S}."
    fi
}