forked from ClusterLabs/pcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
540 lines (467 loc) · 17.5 KB
/
configure.ac
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([pcs],
m4_esyscmd([make/git-version-gen .tarball-version .gitarchivever]),
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([dist-bzip2 dist-xz -Wno-portability tar-pax])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([setup.py.in])
AC_CANONICAL_HOST
AC_LANG([C])
# Sanitize path
if test "$prefix" = "NONE"; then
prefix="/usr"
if test "$localstatedir" = "\${prefix}/var"; then
localstatedir="/var"
fi
if test "$sysconfdir" = "\${prefix}/etc"; then
sysconfdir="/etc"
fi
if test "$libdir" = "\${exec_prefix}/lib"; then
if test -e /usr/lib64; then
libdir="/usr/lib64"
else
libdir="/usr/lib"
fi
fi
fi
case $exec_prefix in
NONE) exec_prefix=$prefix;;
prefix) exec_prefix=$prefix;;
esac
# need to expand a bunch of paths to make sure
# the embedded values in files are absolute paths
eval SBINDIR="`eval echo ${sbindir}`"
AC_SUBST([SBINDIR])
eval LOCALSTATEDIR="`eval echo ${localstatedir}`"
AC_SUBST([LOCALSTATEDIR])
eval LIBDIR="`eval echo ${libdir}`"
# Checks for programs.
# check stolen from gnulib/m4/gnu-make.m4
if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
AC_MSG_ERROR([you don't seem to have GNU make; it is required])
fi
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_AWK
AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG
# check for python
AM_PATH_PYTHON([3.9])
eval PYTHON_SITELIB="`eval echo ${pythondir}`"
AC_SUBST([PYTHON_SITELIB])
# required to detect / install python modules
if ! $PYTHON -m pip > /dev/null 2>&1; then
AC_MSG_ERROR([Python module pip not found])
fi
PIP="$PYTHON -m pip"
AC_SUBST([PIP])
# use a wrapper to call into PKG_CHECK_VAR to allow to set a default
AC_DEFUN([PCS_PKG_CHECK_VAR], [
varname=$1
default=$4
AC_MSG_CHECKING([for pkg-conf $2 var $3])
PKG_CHECK_VAR([$1], [$2], [$3])
AS_VAR_IF([$1], [""],
[AS_VAR_IF([default], [""],
AC_MSG_ERROR([not found]),
[AS_VAR_COPY([$varname], [default]) && AC_MSG_RESULT([not found, using default ${!varname}])])],
[AC_MSG_RESULT([yes (detected: ${!varname})])])
])
# check for systemd
PKG_CHECK_MODULES([systemd], [systemd])
PCS_PKG_CHECK_VAR([SYSTEMD_UNIT_DIR_TMP], [systemd], [systemdsystemunitdir], [/usr/lib/systemd/system])
if test "${prefix}" != "/usr"; then
SYSTEMD_UNIT_DIR="${prefix}/$SYSTEMD_UNIT_DIR_TMP"
else
SYSTEMD_UNIT_DIR="$SYSTEMD_UNIT_DIR_TMP"
fi
AC_SUBST([SYSTEMD_UNIT_DIR])
PCS_PKG_CHECK_VAR([SYSTEMD_UNIT_PATH], [systemd], [systemdsystemunitpath],
[/etc/systemd/system:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:/usr/lib/systemd/system:/usr/lib/systemd/system:/lib/systemd/system])
AC_SUBST([SYSTEMD_UNIT_PATH])
# check for ruby
AC_PATH_PROG([RUBY], [ruby])
if test x$RUBY = x; then
AC_MSG_ERROR([Unable to find ruby binary])
fi
# opensuse has a versioned ruby-$version.pc file
# that does not match fedora or rhel ruby.pc
# so we need to detect it
rubymod=`pkg-config --list-all | awk '{print $1}' | grep ^ruby | sort -n | tail -n 1`
PKG_CHECK_MODULES([ruby], [$rubymod >= 2.5])
PCS_PKG_CHECK_VAR([RUBY_VER], [$rubymod], [ruby_version])
AC_CHECK_PROGS([GEM], [gem])
if test "x$GEM" = "x"; then
AC_MSG_ERROR([Unable to find gem binary])
fi
# used to measure time for some tests, not critical if not available
AC_CHECK_PROGS([TIME], [time])
# required to build rpm and pyagentx
AC_CHECK_PROGS([TAR], [tar])
if test "x$TAR" = "x"; then
AC_MSG_ERROR([Unable to find tar binary.])
fi
# configure options section
AC_ARG_ENABLE([dev-tests],
[AS_HELP_STRING([--enable-dev-tests], [Enable extra developers tests (black, mypy, pylint) (default: no)])],
[dev_tests="yes"])
AM_CONDITIONAL([DEV_TESTS], [test "x$dev_tests" = "xyes"])
AC_ARG_ENABLE([destructive-tests],
[AS_HELP_STRING([--enable-destructive-tests], [Automatically execute potentially dangerous tests when running make check (default: no)])],
[destructive_tests="yes"])
AM_CONDITIONAL([EXECUTE_TIER1_TESTS], [test "x$destructive_tests" = "xyes"])
AC_ARG_ENABLE([concise-tests],
[AS_HELP_STRING([--enable-concise-tests], [Make tests output brief by not printing a name of each test (default: no)])],
[concise_tests="yes"])
AM_CONDITIONAL([CONCISE_TESTS], [test "x$concise_tests" = "xyes"])
AC_ARG_ENABLE([parallel-tests],
[AS_HELP_STRING([--enable-parallel-tests], [Python parallel testing requires pip modules that are not packaged anywhere (default: no)])],
[parallel_tests="yes"])
AM_CONDITIONAL([PARALLEL_TESTS], [test "x$parallel_tests" = "xyes"])
AC_ARG_ENABLE([parallel-pylint],
[AS_HELP_STRING([--enable-parallel-pylint], [Enable running pylint in multiple threads (default: no)])],
[parallel_pylint="yes"])
AM_CONDITIONAL([PARALLEL_PYLINT], [test "x$parallel_pylint" = "xyes"])
AC_ARG_ENABLE([local-build],
[AS_HELP_STRING([--enable-local-build], [Download and install all dependencies as user / bundles])],
[local_build="yes"])
AM_CONDITIONAL([LOCAL_BUILD], [test "x$local_build" = "xyes"])
AC_ARG_ENABLE([tests-only],
[AS_HELP_STRING([--enable-tests-only], [Check only for tests dependencies])],
[tests_only="yes"])
AC_ARG_ENABLE([individual-bundling],
[AS_HELP_STRING([--enable-individual-bundling], [Bundle only missing python packages /ruby gems instead of all of them])],
[individual_bundling="yes"])
AC_ARG_ENABLE([use-local-cache-only],
[AS_HELP_STRING([--enable-use-local-cache-only], [Use only local cache to build bundles and disable downloads])],
[cache_only="yes"])
# this will catch both ID and ID_LIKE from os-release
AC_ARG_WITH([distro],
[AS_HELP_STRING([--with-distro=DIR], [Set defaults to specified distro. Default: autodetected])],
[DISTRO="$withval"])
if test "x$cache_only" != "xyes"; then
AC_CHECK_PROGS([WGET], [wget])
if test "x$WGET" = "x"; then
AC_MSG_ERROR([Unable to find wget binary.])
fi
fi
if test "x$DISTRO" = "x"; then
AC_MSG_CHECKING([linux distribution])
if test -f /etc/os-release; then
DISTRO=$(cat /etc/os-release | grep ^ID= | cut -d "=" -f 2 | sed -s 's#"##g')
if test "x$DISTRO" = "x"; then
AC_MSG_ERROR([Unable to detect linux distribution. Please specify --with-distro=])
fi
DISTROS=$(cat /etc/os-release | grep ^ID_LIKE= | cut -d "=" -f 2 | sed -s 's#"##g')
fi
AC_MSG_RESULT([$DISTRO])
else
AC_MSG_RESULT([Distro detection disabled. Setting forced to: $DISTRO])
fi
AC_MSG_CHECKING([default settings for $DISTRO $DISTROS])
for i in $DISTRO $DISTROS; do
case $i in
debian|ubuntu)
FOUND_DISTRO=1
CONFIGDIR="$sysconfdir/default"
PCSLIBDIR="$prefix/share"
PCMKDAEMONDIR="$prefix/lib/pacemaker"
COROSYNCLOGDIR="$localstatedir/log/corosync"
DISTROEXT=debian
break
;;
fedora|rhel|centos|opensuse*)
FOUND_DISTRO=1
CONFIGDIR="$sysconfdir/sysconfig"
PCSLIBDIR="$LIBDIR"
PCMKDAEMONDIR="$prefix/libexec/pacemaker"
COROSYNCLOGDIR="$localstatedir/log/cluster"
DISTROEXT=fedora
break
;;
esac
done
if test "x$FOUND_DISTRO" = "x"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Unknown distribution $DISTRO. Please contact pcs upstream project to add support, or check --with-distro= value])
else
AC_MSG_RESULT([$i (or alike) default settings will be used])
fi
AC_SUBST([DISTROEXT])
AC_ARG_WITH([default-config-dir],
[AS_HELP_STRING([--with-default-config-dir=DIR], [pcs config directory. Default: autodetected])],
[CONF_DIR="$withval"],
[CONF_DIR="$CONFIGDIR"])
AC_SUBST([CONF_DIR])
AC_ARG_WITH([pcs-lib-dir],
[AS_HELP_STRING([--with-pcs-lib-dir=DIR], [pcs lib directory. Default: autodetected])],
[LIB_DIR="$withval"],
[LIB_DIR="$PCSLIBDIR"])
AC_SUBST([LIB_DIR])
AC_ARG_WITH([snmp-mibs-dir],
[AS_HELP_STRING([--with-snmp-mibs-dir=DIR], [snmp MIB directory. Default: $prefix/share/snmp/mibs])],
[SNMP_MIB_DIR="$withval"],
[SNMP_MIB_DIR="$prefix/share/snmp/mibs"])
AC_SUBST([SNMP_MIB_DIR])
# python detection section
PCS_BUNDLED_DIR_LOCAL="pcs_bundled"
AC_SUBST([PCS_BUNDLED_DIR_LOCAL])
PCS_BUNDLED_DIR="$LIB_DIR/pcs/$PCS_BUNDLED_DIR_LOCAL"
AC_SUBST([PCS_BUNDLED_DIR])
mkdir -p $ac_pwd/stamps
mkdir -p $ac_pwd/rpm/
rm -rf $ac_pwd/rpm/requirements.txt
touch $ac_pwd/rpm/requirements.txt
# PCS_BUNDLE_PYMOD([module], [version])
AC_DEFUN([PCS_BUNDLE_PYMOD], [
echo "$1 $2" | sed -e 's# ##g' >> $ac_pwd/rpm/requirements.txt
if test "x$cache_only" = "xyes"; then
src=`ls rpm/$1-*`
if test "x$src" = "x"; then
AC_MSG_ERROR([cache only build required but no source detected in rpm/])
fi
fi
])
# PCS_CHECK_PYMOD([module], [version], [embedded=yes])
AC_DEFUN([PCS_CHECK_PYMOD], [
if test "x$local_build" = "xyes" && test "x$3" = "xyes"; then
AC_PIP_MODULE([$1], [$2], [bundle_module=no], [bundle_module=yes], [bundle_module=yes])
if test "x$bundle_module" = "xyes" || test "x$individual_bundling" != "xyes"; then
PCS_BUNDLE_PYMOD([$1], [$2])
fi
else
AC_PIP_MODULE([$1], [$2], [], [AC_MSG_ERROR([Python module $1 not found])])
fi
])
# required by rpm build
PYAGENTX_VERSION=0.4.pcs.2
AC_SUBST([PYAGENTX_VERSION])
# those MUST be available in BaseOS
# required for --no-build-isolation
AC_PIP_MODULE([pip], [>= 10.0.0], [have_isolation=yes], [have_isolation=no], [have_isolation=no])
AM_CONDITIONAL([PIP_HAS_ISOLATION], [test "x$have_isolation" = xyes])
if test "x$tests_only" != "xyes"; then
PCS_CHECK_PYMOD([setuptools])
PCS_CHECK_PYMOD([setuptools-scm])
if test "x$local_build" = "xyes"; then
PCS_CHECK_PYMOD([wheel])
fi
PCS_CHECK_PYMOD([cryptography])
PCS_CHECK_PYMOD([lxml])
PCS_CHECK_PYMOD([pycurl])
PCS_CHECK_PYMOD([pyparsing])
# those are kind of problematic.
# use them all from the BaseOS or embedded them all as necessary (--enable-local-build)
PCS_CHECK_PYMOD([dacite], [], [yes])
PCS_CHECK_PYMOD([tornado], [>= 6.0.0], [yes])
PCS_CHECK_PYMOD([python-dateutil], [>= 2.7.0], [yes])
# special case, because we need to download from github
AC_PIP_MODULE([pyagentx])
if test "x$HAVE_PIPMOD_PYAGENTX" = "xno" && test "x$local_build" != "xyes"; then
AC_MSG_ERROR([Python module pyagentx not found])
fi
fi
# ruby gem section
PCSD_BUNDLED_DIR_ROOT_LOCAL="pcsd/vendor/bundle/"
PCSD_BUNDLED_DIR_LOCAL="$PCSD_BUNDLED_DIR_ROOT_LOCAL/ruby/$RUBY_VER/"
PCSD_BUNDLED_CACHE_DIR="$PCSD_BUNDLED_DIR_ROOT_LOCAL/cache"
AC_SUBST([PCSD_BUNDLED_DIR_ROOT_LOCAL])
AC_SUBST([PCSD_BUNDLED_DIR_LOCAL])
AC_SUBST([PCSD_BUNDLED_CACHE_DIR])
rm -rf Gemfile Gemfile.lock
echo "source 'https://rubygems.org'" > Gemfile
echo "" >> Gemfile
# PCS_BUNDLE_GEM([module])
AC_DEFUN([PCS_BUNDLE_GEM], [
echo "gem '$1'" >> Gemfile
if test "x$cache_only" = "xyes"; then
src=`ls $PCSD_BUNDLED_CACHE_DIR/$1-*`
if test "x$src" = "x"; then
AC_MSG_ERROR([cache only build required but no source detected in $PCSD_BUNDLED_CACHE_DIR])
fi
fi
])
# PCS_CHECK_GEM([module], [version])
AC_DEFUN([PCS_CHECK_GEM], [
if test "x$local_build" = "xyes"; then
AC_RUBY_GEM([$1], [$2], [], [PCS_BUNDLE_GEM([$1])])
else
AC_RUBY_GEM([$1], [$2], [], [AC_MSG_ERROR([ruby gem $1 not found])])
fi
])
PCS_CHECK_GEM([power_assert])
PCS_CHECK_GEM([test-unit])
if test "x$tests_only" != "xyes"; then
PCS_CHECK_GEM([backports])
PCS_CHECK_GEM([daemons])
PCS_CHECK_GEM([ethon])
PCS_CHECK_GEM([ffi])
PCS_CHECK_GEM([eventmachine])
PCS_CHECK_GEM([json])
PCS_CHECK_GEM([mustermann])
PCS_CHECK_GEM([open4])
PCS_CHECK_GEM([rack])
PCS_CHECK_GEM([rack-protection])
PCS_CHECK_GEM([rack-test])
PCS_CHECK_GEM([sinatra])
PCS_CHECK_GEM([tilt])
PCS_CHECK_GEM([thin])
PCS_CHECK_GEM([rexml])
PCS_CHECK_GEM([webrick])
fi
if test "x$local_build" = "xyes" && test $(wc -l < Gemfile) -gt 2; then
GEM_HOME="$LIB_DIR/$PCSD_BUNDLED_DIR_ROOT_LOCAL"
SYSTEMD_GEM_HOME="Environment=GEM_HOME=$GEM_HOME"
if test "x$cache_only" != "xyes"; then
AC_CHECK_PROGS([BUNDLE], [bundle])
if test "x$BUNDLE" = "x"; then
AC_MSG_ERROR([Unable to find bundle binary required to install missing ruby gems])
fi
fi
fi
AC_SUBST([BUNDLE])
AC_SUBST([GEM])
AC_SUBST([GEM_HOME])
AC_SUBST([SYSTEMD_GEM_HOME])
AM_CONDITIONAL([INSTALL_EMBEDDED_GEMS], [test -n "$GEM_HOME"])
AM_CONDITIONAL([ENABLE_DOWNLOAD], [test "x$cache_only" != "xyes"])
# detect different paths required to generate default settings
AC_PATH_PROG([BASH], [bash])
if test "x$BASH" = "x"; then
AC_MSG_ERROR([Unable to find bash in $PATH])
fi
AC_PATH_PROG([SYSTEMCTL], [systemctl])
if test "x$SYSTEMCTL" = "x"; then
AC_PATH_PROG([SERVICE], [service])
if test "x$SERVICE" = "x"; then
AC_MSG_ERROR([Unable to find systemctl or service in $PATH])
fi
fi
if test "x$tests_only" != "xyes"; then
AC_PATH_PROG([KILLALL], [killall])
if test "x$KILLALL" = "x"; then
AC_MSG_ERROR([Unable to find killall in $PATH])
fi
fi
# yes this is absurd but we need full path for some
# python calls
AC_PATH_PROG([RM], [rm])
if test "x$RM" = "x"; then
AC_MSG_ERROR([Unable to find rm in $PATH])
fi
AC_PATH_PROG([FIND], [find])
if test "x$FIND" = "x"; then
AC_MSG_ERROR([Unable to find find in $PATH])
fi
# NOTE: some of those pacemaker var are only available
# in pacemaker.pc with pacemaker >= 2.0.5
PCS_PKG_CHECK_VAR([PCMK_USER], [pacemaker], [daemon_user], [hacluster])
PCS_PKG_CHECK_VAR([PCMK_GROUP], [pacemaker], [daemon_group], [haclient])
PCS_PKG_CHECK_VAR([PCMK_DAEMON_DIR], [pacemaker], [daemondir], [$PCMKDAEMONDIR])
PCS_PKG_CHECK_VAR([PCMKEXECPREFIX], [pacemaker], [exec_prefix], [/usr])
PCS_PKG_CHECK_VAR([PCMKPREFIX], [pacemaker], [prefix], [/usr])
if test "$PCMKPREFIX" = "/usr"; then
PCMKCONFDIR="/etc"
PCMKLOCALSTATEDIR="/var"
else
PCMKCONFDIR="$PCMKPREFIX/etc"
PCMKLOCALSTATEDIR="$PCMKPREFIX/var"
fi
AC_SUBST([PCMKCONFDIR])
AC_SUBST([PCMKLOCALSTATEDIR])
PCS_PKG_CHECK_VAR([PCMK_CIB_DIR], [pacemaker], [configdir], [/var/lib/pacemaker/cib])
PCS_PKG_CHECK_VAR([PCMK_SCHEMA_DIR], [pacemaker], [schemadir], [/usr/share/pacemaker])
PCS_PKG_CHECK_VAR([COROEXECPREFIX], [corosync], [exec_prefix], [/usr])
PCS_PKG_CHECK_VAR([COROPREFIX], [corosync], [prefix], [/usr])
if test "$COROPREFIX" = "/usr"; then
COROCONFDIR="/etc"
else
COROCONFDIR="$COROPREFIX/etc"
fi
AC_SUBST([COROCONFDIR])
eval COROSYNCLOGDIR="`eval echo ${COROSYNCLOGDIR}`"
PCS_PKG_CHECK_VAR([COROLOGDIR], [corosync], [logdir], [$COROSYNCLOGDIR])
PCS_PKG_CHECK_VAR([COROQDEVEXECPREFIX], [corosync-qdevice], [exec_prefix], [/usr])
PCS_PKG_CHECK_VAR([COROQDEVCONFDIR], [corosync-qdevice], [confdir], [/etc/corosync])
PCS_PKG_CHECK_VAR([SBDCONFDIR], [sbd], [confdir], [$CONFIGDIR])
PCS_PKG_CHECK_VAR([SBDEXECPREFIX], [sbd], [exec_prefix], [/usr])
PCS_PKG_CHECK_VAR([FASEXECPREFIX], [fence-agents], [exec_prefix], [/usr])
PCS_PKG_CHECK_VAR([RA_API_DTD], [resource-agents], [ra_api_dtd], [/usr/share/resource-agents/ra-api-1.dtd])
PCS_PKG_CHECK_VAR([RA_TMP_DIR], [resource-agents], [ra_tmp_dir], [/run/resource-agents])
PCS_PKG_CHECK_VAR([BOOTHCONFDIR], [booth], [confdir], [/etc/booth])
PCS_PKG_CHECK_VAR([BOOTHEXECPREFIX], [booth], [exec_prefix], [/usr])
# required for man page and spec file generation
AX_PROG_DATE
AS_IF([test "$ax_cv_prog_date_gnu_date:$ax_cv_prog_date_gnu_utc" = yes:yes],
[UTC_DATE_AT="date -u -d@"],
[AS_IF([test "x$ax_cv_prog_date_bsd_date" = xyes],
[UTC_DATE_AT="date -u -r"],
[AC_MSG_ERROR([date utility unable to convert epoch to UTC])])])
AC_SUBST([UTC_DATE_AT])
AC_ARG_VAR([SOURCE_EPOCH],[last modification date of the source])
AC_MSG_NOTICE([trying to determine source epoch])
AC_MSG_CHECKING([for source epoch in \$SOURCE_EPOCH])
AS_IF([test -n "$SOURCE_EPOCH"],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([for source epoch in source_epoch file])
AS_IF([test -e "$srcdir/source_epoch"],
[read SOURCE_EPOCH <"$srcdir/source_epoch"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([for source epoch baked in by gitattributes export-subst])
SOURCE_EPOCH='$Format:%at$' # template for rewriting by git-archive
AS_CASE([$SOURCE_EPOCH],
[?Format:*], # was not rewritten
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([for source epoch in \$SOURCE_DATE_EPOCH])
AS_IF([test "x$SOURCE_DATE_EPOCH" != x],
[SOURCE_EPOCH="$SOURCE_DATE_EPOCH"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([whether git log can provide a source epoch])
SOURCE_EPOCH=f${SOURCE_EPOCH#\$F} # convert into git log --pretty format
SOURCE_EPOCH=$(cd "$srcdir" && git log -1 --pretty=${SOURCE_EPOCH%$} 2>/dev/null)
AS_IF([test -n "$SOURCE_EPOCH"],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no, using current time and breaking reproducibility])
SOURCE_EPOCH=$(date +%s)])])],
[AC_MSG_RESULT([yes])]
)])
])
AC_MSG_NOTICE([using source epoch $($UTC_DATE_AT$SOURCE_EPOCH +'%F')])
UTC_DATE=$($UTC_DATE_AT$SOURCE_EPOCH +'%F')
AC_SUBST([UTC_DATE])
AC_CONFIG_FILES([Makefile
setup.py
setup.cfg
data/Makefile
pcs/Makefile
pcs/settings.py
pcs/snmp/pcs_snmp_agent.service
pcs/snmp/settings.py
pcs/snmp/pcs_snmp_agent.8
pcs/pcs.8
pcs_test/Makefile
pcs_test/settings.py
pcsd/Makefile
pcsd/pcsd.8
pcsd/pcsd-cli.rb
pcsd/pcsd-ruby.service
pcsd/pcsd.service
pcsd/settings.rb
pcsd/logrotate/pcsd])
AC_CONFIG_FILES([pcs/pcs], [chmod +x pcs/pcs])
AC_CONFIG_FILES([pcs/pcs_internal], [chmod +x pcs/pcs_internal])
AC_CONFIG_FILES([pcs/snmp/pcs_snmp_agent], [chmod +x pcs/snmp/pcs_snmp_agent])
AC_CONFIG_FILES([pcs_test/smoke.sh], [chmod +x pcs_test/smoke.sh])
AC_CONFIG_FILES([pcs_test/pcs_for_tests], [chmod +x pcs_test/pcs_for_tests])
AC_CONFIG_FILES([pcs_test/suite], [chmod +x pcs_test/suite])
AC_CONFIG_FILES([pcs_test/tools/bin_mock/pcmk/crm_resource], [chmod +x pcs_test/tools/bin_mock/pcmk/crm_resource])
AC_CONFIG_FILES([pcs_test/tools/bin_mock/pcmk/pacemaker-fenced], [chmod +x pcs_test/tools/bin_mock/pcmk/pacemaker-fenced])
AC_CONFIG_FILES([pcsd/pcsd], [chmod +x pcsd/pcsd])
AC_CONFIG_FILES([scripts/pcsd.sh], [chmod +x scripts/pcsd.sh])
AC_OUTPUT