rpm: fix detection of ppp version for ppp >= 2.5.0

In ppp 2.5.0 the "patchlevel.h" header file was removed and pkg-config
must be used. Update the detection command to support both ways.
This commit is contained in:
Beniamino Galvani 2023-04-20 10:42:58 +02:00
parent 68c30bab16
commit c67d65f733

View file

@ -9,7 +9,7 @@
%global wpa_supplicant_version 1:1.1
%global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
%global ppp_version %(pkg-config --modversion pppd 2>/dev/null || sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
%global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
%global epoch_version 1