Skip to content

Commit 54bb4c1

Browse files
committed
macros: provide %pgtest_* macros for compatibility
But only for 'postgresql' services (not for SCLs). And also warn appropriately that the macro will be removed. * configure.ac (COMPAT_MACROS): New automake conditional. * lib/rpm/Makefile.inc: Edit the macros file when necessary, and warn the user.
1 parent 80f7167 commit 54bb4c1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ _AX_TEXT_TPL_SUBST([NAME_PACKAGE])
188188
_AX_TEXT_TPL_SUBST([NAME_SERVICE])
189189
_AX_TEXT_TPL_SUBST([NAME_SERVICE_VARNAME])
190190

191+
AC_MSG_CHECKING([whether to install compat %pgtest_* macros])
192+
# This hack shouldn't be removed sooner than once the F27 postgresql is EOL,
193+
# since taht's probably the last Fedora release where %pgtest_* macros were
194+
# used by default.
195+
COMPAT_MACROS=no
196+
test "$NAME_SERVICE" = postgresql && COMPAT_MACROS=yes
197+
AC_MSG_RESULT($COMPAT_MACROS)
198+
AM_CONDITIONAL([COMPAT_MACROS], [test "$COMPAT_MACROS" = yes])
199+
191200
AC_OUTPUT
192201

193202
AC_MSG_NOTICE([Configured the folowing way:

lib/rpm/Makefile.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ EXTRA_DIST += $(rpm_macros_in)
88

99
$(rpm_macros): $(rpm_macros_in) $(text_tpl_deps)
1010
$(text_tpl_gen)
11+
if COMPAT_MACROS
12+
@chmod +w "$@" ; ( \
13+
echo ; \
14+
compat() { echo %$$1 echo "2>&1" WARN: macro $$1 will be removed, use $$2 ";" %$$2 ; } ; \
15+
compat pgtests_init @NAME_SERVICE_VARNAME@_tests_init >> "$@" ; \
16+
compat pgtests_start @NAME_SERVICE_VARNAME@_tests_start >> "$@" ; \
17+
) >> "$@" && chmod -w "$@"
18+
endif

0 commit comments

Comments
 (0)