#/*! \page build_macros Default configuration: /Users/travis/build/develar/build-travis-mac-env/homebrew/Cellar/rpm/5.4.15_3/lib/rpm/macros.rpmbuild
# \verbatim
#
# $Id: macros.rpmbuild.in,v 1.4.4.19 2014/07/26 20:20:33 jbj Exp $
#
# This file contains rpmbuild configuration macros.
#

#==============================================================================
# ---- Build system path macros.
#
%__ar			ar
%__as			/usr/bin/as
%__cc			clang
%__cpp			clang -E
%__cxx			clang++
%__ld			/Users/travis/build/develar/build-travis-mac-env/homebrew/Homebrew/Library/Homebrew/shims/super/ld
%__nm			/usr/bin/nm
%__objcopy		%{_bindir}/objcopy
%__objdump		/usr/bin/objdump
%__ranlib		ranlib
%__remsh		%{__rsh}
%__strip		/usr/bin/strip

# XXX avoid failures if tools are not installed when rpm is built.
%__libtoolize		libtoolize
%__aclocal		aclocal
%__autoheader		autoheader
%__automake		automake
%__autoconf		autoconf

#==============================================================================
# ---- Conditional build macro templates.

# Check if symbol is defined.
# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
%defined()	%{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%undefined()	%{expand:%%{?%{1}:0}%%{!?%{1}:1}}

# Shorthand for %{defined with_...}
%with()		%{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%without()	%{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}

# Handle conditional builds. %bcond_with is for case when feature is
# default off and needs to be activated with --with ... command line
# switch. %bcond_without is for the dual case.
#
# %bcond_with foo defines symbol with_foo if --with foo was specified on
# command line.
# %bcond_without foo defines symbol with_foo if --without foo was *not*
# specified on command line.
#
# For example (spec file):
#
# (at the beginning)
# %bcond_with extra_fonts
# %bcond_without static
# (and later)
# %if %{with extra_fonts}
# ...
# %else
# ...
# %endif
# %if ! %{with static}
# ...
# %endif
# %ifdef %{with static}
# ...
# %endif
# %{?with_static: ... }
# %{!?with_static: ... }
# %{?with_extra_fonts: ... }
# %{!?with_extra_fonts: ... }

#
# The bottom line: never use without_foo, _with_foo nor _without_foo, only
# with_foo. This way changing default set of bconds for given spec is just
# a matter of changing single line in it and syntax is more readable.
%bcond_with()		%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%bcond_without()	%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}

#==============================================================================
# ---- Optional macros.
#	Macros that are initialized as a side effect of spec
#	file parsing.
#
#	The sub-directory (relative to %{_builddir}) where sources are compiled.
#	This macro is set after processing %setup, either explicitly from the
#	value given to -n or the default name-version.
#
#%buildsubdir

#	Truncate changelogs to no. of entries or date.
#	<=0	disables
#	<1000	truncates to no. of entries
#	Otherwise, a get_date string (e.g. "2 years ago") may be entered,
#	and changelog entries older than that date will not be added to headers.
%_changelog_truncate	1 year ago

#	Configurable distribution information, same as Distribution: tag in a
#	specfile.
#
#%distribution

#	Configurable bug URL, same as BugURL: tag in a specfile.
#	The URL will be used to supply reliable information to where
#	to file bugs.
#
#%bugurl

#
#	Deprecated.
#
#%_langpatt

#	Configurable packager information, same as Packager: in a specfile.
#
#%packager

#	Compression type and level for source/binary package payloads.
#		"w9.gzdio"	gzip level 9 (default).
#		"w9.bzdio"	bzip2 level 9.
#		"w6.lzdio"	lzma level 6 (legacy, stable).
#		"w6.xzdio"	xz level 6 (obsoletes lzma, unstable).
#
#%_source_payload	w9.gzdio
#%_binary_payload	w9.gzdio

#	Archive formats to use for source/binary package payloads.
#		"cpio"		cpio archive (default)
#		"ustar"		tar archive
#
#%_source_payload_format	cpio
#%_binary_payload_format	cpio

#	Configurable vendor information, same as Vendor: in a specfile.
#
#%vendor

#	Default fuzz level for %patch in spec file.
#%_default_patch_fuzz	-1

#	Default patch flags
%_default_patch_flags	-s

#==============================================================================
# ---- Build configuration macros.
#
# Package version macro.
#	The type of package to produce, for compatibility with legacy
#	versions of rpm.
#
# This is an rpm version, e.g. 30005 means to produce packaging compatible
# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
# version before rpm-3.0.5) are not supported. The only incompatible change
# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
# rpmlead, so there's little need to use any value greater than 30005.
#
%_package_version	30005

#
# The patch macro writes 1 line of shell code to (optionally) uncompress
# a file and apply using patch(1).
#

%patch(b:p:P:REz:F:d:) %{shrink:\
%define __patch_number  %{-P:%{-P*}}%{!-P:0} \
%define __patch_file    %{P:%{__patch_number}} \
%define __patch_suffix  %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \
%define __patch_fuzz    %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} -ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \
%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \
echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( %{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) || exit 1\
}

#
# Script gets packaged file list on input and buildroot as first parameter.
# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
#
# Note: Disable (by commenting out) for legacy compatibility.
%__check_files         %{_rpmhome}/check-files %{buildroot}

#
# Should unpackaged files in a build root terminate a build?
#
# Note: The default value should be 0 for legacy compatibility.
%_unpackaged_files_terminate_build	1

#
# Should missing %doc files in the build directory terminate a build?
#
# Note: The default value should be 0 for legacy compatibility.
%_missing_doc_files_terminate_build	1

#
# Program to call for each successfully built and written binary package.
# The package name is passed to the program as a command-line argument.
#
#%_build_pkgcheck	%{_bindir}/rpmlint

#
# Program to call for the whole binary package set after build.
# The package set is passed to the program via command-line arguments.
#
#%_build_pkgcheck_set	%{_bindir}/rpmlint

#
# Program to call for successfully built and written SRPM.
# The package name is passed to the program as a command-line argument.
#
#%_build_pkgcheck_srpm	%{_bindir}/rpmlint

#
# Should the build of packages fail if package checker (if defined) returns
# non-zero exit status?
#
#%_nonzero_exit_pkgcheck_terminate_build	1

#
# Should an ELF file processed by find-debuginfo.sh having no build ID
# terminate a build?  This is left undefined to disable it and defined to
# enable.
#
#%_missing_build_ids_terminate_build	1

#
# Use internal dependency generator rather than external helpers?
# 0 - Use external generator
# 1 - Use internal generator if available
# 2 - Use __scriptlet_requires to process scriptlet dependencies
%_use_internal_dependency_generator	1

#
# Disabler for adding /bin/sh scriptlet interpreter dependencies.
%_disable_shell_interpreter_deps	0

#
# Filter GLIBC_PRIVATE Provides: and Requires:
%_filter_GLIBC_PRIVATE			0

#
# Path to scripts to autogenerate package dependencies,
#
# Note: Used iff _use_internal_dependency_generator is zero.
#%__find_provides	%{_rpmhome}/rpmdeps --provides
#%__find_requires	%{_rpmhome}/rpmdeps --requires
%__find_provides	%{_rpmhome}/find-provides
%__find_requires	%{_rpmhome}/find-requires
#%__find_conflicts	???
#%__find_obsoletes	???

#
# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
# These macros are necessary only for legacy compatibility, and have moved
# to per-platform macro configuration (i.e. %{_usrlibrpm}/arch>-<os>/macros)
#
# Note: These are no longer enabled by default.
#%__id_u		%{__id} -u
#%__chown_Rhf		%{__chown} -Rhf
#%__chgrp_Rhf		%{__chgrp} -Rhf
#%_fixowner		[ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
#%_fixgroup		[ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} wheel
#%_fixperms		%{__chmod} -Rf a+rX,u+w,g-w,o-w
#

#
# Choose the non-repudiable signature algorithm:
# 	DSA		(default)
# 	RSA		(implies SHA1)
# 	ECDSA		(implies SHA256)
# 	DSA/SHA1
# 	DSA/SHA224
# 	DSA/SHA256
# 	DSA/SHA384
# 	DSA/SHA512
# 	RSA/SHA1
# 	RSA/SHA224
# 	RSA/SHA256
# 	RSA/SHA384
# 	RSA/SHA512
# 	ECDSA/SHA224	(using NIST P-224)
# 	ECDSA/SHA256	(using NIST P-256)
# 	ECDSA/SHA384	(using NIST P-384)
# 	ECDSA/SHA512	(using NIST P-521)
#
%_build_sign	RSA/SHA1

#
# Choose metadata file digest algorithm:
#	1 	MD5
#	2	SHA1
#	3	RIPEMD-160
#	5	MD2
#	6	TIGER-192
#	8	SHA256
#	9	SHA384
#	10	SHA512
#	11	SHA224
#	104	MD4
#	105	RIPEMD-128
#	106	CRC-32
#	107	ADLER-32
#	108	CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
#	109	Jenkins lookup3.c hashlittle()
#	111	RIPEMD-256
#	112	RIPEMD-320
#	188	BLAKE2B
#	189	BLAKE2BP
#	190	BLAKE2S
#	191	BLAKE2SP
#
#%_build_file_digest_algo	1
%_build_file_digest_algo	189
%_build_binary_file_digest_algo	%{_build_file_digest_algo}
%_build_source_file_digest_algo	%{_build_file_digest_algo}

#
# Byte size of line buffer for .spec file parsing
%_spec_line_buffer_size 100000

#
# Maximum Icon: graphic file size (undefined or < 2048 uses 2048).
%_build_iconsize 2048

#	The output binary package file name template used when building
#	binary packages.
#
# XXX	Note: escaped %% for use in headerSprintf()
%_build_name_fmt	%%{ARCH}/%{___NVRA}.rpm

#==============================================================================
# ---- per-platform macros.
#	Macros that are specific to an individual platform. The values here
#	will be used if the per-platform macro file does not exist..
#

#
# Define a generic value for optflags. Normally overridden by per-target macros.
%optflags		-O2

#
# Define per-arch and per-os defaults. Normally overridden by per-target macros.
%__arch_install_post	%{nil}
%__os_install_post	%{___build_post}

#==============================================================================
# ---- Scriptlet template templates.
#	Global defaults used for building scriptlet templates.
#

%___build_shell		%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
%___build_args		-e
%___build_cmd		%{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
%___build_pre	\
  RPM_OPT_FLAGS=\"%{optflags}\"\
  export RPM_OPT_FLAGS\
  %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
  export RPM_BUILD_ROOT}\
  %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
  export CLASSPATH}\
  unset PERL_MM_OPT || :\
  LC_ALL=C\
  export LC_ALL\
  LANG=C\
  export LANG\
  unset DISPLAY || :\
  unset LINGUAS || :\
  unset LANGUAGE || :\
  unset LC_MESSAGES || :\
  \
  %{verbose:set -x}%{!verbose:exec > /dev/null}\
  umask 022\
  cd "%{u2p:%{_builddir}}"\


