@@ -62,68 +62,42 @@ postgresql_opt = get_option('postgresql')
62
62
FUZZ_OPT = get_option (' fuzz' )
63
63
TESTS_OPT = get_option (' tests' )
64
64
65
- SRCID_OPT = get_option (' srcid' )
66
-
67
- #### KEA_SRCID value
65
+ #### Programs
68
66
69
- CD_AND_RUN = find_program (f' @TOP_SOURCE_DIR@/cd-and-run.sh' )
67
+ # External programs used only in this file.
68
+ cppcheck = find_program (' cppcheck' , required : false )
69
+ cppcheck_htmlreport = find_program (' cppcheck-htmlreport' , required : false )
70
+ git = find_program (' git' , required : false )
71
+ valgrind = find_program (' valgrind' , required : false )
70
72
71
- # When set 'srcid' option should be the KEA_PKG_VERSION_IN_CONFIGURE and
72
- # KEA_PKG_TYPE_IN_CONFIGURE name pair with
73
- # for KEA_PKG_VERSION_IN_CONFIGURE date and timestamp of the package
74
- # e.g. "isc20230921141113"
75
- # KEA_PKG_TYPE_IN_CONFIGURE type of the package "rpm", "deb" or "apk"
76
- if SRCID_OPT != ''
77
- KEA_SRCID = SRCID_OPT
78
- else
79
- KEA_SRCID = ' tarball'
80
- git = disabler ()
81
- if fs.is_dir(' .git' )
82
- git = find_program (' git' , required : false )
83
- endif
84
- if git.found()
85
- result = run_command (
86
- CD_AND_RUN,
87
- TOP_SOURCE_DIR,
88
- git.full_path(),
89
- ' rev-parse' ,
90
- ' HEAD' ,
91
- check : false ,
92
- )
93
- if result.returncode() == 0
94
- KEA_SRCID = ' git ' + result.stdout().strip()
95
- endif
96
- endif
97
- endif
73
+ AWK = find_program (' gawk' , ' awk' , required : false )
74
+ BISON = find_program (' bison' , version : ' >=3.3.0' , required : false )
75
+ DOXYGEN = find_program (' doxygen' , required : false )
76
+ FLEX = find_program (' flex' , version : ' >=2.6.4' , required : false )
77
+ INSTALL = find_program (' install' , required : true )
78
+ PDFLATEX = find_program (' pdflatex' , required : false )
79
+ PIP_COMPILE = find_program (' pip-compile' , required : false )
80
+ PLANTUML = find_program (' plantuml' , required : false )
81
+ PYTHON = find_program (' python3' , ' python' , required : true )
82
+ SPHINX = find_program (' sphinx-build' , ' sphinx-build-3' , required : false )
83
+ XMLLINT = find_program (' xmllint' , required : false )
98
84
99
- message (f' Set KEA_SRCID to "@KEA_SRCID@"' )
85
+ CD_AND_RUN = find_program (f' @TOP_SOURCE_DIR@/scripts/cd-and-run.sh' )
86
+ ENV = find_program (f' @TOP_SOURCE_DIR@/scripts/env.sh' )
87
+ GRABBER = find_program (f' @TOP_SOURCE_DIR@/scripts/grabber.sh' )
88
+ KEA_MSG_COMPILER = disabler ()
100
89
101
90
#### Configuration Data
102
91
92
+ # 'HAVE_BOTAN_ASIO_STREAM_H': false,
93
+ # 'HAVE_PGSQL_SSL': false,
94
+ # 'USE_STATIC_LINK': false,
103
95
conf_data = configuration_data (
104
96
{
105
- ' EXTENDED_VERSION' : f' "@KEA_SRCID@"' ,
106
- # 'HAVE_AFL': false,
107
- # 'HAVE_BOTAN_ASIO_STREAM_H': false,
108
- # 'HAVE_CREATE_UNIFIED_DIFF': false,
109
- # 'HAVE_GSS_STR_TO_OID': false,
110
- # 'HAVE_MYSQL_GET_OPTION': false,
111
- # 'HAVE_OPTRESET': false,
112
- # 'HAVE_PGSQL_SSL': false,
113
- # 'HAVE_PGSQL_TCP_USER_TIMEOUT': false,
114
- # 'HAVE_SYS_FILIO_H': false,
115
- # 'HAVE_VALGRIND_HEADERS': false,
116
- # 'LIBC_MUSL': false,
117
- # 'PACKAGE': 'kea',
118
- # 'PACKAGE_BUGREPORT': 'kea-dev@lists.isc.org',
97
+ ' PACKAGE' : ' kea' ,
119
98
' PACKAGE_NAME' : ' kea' ,
120
- # 'PACKAGE_STRING': f'kea "@PROJECT_VERSION@"',
121
99
' PACKAGE_VERSION' : PROJECT_VERSION,
122
- ' PACKAGE_VERSION_TYPE' : ' "development"' ,
123
- # 'PREMIUM_EXTENDED_VERSION': '"no"',
124
- # 'USE_STATIC_LINK': false,
125
100
' VERSION' : f' "@PROJECT_VERSION@"' ,
126
- # 'WITH_HEIMDAL': false,
127
101
},
128
102
)
129
103
@@ -157,27 +131,6 @@ else
157
131
endif
158
132
message (f' Detected system "@SYSTEM@".' )
159
133
160
- #### Programs
161
-
162
- # External programs used only in this file.
163
- cppcheck = find_program (' cppcheck' , required : false )
164
- cppcheck_htmlreport = find_program (' cppcheck-htmlreport' , required : false )
165
- valgrind = find_program (' valgrind' , required : false )
166
-
167
- AWK = find_program (' gawk' , ' awk' , required : false )
168
- BISON = find_program (' bison' , version : ' >=3.3.0' , required : false )
169
- DOXYGEN = find_program (' doxygen' , required : false )
170
- FLEX = find_program (' flex' , version : ' >=2.6.4' , required : false )
171
- INSTALL = find_program (' install' , required : true )
172
- PDFLATEX = find_program (' pdflatex' , required : false )
173
- PIP_COMPILE = find_program (' pip-compile' , required : false )
174
- PLANTUML = find_program (' plantuml' , required : false )
175
- PYTHON = find_program (' python3' , ' python' , required : true )
176
- SPHINX = find_program (' sphinx-build' , ' sphinx-build-3' , required : false )
177
- XMLLINT = find_program (' xmllint' , required : false )
178
-
179
- KEA_MSG_COMPILER = disabler ()
180
-
181
134
#### Dependencies
182
135
183
136
boost_dep = dependency (' boost' , version : ' >=1.66' , modules : [' system' ])
@@ -444,6 +397,7 @@ endif
444
397
#### Other checks.
445
398
446
399
if POSTGRESQL_DEP.found()
400
+ # TODO: change to proper check, not version check.
447
401
version = POSTGRESQL_DEP.version()
448
402
conf_data.set(
449
403
' HAVE_PGSQL_TCP_USER_TIMEOUT' ,
@@ -471,6 +425,46 @@ if KRB5_DEP.found() and KRB5_DEP.get_variable('vendor') == 'Heimdal'
471
425
conf_data.set(' WITH_HEIMDAL' , true )
472
426
endif
473
427
428
+ # KEA_PKG_VERSION_IN_CONFIGURE: date and timestamp of the package e.g. "isc20230921141113"
429
+ # KEA_PKG_TYPE_IN_CONFIGURE: type of the package "rpm", "deb" or "apk"
430
+ kea_pkg_type_in_configure = run_command (
431
+ ENV,
432
+ ' KEA_PKG_TYPE_IN_CONFIGURE' ,
433
+ check : true ,
434
+ ).stdout().strip()
435
+ kea_pkg_version_in_configure = run_command (
436
+ ENV,
437
+ ' KEA_PKG_VERSION_IN_CONFIGURE' ,
438
+ check : true ,
439
+ ).stdout().strip()
440
+ if kea_pkg_type_in_configure != '' and kea_pkg_version_in_configure != ''
441
+ extended_version = f' @kea_pkg_version_in_configure@ @kea_pkg_type_in_configure@'
442
+ else
443
+ if fs.is_dir(' .git' ) and git.found()
444
+ result = run_command (
445
+ CD_AND_RUN,
446
+ TOP_SOURCE_DIR,
447
+ git,
448
+ ' rev-parse' ,
449
+ ' HEAD' ,
450
+ check : false ,
451
+ )
452
+ if result.returncode() == 0
453
+ extended_version = ' git ' + result.stdout().strip()
454
+ endif
455
+ else
456
+ extended_version = ' tarball'
457
+ endif
458
+ endif
459
+ conf_data.set(' EXTENDED_VERSION' , f' "@PROJECT_VERSION@ (@extended_version@)"' )
460
+
461
+ if PROJECT_VERSION.split(' .' )[1 ].to_int() % 2 == 0
462
+ package_version_type = ' stable'
463
+ else
464
+ package_version_type = ' stable'
465
+ endif
466
+ conf_data.set(' PACKAGE_VERSION_TYPE' , f' "@package_version_type@"' )
467
+
474
468
#### System-specific Compiler Flags
475
469
476
470
compile_args = []
@@ -493,7 +487,7 @@ endif
493
487
premium = fs.is_dir(' premium' )
494
488
if premium
495
489
conf_data.set(' PREMIUM' , ' yes' )
496
- conf_data.set(' PREMIUM_EXTENDED_VERSION' , f' "yes (@KEA_SRCID @)"' )
490
+ conf_data.set(' PREMIUM_EXTENDED_VERSION' , f' "yes (@extended_version @)"' )
497
491
else
498
492
conf_data.set(' PREMIUM' , ' no' )
499
493
conf_data.set(' PREMIUM_EXTENDED_VERSION' , ' "no"' )
@@ -515,8 +509,8 @@ report_conf_data.merge_from(conf_data)
515
509
report_conf_data.set(' TOP_BUILD_DIR' , TOP_BUILD_DIR)
516
510
report_conf_data.set(' PACKAGE_NAME' , ' kea' )
517
511
report_conf_data.set(' PACKAGE_VERSION' , PROJECT_VERSION)
518
- report_conf_data.set(' EXTENDED_VERSION ' , f ' @PROJECT_VERSION@ (@KEA_SRCID@) ' )
519
- report_conf_data.set(' PACKAGE_VERSION_TYPE ' , ' development ' )
512
+ report_conf_data.set(' PACKAGE_VERSION_TYPE ' , package_version_type )
513
+ report_conf_data.set(' EXTENDED_VERSION ' , f ' @PROJECT_VERSION@ (@extended_version@) ' )
520
514
report_conf_data.set(' OS_TYPE' , OS_TYPE)
521
515
report_conf_data.set(' PREFIX' , PREFIX)
522
516
report_conf_data.set(' HOOKS_DIR' , DEFAULT_HOOKS_PATH)
0 commit comments