#Macros used for build Xfce 4

# Xfce 4 data dir
%_xfce4data %_datadir/xfce4

# Path for panel plugins *.desktop files
%_xfce4panelentry %_xfce4data/xfce4/panel/plugins

# Run xdt-autogen script
# Create m4/ directory
%xfce4reconf() mkdir -p m4/; NOCONFIGURE=1 xdt-autogen

# Drop git version tag from configure script
# Usage: xfce4_drop_gitvtag <tag_name> <file>
# This macro is deprecated in favor of %xfce4_cleanup_version().
%xfce4_drop_gitvtag() sed -i 's/m4_define(\\[%1\],[[:blank:]]*\\[git\\])/m4_define([%1], [])/' %2

# Drop 'git' word from version.
# If configure.ac.in is present then do it in old way (like %xfce4_drop_gitvtag() does).
# Otherwise assume that new XDT_VERSION_INIT (from xfce4-dev-tools > 4.16)  is used.
%xfce4_cleanup_version() \
if [ -s configure.ac.in ]; then \
  sed -i -r 's/^[[:blank:]]*m4_define\\(\\[(.+_version_tag)\\],[[:blank:]]*\\[git\\]\\)/m4_define([\\1], [])/' configure.ac.in; \
elif [ -s configure.ac ]; then \
  sed -i -r 's;^([[:blank:]]*XDT_VERSION_INIT\\(\\[.+\\]),[[:blank:]]*\\[git\\][[:blank:]]*\\);\\1);' configure.ac; \
fi; \
if [ -s xfce-revision.h.in ]; then \
  sed -i -r 's;^(#define[[:blank:]]+VERSION_FULL[[:blank:]]+VERSION)[[:blank:]]+"-"[[:blank:]]+REVISION;\\1;' xfce-revision.h.in \
fi

# Wayland support for Xfce4 apps should be enabled for Sisyphus and branches >= p11 (with Xfce >= 4.19).
# Branches older then p9 are not taken into account: Xfce is quite old there and hopefully no one will
# build newest apps for it.
%if_xfce4_wayland_support %if %{defined _priority_distbranch} %{?_priority_distbranch:&& %_priority_distbranch != p9 && %_priority_distbranch != p10}