#%___build_body		%{nil}
%___build_post		exit 0

%___build_template	#!%{___build_shell}\
%{___build_pre}\
%{nil}

#%{___build_body}\
#%{___build_post}\
#%{nil}

#==============================================================================
# ---- Scriptlet templates.
#	Macro(s) that expand to a command and script that is executed.
#	CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
#
%__spec_prep_shell	%{___build_shell}
%__spec_prep_args	%{___build_args}
%__spec_prep_cmd	%{___build_cmd}
%__spec_prep_pre	%{___build_pre}
%__spec_prep_body	%{___build_body}
%__spec_prep_post	%{___build_post}
%__spec_prep_template	#!%{__spec_prep_shell}\
%{__spec_prep_pre}\
%{nil}

#%{__spec_prep_body}\
#%{__spec_prep_post}\
#%{nil}

%__spec_build_shell	%{___build_shell}
%__spec_build_args	%{___build_args}
%__spec_build_cmd	%{___build_cmd}
%__spec_build_pre	%{___build_pre}
%__spec_build_body	%{___build_body}
%__spec_build_post	%{___build_post}
%__spec_build_template	#!%{__spec_build_shell}\
%{__spec_build_pre}\
%{nil}

#%{__spec_build_body}\
#%{__spec_build_post}\
#%{nil}

