Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2 does not build on centos 7 #40

Closed
bugfood opened this issue Apr 11, 2021 · 3 comments
Closed

2.2 does not build on centos 7 #40

bugfood opened this issue Apr 11, 2021 · 3 comments
Labels

Comments

@bugfood
Copy link
Contributor

bugfood commented Apr 11, 2021

I get the error:

/usr/bin/install: cannot stat '/home/chickey/rpm-haproxy/rpmbuild/SOURCES/haproxy.syslog.el7.centos': No such file or directory

This is because:

%if 0%{?rhel} > 6 && 0%{!?amzn2}
    %define dist %{expand:%%(/usr/lib/rpm/redhat/dist.sh --dist)}
%endif

and:

Source4: %{name}.syslog%{?dist}

On centos 7, %{dist} is .el7.centos.

$ cat /etc/rpm/macros.dist 
# dist macros.

%centos_ver 7
%centos 7
%rhel 7
%dist .el7.centos
%el7 1

The code is from: 6e607db

According to my testing, the !? form never seems to expand to anything, at least not without a default, e.g. %{!?amzn2:foo}.

$ rpm --eval '0%{?rhel}' # this is set for me
07
$ rpm --eval '0%{!?rhel}' # this does not expand
0
$ rpm --eval '0%{?amzn2}' # this is not set for me
0
$ rpm --eval '0%{!?amzn2}' # this does not expand either
0

I can't tell what the original intent was, though. Is amzn2 supposed to have dist.sh or not?

Thanks,
Corey

@DBezemer
Copy link
Owner

DBezemer commented Apr 12, 2021

@bugfood can you post the output of:

/usr/lib/rpm/redhat/dist.sh --dist

On all my available CentOS environments this returns ".el7". As you can see from the WiP builds, the Docker builds has no issues with this either, leading me to believe this to be a problem with your local environment.

Also check the output of:

rpm -q --whatprovides /etc/rpm/macros.dist

The latest/current macros.dist provided by centos-release-7-9.2009.1.el7.centos.x86_64.rpm from repo contains:

# dist macros.

%centos_ver 7
%centos 7
%rhel 7
%dist .el7
%el7 1

@DBezemer
Copy link
Owner

Refer to the following CentOS bug tracker: https://bugs.centos.org/view.php?id=14955

@bugfood
Copy link
Contributor Author

bugfood commented Apr 12, 2021

Ah, I did not realize that had changed in centos 7.9. %dist was .el7.centos on centos 7.2, 7.4, 7.8, and presumably others. Sorry about that.

On centos 7.8:

$ /usr/lib/rpm/redhat/dist.sh --dist ; echo
.el7

I still think the code I pointed out has an issue, though; the conditional always evaluates to false. I think that either:
a. The conditional should be fixed in order to support centos 7.8 and below.
-or-
b. The conditional and its body should be removed, since it does nothing currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants