Larry On Sun, 2016-12-04 at 21:47 -0600, Larry Finger wrote:
It is a little ugly, but with Tobias' help, I ended up with the following patch hunks for the spec file::
@@ -304,6 +307,9 @@ ###########################################
%prep +xserver_str=`rpm -q xorg-x11-server` +XSERVER_VERSION=`expr match "$xserver_str" '.*\(\([0-9]\.[0-9][0- 9]\.[0-9]\)\)'` +#XSERVER_VERSION=`echo $XSERVER_VERSION | sed -e 's/\.//g'` %setup -q -n VirtualBox-%{version} %patch1 -p1 %patch2 -p1 @@ -328,6 +334,11 @@ %patch113 -p1 %patch114 -p1 %patch115 -p1 +if [ "$XSERVER_VERSION" = "1.18.4" ] ; then + echo "Patch 116 not applied" +else +%patch116 -p1 +fi
That IS ugly :) and totally specialcases 1.18.4 compared to anybody building the package against 1.18.3 - which would fail. The 'proper' things would be to either a) Make the patch in a way that it ca be applied unconditionally; hae the conditions inside the patch. Something like: #if XORG_VERSION_CURRENT >= 11900000 #code for version >= 1.19 #else #code for version < 1.19 #endif b) Apply the patch a bit less hackish..
if pkg-config --atleast-version 1.19 xorg-server; then %patch116 -p1 fi