%__spec_install_shell	%{___build_shell}
%__spec_install_args	%{___build_args}
%__spec_install_cmd	%{___build_cmd}
%__spec_install_pre	%{___build_pre}\
%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
%__spec_install_body	%{___build_body}
%__spec_install_post\
%{?__debug_package:%{__debug_install_post}}\
%{__arch_install_post}\
%{__os_install_post}\
%{nil}
%__spec_install_template	#!%{__spec_install_shell}\
%{__spec_install_pre}\
%{nil}

#%{__spec_install_body}\
#%{__spec_install_post}\
#%{nil}

%__spec_check_shell	%{___build_shell}
%__spec_check_args	%{___build_args}
%__spec_check_cmd	%{___build_cmd}
%__spec_check_pre	%{___build_pre}
%__spec_check_body	%{___build_body}
%__spec_check_post	%{___build_post}
%__spec_check_template	#!%{__spec_check_shell}\
%{__spec_check_pre}\
%{?_ispras_check_abi} \
%{?_ispras_check_autotest} \
%{nil}

#%{__spec_check_body}\
#%{__spec_check_post}\
#%{nil}

#%__spec_autodep_shell	%{___build_shell}
#%__spec_autodep_args	%{___build_args}
#%__spec_autodep_cmd	%{___build_cmd}
#%__spec_autodep_pre	%{___build_pre}
#%__spec_autodep_body	%{___build_body}
#%__spec_autodep_post	%{___build_post}
#%__spec_autodep_template	#!%{__spec_autodep_shell}\
#%{__spec_autodep_pre}\
#%{nil}

