According to https://rpm-software-management.github.io/rpm/manual/spec.html 
some sections are only available from certain versions, for example %conf 
(since rpm >= 4.18).
I'd like my SPEC file to use newer capabilities if rpmbuild supports those, and 
fallback to older capabilities if built on an older system.

I was hoping for something like
```
%if %rpmversion >= 4.18
%conf
%else
%build
%endif
%configure
%if %rpmversion >= 4.18
%build
%endif
make
```
But I don't see anything like %rpmversion being provided. I can always `rpm -q 
rpm --qf %{VERSION}` but that has 2 issues
1. I'm not sure if this will evaluates correctly to a version comparison and 
not be used in a lexographical string comaprison
2. It doesn't seem like the correct method, since rpmbuild should 'know' it's 
own capabilites (including version).

Does it make sense to build a spec file that will behave differently on fedora 
vs. rhel ?
Is there a canonical way to enjoy the best capabilities of a given rpm version 
while maintaining backward compatibility?


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3314
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/3...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to