Browse Source

Use leagacy mode for shellfu-sh-coerce also for RHEL-7

Turns out perl-Term-ANSIColor is only available since RHEL-8.
Alois Mahdal 4 years ago
parent
commit
dcdcd52728
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      packaging/template.spec

+ 8
- 4
packaging/template.spec View File

1
 %if ( 0%{?rhel} && 0%{?rhel} < 7 ) || ( 0%{?centos} && 0%{?centos} < 7 )
1
 %if ( 0%{?rhel} && 0%{?rhel} < 7 ) || ( 0%{?centos} && 0%{?centos} < 7 )
2
 %global pspkg procps
2
 %global pspkg procps
3
-%global legacy true
4
 %else
3
 %else
5
 %global pspkg procps-ng
4
 %global pspkg procps-ng
6
-%global legacy false
5
+%endif
6
+
7
+%if ( 0%{?rhel} && 0%{?rhel} < 8 ) || ( 0%{?centos} && 0%{?centos} < 8 )
8
+%global legacy_coerce true
9
+%else
10
+%global legacy_coerce false
7
 %endif
11
 %endif
8
 
12
 
9
 Name:           __MKIT_PROJ_PKGNAME__
13
 Name:           __MKIT_PROJ_PKGNAME__
111
 %package sh-coerce
115
 %package sh-coerce
112
 Summary: Shellfu/sh module with data coercion helpers
116
 Summary: Shellfu/sh module with data coercion helpers
113
 Requires: perl
117
 Requires: perl
114
-%if %{legacy} == "false"
118
+%if %{legacy_coerce} == "false"
115
 Requires: perl-Term-ANSIColor
119
 Requires: perl-Term-ANSIColor
116
 %endif
120
 %endif
117
 Requires: shellfu-sh
121
 Requires: shellfu-sh
151
 
155
 
152
 %prep
156
 %prep
153
 %setup -q
157
 %setup -q
154
-/bin/sed -i '/^__COERCE__LEGACY=/s/:-false/:-%{legacy}/' ./src/include-sh/coerce.sh
158
+/bin/sed -i '/^__COERCE__LEGACY=/s/:-false/:-%{legacy_coerce}/' ./src/include-sh/coerce.sh
155
 
159
 
156
 
160
 
157
 %build
161
 %build