#%{__spec_autodep_body}\
#%{__spec_autodep_post}\
#%{nil}

%__spec_clean_shell	%{___build_shell}
%__spec_clean_args	%{___build_args}
%__spec_clean_cmd	%{___build_cmd}
%__spec_clean_pre	%{___build_pre}
%__spec_clean_body	%{?buildroot:%{__rm} -rf '%{buildroot}'}\
%{nil}
%__spec_clean_post	%{nil}
%__spec_clean_template	#!%{__spec_clean_cmd}\
%{__spec_clean_pre}\
%{nil}

#%{__spec_clean_body}\
#%{__spec_clean_post}\
#%{nil}

%__spec_track_shell    %{___build_shell}
%__spec_track_args     %{___build_args}
%__spec_track_cmd      %{___build_cmd}
%__spec_track_pre      %{__vcheck} %{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD
%__spec_track_body     %{___build_body}
%__spec_track_post     GO_SYSIN_DD\
%{nil}
%__spec_track_template #!%{__spec_track_shell}\
%{__spec_track_pre}\
%{nil}

%__spec_sanitycheck_shell    %{___build_shell}
%__spec_sanitycheck_args     %{___build_args}
%__spec_sanitycheck_cmd      %{___build_cmd}
%__spec_sanitycheck_pre      %{___build_pre}
%__spec_sanitycheck_body     %{___build_body}
%__spec_sanitycheck_post     %{___build_post}
%__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\
%{__spec_sanitycheck_pre}\
%{nil}

%__spec_rmbuild_shell	%{___build_shell}
%__spec_rmbuild_args	%{___build_args}
%__spec_rmbuild_cmd	%{___build_cmd}
%__spec_rmbuild_pre	%{___build_pre}
%__spec_rmbuild_body	%{___build_body}
%__spec_rmbuild_post	%{___build_post}
%__spec_rmbuild_template	#!%{__spec_rmbuild_shell}\
%{__spec_rmbuild_pre}\
%{nil}

#%{__spec_rmbuild_body}\
#%{__spec_rmbuild_post}\
#%{nil}

# XXX We don't expand pre/post install scriptlets (yet).
#%__spec_pre_pre		%{nil}
#%__spec_pre_post		%{nil}
#%__spec_post_pre		%{nil}
#%__spec_post_post		%{nil}
#%__spec_preun_pre		%{nil}
#%__spec_preun_post		%{nil}
#%__spec_postun_pre		%{nil}
#%__spec_postun_post		%{nil}
#%__spec_triggerpostun_pre	%{nil}
#%__spec_triggerpostun_post	%{nil}
#%__spec_triggerun_pre		%{nil}
#%__spec_triggerun_post		%{nil}
#%__spec_triggerin_pre		%{nil}
#%__spec_triggerin_post		%{nil}

#==============================================================================
# ---- specfile macros.
#	Macro(s) here can be used reliably for reproducible builds.
#	(Note: Above is the goal, below are the macros under development)
#
# The configure macro does the following:
#	optionally change to a subdirectory (not implemented).
#	attempt to update config.guess and config.sub.
#	run configure with correct prefix, platform, and CFLAGS.
#	optionally restore current directory (not implemented).
# The configure macro should be invoked as %configure (rather than %{configure})
# because the rest of the arguments will be expanded using %*.
#
# This is the version of %configure used through rpm-3.0.4.
#%configure	\
#  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
#  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
#
#------------------------------------------------------------------------------
# This is an improved version of %configure (from PLD team).
%configure \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  ./configure --host=%{_host} --build=%{_build} \\\
	--target=%{_target_platform} \\\
	--program-prefix=%{?_program_prefix} \\\
 	--prefix=%{_prefix} \\\
	--exec-prefix=%{_exec_prefix} \\\
	--bindir=%{_bindir} \\\
	--sbindir=%{_sbindir} \\\
	--sysconfdir=%{_sysconfdir} \\\
	--datadir=%{_datadir} \\\
	--includedir=%{_includedir} \\\
	--libdir=%{_libdir} \\\
	--libexecdir=%{_libexecdir} \\\
	--localstatedir=%{_localstatedir} \\\
	--sharedstatedir=%{_sharedstatedir} \\\
	--mandir=%{_mandir} \\\
	--infodir=%{_infodir}

#------------------------------------------------------------------------------
# The make install analogue of %configure for modern autotools:
%make_install make install DESTDIR=%{?buildroot}

#------------------------------------------------------------------------------
# Former make install analogue, kept for compatibility and for old/broken
#  packages that don't support DESTDIR properly.
%makeinstall \
  make \\\
	prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
	exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
	bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
	sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
	sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
	datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
	includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
	libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
	libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
	localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
	sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
	mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
	infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
  install

#------------------------------------------------------------------------------
# The GNUconfigure macro does the following:
#       update config.guess and config.sub.
#       regenerate all autoconf/automake files
#       optionally change to a directory (make the directory if requested).
#       run configure with correct prefix, platform, and CFLAGS.
#       optionally restore current directory.
#
# Based on autogen.sh from GNOME and original GNUconfigure
#
%GNUconfigure(MCs:)      \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
  LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
  %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \
  dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \
    for coin in `echo ${dirs}` \
do \
  dr=`dirname ${coin}`; \
if test -f ${dr}/NO-AUTO-GEN; then \
 : \
else \
     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
    ( cd "${dr}"; \
      aclocalinclude="${ACLOCAL_FLAGS}"; \
      for k in ${macrodirs}; do \
        if test -d ${k}; then \
          aclocalinclude="${aclocalinclude} -I ${k}"; \
        ##else \
        ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
        fi \
      done \
      if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \
        if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \
          : do nothing -- we still have an old unmodified configure.[ai][cn] \
        else \
          test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
          echo "no" | gettextize --force --copy; \
          test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
        fi \
      fi \
      if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \
        %{__libtoolize} --force --copy; \
      fi \
      aclocal ${aclocalinclude}; \
      if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \
        %{__autoheader}; \
      fi \
      echo "Running automake --gnu ${am_opt} ..."; \
      %{__automake} --add-missing --gnu ${am_opt}; \
      %{__autoconf}; \
    ); \
  fi \
done \
  %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
  %{-C:cd "${_mydir}"; unset _mydir}

%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}

