forked from openxpki/openxpki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.VERSION_DEFINITION
185 lines (162 loc) · 6.64 KB
/
.VERSION_DEFINITION
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#
# Written by Martin Bartosch for the OpenXPKI project 2006
# Copyright (c) 2006 by The OpenXPKI Project
#
###########################################################################
# Format definitions. The formats defined here can be used as symbolic
# names for the --format option.
#
[FORMAT_DEFINITIONS]
version: MAJOR.MINOR.RELEASESUFFIX
daily_snapshot: %F-MAJOR.MINOR.RELEASESUFFIX
git_commit: MAJOR.MINOR.RELEASE-GIT_ABBREVIATED_COMMIT_HASH
git_tag: MAJOR.MINOR.GIT_TAG
git_branch: GIT_BRANCH
git_filtered_branch: GIT_FILTERED_BRANCH
git_description: GIT_DESCRIPTION
# Tag list.
#
# List of tags for which a git description should be computed and stored.
# the keys of this section are interpreted as git tag names (shell glob
# style wildcards are ok) and queried via 'git describe --tags --match TAG'.
# If a value is defined, it will be used as the mapped name of the tag,
# otherwise the key name is used as a default.
# The result of this command is available as an internal component via
# 'git-description-MAPPING'.
#
[GIT_REFERENCE_TAGS]
# We expect a tag on the root commit called 'inital' to allow vergen to
# compute the number of commits that happened from that one to the tip of
# the branch. See below (git-revision).
initial: root
# Custom configuration.
#
# Sections that start with an underscore are ignored by vergen. While
# this is usually not very useful, you might wish to take advantage
# of this when using a perl expression in your custom components.
# As an example we use this feature to specify the filter branch name for
# use in our custom component git-filtered-branch (see below).
[_CUSTOM_CONFIG]
branch_filter: master
###########################################################################
# Version number components
# built-in components (component names are 'magic'), but you can modify
# the keyword(s).
# Currently the following magic built-ins are defined:
# 'revision'
# the global SVN revision number
# 'last-changed-revision'
# obtains the highest "Last Changed Rev" below the current
# directory (recursively)
# The following keywords are only expanded if Git is used:
# 'git-commit-hash'
# commit hash
# 'git-abbreviated-commit-hash'
# abbreviated commit hash (hint: git-show-ref -h -s --abbrev HEAD)
# 'git-tag'
# tag name of the current checkout (empty string if no tag is defined,
# if more than one tags are set for the current head then only the first
# tag is reported)
# 'git-tags'
# identical to git-tag; if more than one tag is set for the current
# checkout all tags are listed (comma separated)
# 'git-description'
# result of git describe --tags
# 'git-description-XXXX'
# see above (GIT_REFRENCE_TAGS section)
#[revision]
#keyword: SVN_REVISION
#[last-changed-revision]
#keyword: SVN_LAST_CHANGED_REVISION
[git-commit-hash]
keyword: GIT_COMMIT_HASH
[git-commit-date]
keyword: GIT_COMMIT_DATE
[git-abbreviated-commit-hash]
keyword: GIT_ABBREVIATED_COMMIT_HASH
[git-tag]
keyword: GIT_TAG
optional: yes
[git-tags]
keyword: GIT_TAGS
optional: yes
[git-branch]
keyword: GIT_BRANCH
optional: no
[git-description]
keyword: GIT_DESCRIPTION
optional: no
# Custom components
# To create a custom version number component define the following keys:
# filename: File name to use. vergen searches upwards from the
# current directory until it finds the specified file.
# The file contents will be assigned as the component
# value.
# expression: Perl expression to evaluate when expanding the keyword.
# Mutually exclusive with filename.
# keyword: Symbolic name(s) describing the version component that
# can be used to reference its value.
# More than one keyword can be used for aliasing the
# component. Only the first keyword defined is used
# for --dump, though.
# optional: If set to 'yes' or 'true', this component is not mandatory
[major]
filename: .VERSION_MAJOR
keyword: MAJOR
[minor]
filename: .VERSION_MINOR
keyword: MINOR
[release]
filename: .VERSION_RELEASE
keyword: RELEASE
[suffix]
filename: .VERSION_SUFFIX
keyword: SUFFIX
optional: yes
#[git-revision]
# the following expression returns the number of git commits between the
# tag 'initial' (which is expected to exist on the root commit of the
# repository) and the current head. if executed on a clean git-svn branch
# this returns one less that the subversion revision number (hence we increment
# the returned number to compensate).
# note that this only works on a clean git-svn branch, it will report a
# different commit count on forked branches, dependin on what happened
# on this branch. if you use this number (e. g. in a package build) it is
# highly recommended to also include the branch name to indicate on which
# branch this number was computed.
#expression: sub {
#: my $rev = $revision_info->{'git-description-root'};
#: my ($count) = ($rev =~ m{ -(\d+)-g[\da-f]+ \z }xms);
#: return $count + 1;
#: }
#keyword: GIT_REVISION
#optional: no
[git-filtered-branch]
# The following expression returns the 'filtered' current git branch name.
# if the branch name matches the value configured in section _CUSTOM_CONFIG,
# key 'branch_filter' the value is empty, otherwise the current
# branch name is returned. Special characters that might cause problem
# in file names are replaced by underscore characters.
# This keyword is intended to be used in package descriptions, describing
# the "flavour" of the package. The idea is to define a default branch
# (e. g. master) which is replaced with the empty string. When building
# a package from this branch the resulting package name is the base name.
# When building from a different branch, the filtered branch name could
# be part of the package description, helping people to distinguish
# the customized package from an upstream one.
expression: sub {
: my $branch = $revision_info->{'git-branch'};
: if ($branch ne $config{'_CUSTOM_CONFIG'}->{'branch_filter'}) {
: $branch =~ tr/a-zA-Z0-9@\-\.,/_/c;
: return $branch;
: } else {
: return '';
: } }
keyword: GIT_FILTERED_BRANCH
optional: no
# pkgrel is the package release number (synonymous with the release of an
# RPM pkg)
[pkgrel]
filename: .VERSION_PKGREL
keyword: PKGREL
optional: yes