#------------------------------------------------------------------------------
# argument to pass to 'make' to run one job per cpu in parallel on smp systems.
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
	&& RPM_BUILD_NCPUS="`/usr/sbin/sysctl -n hw.ncpu`"; \\\
	[ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")

#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatibile processors
#  (Note: This macro (and it's analogues) will probably be obsoleted when
#   rpm can use regular expressions against target platforms in macro
#   conditionals.
#
%ix86   i386 i486 i586 i686 pentium3 pentium4 athlon

# arch macro for all EFI-compatible architectures
%efi %{ix86} x86_64 ia64

# same thing for arm
%arm    arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b armv5te armv5tel armv5teb xscale armv6 armv6l armv7l armv7hl armv7lh armv7hln armv7hnl armv7lhn armv7lnh armv7nhl armv7nlh

# same thing for leg
%leg    leg legv3 legv3l legv3b legv4 legv4l legv4b legv5 legv5l legv5b legv5te legv5tel legv5teb xscale legv6 legv6l legv7l legv7hl legv7lh legv7hln legv7hnl legv7lhn legv7lnh legv7nhl legv7nlh

# same for alpha
%alpha  alpha alphaev56 alphaev6 alphaev67

# and sparc
%sparc sun4 sun4m sun4c sun4d sun4u sparc sparcv8 sparcv9 sparcv9b sparc9v sparcv9v2

# add alternative sparc architectures macro (bugzilla #455972 patch)
%sparcx %sparc sparc64 sparc64v sparc64v2

# also for mips
%mips mips mips2 mips3 mips4 octeon
%mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel

%mipsx %mips %mipsel mips64 mips64el
 
#------------------------------------------------------------------------
# Use in %install to generate locale specific file lists. For example,
#
# %install
# ...
# %find_lang %{name}
# ...
# %files -f %{name}.lang
#
%find_lang	%{_rpmhome}/find-lang.sh %{buildroot}

%requires_eq()	%(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")

# \endverbatim
#*/
