Blame macros.in

2ff057
#/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
2ff057
# \verbatim
2ff057
#
2ff057
# This is a global RPM configuration file. All changes made here will
2ff057
# be lost when the rpm package is upgraded. Any per-system configuration
2ff057
# should be added to /etc/rpm/macros, while per-user configuration should
2ff057
# be added to ~/.rpmmacros.
2ff057
#
2ff057
2ff057
#==============================================================================
2ff057
# ---- A macro that expands to nothing.
2ff057
#
2ff057
%nil			%{!?nil}
2ff057
2ff057
#==============================================================================
2ff057
# ---- filesystem macros.
2ff057
#
2ff057
%_usr			@prefix@
2ff057
%_usrsrc		%{_usr}/src
2ff057
%_var			@localstatedir@
2ff057
2ff057
#==============================================================================
2ff057
# ---- Generally useful path macros.
2ff057
#
2ff057
%__7zip			@__7ZIP@
2ff057
%__awk			@AWK@
2ff057
%__bzip2		@__BZIP2@
2ff057
%__cat			@__CAT@
2ff057
%__chgrp		@__CHGRP@
2ff057
%__chmod		@__CHMOD@
2ff057
%__chown		@__CHOWN@
2ff057
%__cp			@__CP@
2ff057
%__cpio			@__CPIO@
2ff057
%__file			@__FILE@
Packit Service c3bef8
%__gpg			/usr/bin/gpg2
2ff057
%__grep			@__GREP@
2ff057
%__gzip			@__GZIP@
2ff057
%__id			@__ID@
2ff057
%__id_u			%{__id} -u
2ff057
%__install		@__INSTALL@
2ff057
%__ln_s			@LN_S@
2ff057
%__lrzip		@__LRZIP@
2ff057
%__lzip			@__LZIP@
2ff057
# Deprecated, use %__xz instead.
2ff057
%__lzma			%__xz --format=lzma
2ff057
%__xz			@__XZ@
2ff057
%__make			@__MAKE@
2ff057
%__mkdir		@__MKDIR@
2ff057
%__mkdir_p		@__MKDIR_P@
2ff057
%__mv			@__MV@
2ff057
%__patch		@__PATCH@
2ff057
%__perl			@__PERL@
Packit Service 620265
%__python		%{error:attempt to use unversioned python, define %%__python to %{_bindir}/python2 or %{_bindir}/python3 explicitly}
2ff057
%__restorecon		@__RESTORECON@
2ff057
%__rm			@__RM@
2ff057
%__rsh			@__RSH@
2ff057
%__sed			@__SED@
2ff057
%__semodule		@__SEMODULE@
2ff057
%__ssh			@__SSH@
2ff057
%__tar			@__TAR@
2ff057
%__unzip		@__UNZIP@
2ff057
%__zstd			@__ZSTD@
2ff057
%__gem			@__GEM@
2ff057
%__git			@__GIT@
2ff057
%__hg			@__HG@
2ff057
%__bzr			@__BZR@
2ff057
%__quilt		@__QUILT@
2ff057
2ff057
#==============================================================================
2ff057
# ---- Build system path macros.
2ff057
#
2ff057
%__ar			@AR@
2ff057
%__as			@AS@
2ff057
%__cc			@__CC@
2ff057
%__cpp			@CPP@
2ff057
%__cxx			@CXX@
2ff057
%__ld			@__LD@
2ff057
%__nm			@__NM@
2ff057
%__objcopy		@__OBJCOPY@
2ff057
%__objdump		@__OBJDUMP@
2ff057
%__ranlib		@RANLIB@
2ff057
%__remsh		%{__rsh}
2ff057
%__strip		@__STRIP@
2ff057
2ff057
# XXX avoid failures if tools are not installed when rpm is built.
2ff057
%__libtoolize		libtoolize
2ff057
%__aclocal		aclocal
2ff057
%__autoheader		autoheader
2ff057
%__automake		automake
2ff057
%__autoconf		autoconf
2ff057
2ff057
#==============================================================================
2ff057
# Conditional build stuff.
2ff057
2ff057
# Check if symbol is defined.
2ff057
# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
2ff057
%defined()	%{expand:%%{?%{1}:1}%%{!?%{1}:0}}
2ff057
%undefined()	%{expand:%%{?%{1}:0}%%{!?%{1}:1}}
2ff057
2ff057
# Shorthand for %{defined with_...}
2ff057
%with()		%{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
2ff057
%without()	%{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
2ff057
2ff057
# Handle conditional builds. %bcond_with is for case when feature is
2ff057
# default off and needs to be activated with --with ... command line
2ff057
# switch. %bcond_without is for the dual case.
2ff057
#
2ff057
# %bcond_with foo defines symbol with_foo if --with foo was specified on
2ff057
# command line.
2ff057
# %bcond_without foo defines symbol with_foo if --without foo was *not*
2ff057
# specified on command line.
2ff057
#
2ff057
# For example (spec file):
2ff057
#
2ff057
# (at the beginning)
2ff057
# %bcond_with extra_fonts
2ff057
# %bcond_without static
2ff057
# (and later)
2ff057
# %if %{with extra_fonts}
2ff057
# ...
2ff057
# %else
2ff057
# ...
2ff057
# %endif
2ff057
# %if ! %{with static}
2ff057
# ...
2ff057
# %endif
2ff057
# %if %{with static}
2ff057
# ...
2ff057
# %endif
2ff057
# %{?with_static: ... }
2ff057
# %{!?with_static: ... }
2ff057
# %{?with_extra_fonts: ... }
2ff057
# %{!?with_extra_fonts: ... }
2ff057
2ff057
#
2ff057
# The bottom line: never use without_foo, _with_foo nor _without_foo, only
2ff057
# with_foo. This way changing default set of bconds for given spec is just
2ff057
# a matter of changing single line in it and syntax is more readable.
2ff057
%bcond_with()		%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
2ff057
%bcond_without()	%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
2ff057
#
2ff057
#==============================================================================
2ff057
# ---- Required rpmrc macros.
2ff057
#	Macros that used to be initialized as a side effect of rpmrc parsing.
2ff057
#	These are the default values that can be overridden by other
2ff057
#	(e.g. per-platform, per-system, per-packager, per-package) macros.
2ff057
#
2ff057
#	The directory where rpm's configuration and scripts live
2ff057
%_rpmconfigdir		%{getconfdir}
2ff057
#       The directory where rpm's macro files live
2ff057
%_rpmmacrodir		%{_rpmconfigdir}/macros.d
Packit Service 0cfc1f
#	The directory where rpm's addon lua libraries live
Packit Service 0cfc1f
%_rpmluadir		%{_rpmconfigdir}/lua
2ff057
2ff057
#	The directory where sources/patches will be unpacked and built.
2ff057
%_builddir		%{_topdir}/BUILD
2ff057
2ff057
#	The interpreter used for build scriptlets.
2ff057
%_buildshell		/bin/sh
2ff057
2ff057
#	The path to the bzip2 executable (legacy, use %{__bzip2} instead).
2ff057
%_bzip2bin		%{__bzip2}
2ff057
2ff057
#	The location of the rpm database file(s).
2ff057
%_dbpath		%{_var}/lib/rpm
2ff057
2ff057
#	The location of the rpm database file(s) after "rpm --rebuilddb".
2ff057
%_dbpath_rebuild	%{_dbpath}
2ff057
2ff057
%_keyringpath		%{_dbpath}/pubkeys/
2ff057
2ff057
#
2ff057
#	Path to script that creates debug symbols in a /usr/lib/debug
2ff057
#	shadow tree.
2ff057
#
2ff057
#	A spec file can %%define _find_debuginfo_opts to pass options to
2ff057
#	the script.  See the script for details.
2ff057
#
2ff057
%__debug_install_post   \
2ff057
    %{_rpmconfigdir}/find-debuginfo.sh \\\
2ff057
    %{?_smp_mflags} \\\
2ff057
    %{?_missing_build_ids_terminate_build:--strict-build-id} \\\
2ff057
    %{?_no_recompute_build_ids:-n} \\\
2ff057
    %{?_include_minidebuginfo:-m} \\\
2ff057
    %{?_include_gdb_index:-i} \\\
2ff057
    %{?_unique_build_ids:--build-id-seed "%{VERSION}-%{RELEASE}"} \\\
2ff057
    %{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
2ff057
    %{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
2ff057
    %{?_find_debuginfo_dwz_opts} \\\
2ff057
    %{?_find_debuginfo_opts} \\\
2ff057
    %{?_debugsource_packages:-S debugsourcefiles.list} \\\
2ff057
    "%{_builddir}/%{?buildsubdir}"\
2ff057
%{nil}
2ff057
2ff057
#	Template for debug information sub-package.
2ff057
%_debuginfo_template \
2ff057
%package debuginfo\
2ff057
Summary: Debug information for package %{name}\
2ff057
Group: Development/Debug\
2ff057
AutoReq: 0\
2ff057
AutoProv: 1\
2ff057
%description debuginfo\
2ff057
This package provides debug information for package %{name}.\
2ff057
Debug information is useful when developing applications that use this\
2ff057
package or when debugging this package.\
2ff057
%files debuginfo -f debugfiles.list\
2ff057
%{nil}
2ff057
2ff057
%_debugsource_template \
2ff057
%package debugsource\
2ff057
Summary: Debug sources for package %{name}\
2ff057
Group: Development/Debug\
2ff057
AutoReqProv: 0\
2ff057
%description debugsource\
2ff057
This package provides debug sources for package %{name}.\
2ff057
Debug sources are useful when developing applications that use this\
2ff057
package or when debugging this package.\
2ff057
%files debugsource -f debugsourcefiles.list\
2ff057
%{nil}
2ff057
2ff057
%debug_package \
2ff057
%ifnarch noarch\
2ff057
%global __debug_package 1\
2ff057
%_debuginfo_template\
2ff057
%{?_debugsource_packages:%_debugsource_template}\
2ff057
%endif\
2ff057
%{nil}
2ff057
2ff057
%_defaultdocdir		%{_datadir}/doc
2ff057
%_defaultlicensedir	%{_datadir}/licenses
2ff057
2ff057
# Following macros for filtering auto deps must not be used in spec files.
2ff057
# Their purpouse is to set up global filtering for all packages. If you need
2ff057
# to set up specific filtering for your package use %__requires_exclude_from
2ff057
# and %__provides_exclude_from instead.
2ff057
%__global_requires_exclude_from		%{?_docdir:%{_docdir}}
2ff057
%__global_provides_exclude_from		%{?_docdir:%{_docdir}}
2ff057
2ff057
#	The path to the gzip executable (legacy, use %{__gzip} instead).
2ff057
%_gzipbin		%{__gzip}
2ff057
2ff057
#	The Unix time of the latest kept changelog entry in binary packages.
2ff057
#	Any older entry is not packaged in binary packages.
2ff057
%_changelog_trimtime	0
2ff057
2ff057
#	If true, set the SOURCE_DATE_EPOCH environment variable
2ff057
#	to the timestamp of the topmost changelog entry
2ff057
%source_date_epoch_from_changelog 0
2ff057
2ff057
#	If true, make sure that timestamps in built rpms
2ff057
#	are not later than the value of SOURCE_DATE_EPOCH.
2ff057
#	Is ignored when SOURCE_DATE_EPOCH is not set.
2ff057
%clamp_mtime_to_source_date_epoch 0
2ff057
2ff057
#	The directory where newly built binary packages will be written.
2ff057
%_rpmdir		%{_topdir}/RPMS
2ff057
2ff057
#	A template used to generate the output binary package file name
2ff057
#	(legacy).
2ff057
%_rpmfilename		%{_build_name_fmt}
2ff057
2ff057
#	The directory where sources/patches from a source package will be
2ff057
#	installed. This is also where sources/patches are found when building.
2ff057
%_sourcedir		%{_topdir}/SOURCES
2ff057
2ff057
#	The directory where the spec file from a source package will be
2ff057
#	installed.
2ff057
%_specdir		%{_topdir}/SPECS
2ff057
2ff057
#	The directory where newly built source packages will be written.
2ff057
%_srcrpmdir		%{_topdir}/SRPMS
2ff057
2ff057
#	The directory where buildroots will be created.
2ff057
%_buildrootdir		%{_topdir}/BUILDROOT
2ff057
2ff057
#	Build root path, where %install installs the package during build.
2ff057
%buildroot		%{_buildrootdir}/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}
2ff057
2ff057
#	Directory where temporaray files can be created.
2ff057
%_tmppath		%{_var}/tmp
2ff057
2ff057
#	Path to top of build area.
2ff057
%_topdir		%{getenv:HOME}/rpmbuild
2ff057
2ff057
#	The path to the unzip executable (legacy, use %{__unzip} instead).
2ff057
%_unzipbin		%{__unzip}
2ff057
2ff057
#==============================================================================
2ff057
# ---- Optional rpmrc macros.
2ff057
#	Macros that are initialized as a side effect of rpmrc and/or spec
2ff057
#	file parsing.
2ff057
#
2ff057
#	The sub-directory (relative to %{_builddir}) where sources are compiled.
2ff057
#	This macro is set after processing %setup, either explicitly from the
2ff057
#	value given to -n or the default name-version.
2ff057
#
2ff057
#%buildsubdir
2ff057
2ff057
#	Configurable distribution information, same as Distribution: tag in a
2ff057
#	specfile.
2ff057
#
2ff057
#%distribution
2ff057
2ff057
#	Configurable distribution URL, same as DistURL: tag in a specfile.
2ff057
#	The URL will be used to supply reliable information to tools like
2ff057
#	rpmfind.
2ff057
#
2ff057
# Note: You should not configure with disturl (or build packages with
2ff057
# the DistURL: tag) unless you are willing to supply content in a
2ff057
# yet-to-be-determined format at the URL specified.
2ff057
#
2ff057
#%disturl
2ff057
2ff057
#	Configurable distribution tag, same as DistTag: tag in a specfile.
2ff057
#	The tag will be used to supply reliable information to tools like
2ff057
#	rpmfind.
2ff057
#
2ff057
#%disttag
2ff057
2ff057
#	Configurable bug URL, same as BugURL: tag in a specfile.
2ff057
#	The URL will be used to supply reliable information to where
2ff057
#	to file bugs.
2ff057
#
2ff057
#%bugurl
2ff057
2ff057
#	Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
2ff057
#	marked as %doc should be installed.
2ff057
#%_excludedocs
2ff057
2ff057
#	The port and machine name of a FTP proxy host running TIS firewall.
2ff057
#
2ff057
#%_ftpport
2ff057
#%_ftpproxy
2ff057
2ff057
#	The signature to use and the location of configuration files for
2ff057
#	signing packages with GNU gpg.
2ff057
#
2ff057
#%_gpg_name
2ff057
#%_gpg_path
2ff057
2ff057
#	The port and machine name of an HTTP proxy host.
2ff057
#
2ff057
#%_httpport
2ff057
#%_httpproxy
2ff057
2ff057
#	The PATH put into the environment before running %pre/%post et al.
2ff057
#
2ff057
%_install_script_path	/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
2ff057
2ff057
#	A colon separated list of desired locales to be installed;
2ff057
#	"all" means install all locale specific files.
2ff057
#	
2ff057
%_install_langs	all
2ff057
2ff057
#	The value of CLASSPATH in build scriptlets (iff configured).
2ff057
#	
2ff057
#%_javaclasspath	all
2ff057
2ff057
#	Import packaging conventions from jpackage.org (prefixed with _
2ff057
#	to avoid name collisions).
2ff057
#	
2ff057
%_javadir      %{_datadir}/java
2ff057
%_javadocdir   %{_datadir}/javadoc
2ff057
Packit Service bb3e16
Packit Service bb3e16
#	Set ModularityLabel: for packages being build
Packit Service bb3e16
#
Packit Service bb3e16
#%modularitylabel
Packit Service bb3e16
2ff057
#	A colon separated list of paths where files should *not* be installed.
2ff057
#	Usually, these are network file system mount points.
2ff057
#
2ff057
#%_netsharedpath
2ff057
2ff057
#	(experimental)
2ff057
#	The type of pattern match used on rpmdb iterator selectors:
2ff057
#	"default"	simple glob-like regex, periods will be escaped,
2ff057
#			splats will have period prepended, full "^...$" match
2ff057
#			required. Also, file path tags will use glob(7).
2ff057
#	"strcmp"	compare strings
2ff057
#	"regex"		regex(7) patterns using regcomp(3)/regexec(3)
2ff057
#	"glob"		glob(7) patterns using fnmatch(3)
2ff057
#
2ff057
%_query_selector_match	default
2ff057
2ff057
#	Configurable packager information, same as Packager: in a specfile.
2ff057
#
2ff057
#%packager
2ff057
2ff057
#	Compression type and level for source/binary package payloads.
2ff057
#		"w9.gzdio"	gzip level 9 (default).
2ff057
#		"w9.bzdio"	bzip2 level 9.
2ff057
#		"w6.xzdio"	xz level 6, xz's default.
2ff057
#		"w7T16.xzdio"	xz level 7 using 16 thread (xz only)
2ff057
#		"w6.lzdio"	lzma-alone level 6, lzma's default
2ff057
#
2ff057
#%_source_payload	w9.gzdio
2ff057
#%_binary_payload	w9.gzdio
2ff057
2ff057
#	Algorithm to use for generating file checksum digests on build.
2ff057
#	If not specified or 0, MD5 is used.
2ff057
#	WARNING: non-MD5 is backwards incompatible with rpm < 4.6!
2ff057
#	The supported algorithms may depend on the underlying crypto
2ff057
#	implementation but generally at least the following are supported:
2ff057
#	1	MD5
2ff057
#	2	SHA1
2ff057
#	8	SHA256 (default)
2ff057
#	9	SHA384
2ff057
#	10	SHA512
2ff057
#
2ff057
%_source_filedigest_algorithm	8
2ff057
%_binary_filedigest_algorithm	8
2ff057
2ff057
#	Configurable vendor information, same as Vendor: in a specfile.
2ff057
#
2ff057
#%vendor
2ff057
2ff057
#	Default fuzz level for %patch in spec file.
2ff057
%_default_patch_fuzz	0
2ff057
2ff057
#	Default patch flags
2ff057
#%_default_patch_flags	-s
2ff057
%_default_patch_flags --no-backup-if-mismatch
2ff057
2ff057
#==============================================================================
2ff057
# ---- Build configuration macros.
2ff057
#
2ff057
# Script gets packaged file list on input and buildroot as first parameter.
2ff057
# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
2ff057
#
2ff057
# Note: Disable (by commenting out) for legacy compatibility.
2ff057
%__check_files         %{_rpmconfigdir}/check-files %{buildroot}
2ff057
2ff057
#
2ff057
# Should unpackaged files in a build root terminate a build?
2ff057
#
2ff057
# Note: The default value should be 0 for legacy compatibility.
2ff057
%_unpackaged_files_terminate_build	1
2ff057
2ff057
#
2ff057
# Should missing %doc files in the build directory terminate a build?
2ff057
#
2ff057
# Note: The default value should be 0 for legacy compatibility.
2ff057
%_missing_doc_files_terminate_build	1
2ff057
2ff057
#
2ff057
# Should empty %files manifest file terminate a build?
2ff057
#
2ff057
# Note: The default value should be 0 for legacy compatibility.
2ff057
%_empty_manifest_terminate_build	1
2ff057
2ff057
#
2ff057
# Should binaries in noarch packages terminate a build?
2ff057
%_binaries_in_noarch_packages_terminate_build	1
2ff057
2ff057
# Should invalid utf8 encoding in package metadata terminate a build?
2ff057
%_invalid_encoding_terminates_build 0
2ff057
2ff057
# Should invalid version format in requires, provides, ... terminate a build?
2ff057
%_wrong_version_format_terminate_build 1
2ff057
2ff057
#
2ff057
# Should rpm try to download missing sources at build-time?
2ff057
# Enabling this is dangerous as long as rpm has no means to validate
2ff057
# the integrity of the download with a digest or signature.
2ff057
%_disable_source_fetch 1
2ff057
2ff057
#
2ff057
# Program to call for each successfully built and written binary package.
2ff057
# The package name is passed to the program as a command-line argument.
2ff057
#
2ff057
#%_build_pkgcheck	%{_bindir}/rpmlint
2ff057
2ff057
#
2ff057
# Program to call for the whole binary package set after build.
2ff057
# The package set is passed to the program via command-line arguments.
2ff057
#
2ff057
#%_build_pkgcheck_set	%{_bindir}/rpmlint
2ff057
2ff057
#
2ff057
# Program to call for successfully built and written SRPM.
2ff057
# The package name is passed to the program as a command-line argument.
2ff057
#
2ff057
#%_build_pkgcheck_srpm	%{_bindir}/rpmlint
2ff057
2ff057
#
2ff057
# Should the build of packages fail if package checker (if defined) returns
2ff057
# non-zero exit status?
2ff057
#
2ff057
#%_nonzero_exit_pkgcheck_terminate_build	1
2ff057
2ff057
#
2ff057
# Should an ELF file processed by find-debuginfo.sh having no build ID
2ff057
# terminate a build?  This is left undefined to disable it and defined to
2ff057
# enable.
2ff057
#
2ff057
#%_missing_build_ids_terminate_build	1
2ff057
2ff057
#
2ff057
# Include minimal debug information in build binaries.
2ff057
# Requires _enable_debug_packages.
2ff057
#
2ff057
#%_include_minidebuginfo	1
2ff057
2ff057
#
2ff057
# Include a .gdb_index section in the .debug files.
2ff057
# Requires _enable_debug_packages and gdb-add-index installed.
2ff057
#
2ff057
#%_include_gdb_index	1
2ff057
2ff057
#
2ff057
# Defines how and if build_id links are generated for ELF files.
2ff057
# The following settings are supported:
2ff057
#
2ff057
# - none
2ff057
#   No build_id links are generated.
2ff057
#
2ff057
# - alldebug
2ff057
#   build_id links are generated only when the __debug_package global is
2ff057
#   defined. This will generate build_id links in the -debuginfo package
2ff057
#   for both the main file as /usr/lib/debug/.build-id/xx/yyy and for
2ff057
#   the .debug file as /usr/lib/debug/.build-id/xx/yyy.debug.
2ff057
#   This is the old style build_id links as generated by the original
2ff057
#   find-debuginfo.sh script.
2ff057
#
2ff057
# - separate
2ff057
#   build_id links are generate for all binary packages. If this is a
2ff057
#   main package (the __debug_package global isn't set) then the
2ff057
#   build_id link is generated as /usr/lib/.build-id/xx/yyy. If this is
2ff057
#   a -debuginfo package (the __debug_package global is set) then the
2ff057
#   build_id link is generated as /usr/lib/debug/.build-id/xx/yyy.
2ff057
#
2ff057
# - compat
2ff057
#   Same as for "separate" but if the __debug_package global is set then
2ff057
#   the -debuginfo package will have a compatibility link for the main
2ff057
#   ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy
2ff057
%_build_id_links compat
2ff057
2ff057
# Whether build-ids should be made unique between package version/releases
2ff057
# when generating debuginfo packages. If set to 1 this will pass
2ff057
# --build-id-seed "%{VERSION}-%{RELEASE}" to find-debuginfo.sh which will
2ff057
# pass it onto debugedit --build-id-seed to be used to prime the build-id
2ff057
# note hash.
2ff057
%_unique_build_ids	1
2ff057
2ff057
# Do not recompute build-ids but keep whatever is in the ELF file already.
2ff057
# Cannot be used together with _unique_build_ids (which forces recomputation).
2ff057
# Defaults to undefined (unset).
2ff057
#%_no_recompute_build_ids 1
2ff057
2ff057
# Whether .debug files should be made unique between package version,
2ff057
# release and architecture. If set to 1 this will pass
2ff057
# --unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch} find-debuginfo.sh
2ff057
# to create debuginfo files which end in -<ver>-<rel>.<arch>.debug
2ff057
# Requires _unique_build_ids.
2ff057
%_unique_debug_names	1
2ff057
2ff057
# Whether the /usr/debug/src/<package> directories should be unique between
2ff057
# package version, release and architecture. If set to 1 this will pass
2ff057
# --unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}" to
2ff057
# find-debuginfo.sh to name the directory under /usr/debug/src as
2ff057
# <name>-<ver>-<rel>.<arch>.
2ff057
%_unique_debug_srcs	1
2ff057
2ff057
# Whether rpm should put debug source files into its own subpackage
2ff057
#%_debugsource_packages	1
2ff057
2ff057
# Whether rpm should create extra debuginfo packages for each subpackage
2ff057
#%_debuginfo_subpackages 1
2ff057
2ff057
#
2ff057
# Use internal dependency generator rather than external helpers?
2ff057
%_use_internal_dependency_generator	1
2ff057
2ff057
#
2ff057
# Filter GLIBC_PRIVATE Provides: and Requires:
2ff057
%_filter_GLIBC_PRIVATE			0
2ff057
2ff057
# Directories whose contents should be considered as documentation.
2ff057
%__docdir_path %{_datadir}/doc:%{_datadir}/man:%{_datadir}/info:%{_datadir}/gtk-doc/html:%{?_docdir}:%{?_mandir}:%{?_infodir}:%{?_javadocdir}:/usr/doc:/usr/man:/usr/info:/usr/X11R6/man
2ff057
2ff057
#
2ff057
# Path to scripts to autogenerate package dependencies,
2ff057
#
2ff057
# Note: Used iff _use_internal_dependency_generator is zero.
2ff057
#%__find_provides	%{_rpmconfigdir}/rpmdeps --provides
2ff057
#%__find_requires	%{_rpmconfigdir}/rpmdeps --requires
2ff057
%__find_provides	%{_rpmconfigdir}/find-provides
2ff057
%__find_requires	%{_rpmconfigdir}/find-requires
2ff057
#%__find_conflicts	???
2ff057
#%__find_obsoletes	???
2ff057
2ff057
# 
2ff057
# Path to file attribute classifications for automatic dependency 
2ff057
# extraction, used when _use_internal_dependency_generator
2ff057
# is used (on by default). Files can have any number of attributes
2ff057
# attached to them, and dependencies are separately extracted for
2ff057
# each attribute.
2ff057
# 
2ff057
# To define a new file attribute called "myattr", add a file named
2ff057
# "myattr" to this directory, defining the requires and/or provides
2ff057
# finder script(s) + magic and/or path pattern regex(es).
2ff057
# provides finder and 
2ff057
# %__myattr_requires	path + args to requires finder script for <myattr>
2ff057
# %__myattr_provides	path + args to provides finder script for <myattr>
2ff057
# %__myattr_magic	libmagic classification match regex
2ff057
# %__myattr_path	path based classification match regex
2ff057
# %__myattr_flags	flags to control behavior (just "exeonly" for now)
2ff057
# %__myattr_exclude_magic	exclude by magic regex
2ff057
# %__myattr_exclude_path	exclude by path regex
2ff057
#
2ff057
%_fileattrsdir		%{_rpmconfigdir}/fileattrs
2ff057
2ff057
# This macro defines how much space (in bytes) in package should be
2ff057
# reserved for gpg signatures during building of a package. If this space is
2ff057
# big enough for gpg signatures to fit into it then signing of the packages is
2ff057
# very quick because it is not necessary to rewrite the whole package to make
2ff057
# some space for gpg signatures.
2ff057
%__gpg_reserved_space 4096
2ff057
2ff057
#==============================================================================
2ff057
# ---- Database configuration macros.
2ff057
#
2ff057
# Select backend database. The following values are supported:
2ff057
# bdb Berkeley DB
2ff057
# lmdb Lightning Memory-mapped Database
2ff057
# ndb new data base format
2ff057
#
2ff057
%_db_backend	      bdb
2ff057
2ff057
#
2ff057
#	Macros used to configure Berkley db parameters.
2ff057
#
2ff057
# rpmdb macro configuration values are a colon (or white space) separated
2ff057
# list of tokens, with an optional '!' negation to explicitly disable bit
2ff057
# values, or a "=value" if a parameter. A per-tag value is used (e.g.
2ff057
# %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
2ff057
# (e.g. %_dbi_config).
2ff057
#
2ff057
# Here's a short list of the tokens, with a guess of whether the option is
2ff057
# useful:
2ff057
#	(nothing)	currently used in rpm, known to work.
2ff057
#	"+++"		under development, will be supported in rpm eventually.
2ff057
#	"???"		I have no clue, you're mostly on your own.
2ff057
#
2ff057
# If you do find yourself inclined to fiddle, here's what I see (shrug):
2ff057
# 1) Only the value of mp_size has any serious impact on overall performance,
2ff057
#    and you will need ~256Kb to handle a typical machine install.
2ff057
# 2) Only the Packages hash, because of the size of the values (i.e. headers),
2ff057
#    will ever need tuning. Diddle the pagesize if you're interested, although
2ff057
#    I believe that you will find pagesize=512 "best".
2ff057
# 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
2ff057
#    and/or mp_size instead.
2ff057
#
2ff057
#   token	works?	Berkeley db flag or value
2ff057
#==================================================
2ff057
#---------------------- DBENV tunable values:
2ff057
#   mmapsize=16Mb	DBENV->set_mp_mmapsize
2ff057
#   cachesize=1Mb	DBENV->set_cachesize, DB->set_cachesize
2ff057
#---------------------- DB->open bits:
2ff057
#   nommap	???	DB_NOMMAP
2ff057
#----------------------- rpmdb specific configuration:
2ff057
#   lockdbfd		(always on for Packages) Use fcntl(2) locking ?
2ff057
#   nofsync		Disable fsync(2) call performed after db3 writes?
2ff057
#
2ff057
2ff057
# Misc BDB tuning options
2ff057
%__dbi_other			mp_mmapsize=128Mb mp_size=1Mb
2ff057
2ff057
%_dbi_config			%{?__dbi_other}
2ff057
2ff057
# "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
2ff057
%_dbi_config_Packages		%{?_dbi_config} lockdbfd
2ff057
2ff057
#==============================================================================
2ff057
# ---- GPG/PGP/PGP5 signature macros.
2ff057
#	Macro(s) to hold the arguments passed to GPG/PGP for package
2ff057
#	signing and verification.
2ff057
#
2ff057
2ff057
%__gpg_sign_cmd			%{__gpg} \
2ff057
	gpg --no-verbose --no-armor \
2ff057
	%{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \
2ff057
	--no-secmem-warning \
2ff057
	%{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
2ff057
	-u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
2ff057
2ff057
# XXX rpm >= 4.1 verifies signatures internally
2ff057
#%__gpg_verify_cmd		%{__gpg} \
2ff057
#	gpg --batch --no-verbose --verify --no-secmem-warning \
2ff057
#	%{__signature_filename} %{__plaintext_filename}
2ff057
#
2ff057
# XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
2ff057
#	Normally this macro is defined in /etc/rpm/macros.prelink, installed
2ff057
#	with the prelink package. If the macro is undefined, then prelinked
2ff057
#	shared libraries contents are MD5 digest verified (as usual), rather
2ff057
#	than MD5 verifying the output of the prelink undo helper.
2ff057
#
2ff057
#	Note: The 2nd token is used as argv[0] and "library" is a
2ff057
#	placeholder that will be deleted and replaced with the appropriate
2ff057
#	library file path.
2ff057
#%__prelink_undo_cmd     /usr/sbin/prelink prelink -y library
2ff057
2ff057
# Horowitz Key Protocol server configuration
2ff057
#
2ff057
%_hkp_keyserver         http://pgp.mit.edu
2ff057
%_hkp_keyserver_query   %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
2ff057
2ff057
#==============================================================================
2ff057
# ---- Transaction macros.
2ff057
#	Macro(s) used to parameterize transactions.
2ff057
#
2ff057
#	The output binary package file name template used when building
2ff057
#	binary packages.
2ff057
#
2ff057
# XXX	Note: escaped %% for use in headerSprintf()
2ff057
%_build_name_fmt	%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
2ff057
2ff057
#	Verify digest/signature flags for various rpm modes:
2ff057
#	0x30300 (RPMVSF_MASK_NODIGESTS)    --nohdrchk      if set, don't check digest(s)
2ff057
#	0xc0c00 (RPMVSF_MASK_NOSIGNATURES) --nosignature   if set, don't check signature(s)
2ff057
#	0xf0000 (RPMVSF_MASK_NOPAYLOAD)    --nolegacy      if set, check header+payload (if possible)
2ff057
#	0x00f00 (RPMVSF_MASK_NOHEADER)     --nohdrchk      if set, don't check rpmdb headers
2ff057
#
2ff057
#	For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
2ff057
#	digest/signature checking, disables signature checking, but attempts
2ff057
#	digest checking, also when retrieving headers from the database.
2ff057
#
2ff057
#	You also can do:
2ff057
#	 >>> hex(rpm.RPMVSF_MASK_NOSIGNATURES)
2ff057
#	 '0xc0c00'
2ff057
#	or:
2ff057
#	 >>> hex(rpm.RPMVSF_MASK_NOSIGNATURES|rpm.RPMVSF_MASK_NOPAYLOAD)
2ff057
#	 '0xf0c00'
2ff057
#	at the python prompt for example, after "import rpm".
2ff057
#
2ff057
#	The checking overhead is ~11ms per header for digests/signatures;
2ff057
#	each header from the database is checked only when first encountered
2ff057
#	for each database open.
2ff057
#
2ff057
#	Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
2ff057
#	well as --erase.
2ff057
#
2ff057
%__vsflags		0xf0000
2ff057
%_vsflags_build		%{__vsflags}
2ff057
%_vsflags_erase		%{__vsflags}
2ff057
%_vsflags_install	%{__vsflags}
2ff057
%_vsflags_query		%{__vsflags}
2ff057
%_vsflags_rebuilddb	0xc0c00
2ff057
%_vsflags_verify	%{__vsflags}
2ff057
2ff057
# Enforced package verification level
2ff057
# all		require valid digest(s) and signature(s)
2ff057
# signature	require valid signature(s)
2ff057
# digest	require valid digest(s)
2ff057
# none		traditional rpm behavior, nothing required
2ff057
%_pkgverify_level digest
2ff057
2ff057
# Disabler flags for package verification (similar to vsflags)
2ff057
%_pkgverify_flags 0x0
2ff057
2ff057
# Set to 1 to minimize writing (at the cost of more reads) to
2ff057
# conserve eg SSD disks.
2ff057
%_minimize_writes      0
2ff057
2ff057
# Set to 1 to flush file IO during transactions (at a severe cost in
2ff057
# performance for rotational disks)
2ff057
#%_flush_io	0
2ff057
2ff057
#
2ff057
# Default output format string for rpm -qa
2ff057
#
2ff057
# XXX	Note: escaped %% for use in headerFormat()
2ff057
%_query_all_fmt		%%{nvra}
2ff057
2ff057
#
2ff057
# Default for coloring output
2ff057
# valid values are always never and auto
2ff057
%_color_output	never
2ff057
2ff057
#
2ff057
# Default path to the file used for transaction fcntl lock.
2ff057
%_rpmlock_path	%{_dbpath}/.rpm.lock
2ff057
2ff057
#
2ff057
# ISA dependency marker, none for noarch and name-bitness for others
2ff057
%_isa			%{?__isa:(%{__isa})}%{!?__isa:%{nil}}
2ff057
2ff057
#
2ff057
# Define per-arch and per-os defaults. Normally overridden by per-target macros.
2ff057
%__arch_install_post	%{nil}
2ff057
%__os_install_post	%{___build_post}
2ff057
2ff057
# Macro to fix broken permissions in sources
2ff057
%_fixperms      %{__chmod} -Rf @FIXPERMS@
2ff057
2ff057
#==============================================================================
2ff057
# ---- Scriptlet template templates.
2ff057
#	Global defaults used for building scriptlet templates.
2ff057
#
2ff057
2ff057
%___build_shell		%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
2ff057
%___build_args		-e
2ff057
%___build_cmd		%{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
2ff057
%___build_pre	\
2ff057
  RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
2ff057
  RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
2ff057
  RPM_OPT_FLAGS=\"%{optflags}\"\
Packit Service 489665
  RPM_LD_FLAGS=\"%{?__global_ldflags}\"\
2ff057
  RPM_ARCH=\"%{_arch}\"\
2ff057
  RPM_OS=\"%{_os}\"\
Packit Service ed094d
  RPM_BUILD_NCPUS=\"%{_smp_build_ncpus}\"\
Packit Service 489665
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS\
2ff057
  RPM_DOC_DIR=\"%{_docdir}\"\
2ff057
  export RPM_DOC_DIR\
2ff057
  RPM_PACKAGE_NAME=\"%{NAME}\"\
2ff057
  RPM_PACKAGE_VERSION=\"%{VERSION}\"\
2ff057
  RPM_PACKAGE_RELEASE=\"%{RELEASE}\"\
2ff057
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
2ff057
  LANG=C\
2ff057
  export LANG\
2ff057
  unset CDPATH DISPLAY ||:\
2ff057
  %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
2ff057
  export RPM_BUILD_ROOT}\
2ff057
  %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
2ff057
  export CLASSPATH}\
2ff057
  PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
2ff057
  export PKG_CONFIG_PATH\
Packit Service 57e164
  CONFIG_SITE=${CONFIG_SITE:-NONE}\
Packit Service 57e164
  export CONFIG_SITE\
Packit Service 6fd4df
  PYTHON_DISALLOW_AMBIGUOUS_VERSION=warn\
Packit Service 6fd4df
  export PYTHON_DISALLOW_AMBIGUOUS_VERSION\
2ff057
  \
2ff057
  %{verbose:set -x}%{!verbose:exec > /dev/null}\
2ff057
  umask 022\
2ff057
  cd \"%{u2p:%{_builddir}}\"\
2ff057
2ff057
2ff057
#%___build_body		%{nil}
2ff057
%___build_post		exit $?
2ff057
2ff057
%___build_template	#!%{___build_shell}\
2ff057
%{___build_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{___build_body}\
2ff057
#%{___build_post}\
2ff057
#%{nil}
2ff057
2ff057
#==============================================================================
2ff057
# ---- Scriptlet templates.
2ff057
#	Macro(s) that expand to a command and script that is executed.
2ff057
#
2ff057
%__spec_prep_shell	%{___build_shell}
2ff057
%__spec_prep_args	%{___build_args}
2ff057
%__spec_prep_cmd	%{___build_cmd}
2ff057
%__spec_prep_pre	%{___build_pre}
2ff057
%__spec_prep_body	%{___build_body}
2ff057
%__spec_prep_post	%{___build_post}
2ff057
%__spec_prep_template	#!%{__spec_prep_shell}\
2ff057
%{__spec_prep_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_prep_body}\
2ff057
#%{__spec_prep_post}\
2ff057
#%{nil}
2ff057
2ff057
%__spec_build_shell	%{___build_shell}
2ff057
%__spec_build_args	%{___build_args}
2ff057
%__spec_build_cmd	%{___build_cmd}
2ff057
%__spec_build_pre	%{___build_pre}
2ff057
%__spec_build_body	%{___build_body}
2ff057
%__spec_build_post	%{___build_post}
2ff057
%__spec_build_template	#!%{__spec_build_shell}\
2ff057
%{__spec_build_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_build_body}\
2ff057
#%{__spec_build_post}\
2ff057
#%{nil}
2ff057
2ff057
%__spec_install_shell	%{___build_shell}
2ff057
%__spec_install_args	%{___build_args}
2ff057
%__spec_install_cmd	%{___build_cmd}
2ff057
%__spec_install_pre	%{___build_pre}
2ff057
%__spec_install_body	%{___build_body}
2ff057
%__spec_install_post\
2ff057
%{?__debug_package:%{__debug_install_post}}\
2ff057
%{__arch_install_post}\
2ff057
%{__os_install_post}\
2ff057
%{nil}
2ff057
%__spec_install_template	#!%{__spec_install_shell}\
2ff057
%{__spec_install_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_install_body}\
2ff057
#%{__spec_install_post}\
2ff057
#%{nil}
2ff057
2ff057
%__spec_check_shell	%{___build_shell}
2ff057
%__spec_check_args	%{___build_args}
2ff057
%__spec_check_cmd	%{___build_cmd}
2ff057
%__spec_check_pre	%{___build_pre}
2ff057
%__spec_check_body	%{___build_body}
2ff057
%__spec_check_post	%{___build_post}
2ff057
%__spec_check_template	#!%{__spec_check_shell}\
2ff057
%{__spec_check_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_check_body}\
2ff057
#%{__spec_check_post}\
2ff057
#%{nil}
2ff057
2ff057
#%__spec_autodep_shell	%{___build_shell}
2ff057
#%__spec_autodep_args	%{___build_args}
2ff057
#%__spec_autodep_cmd	%{___build_cmd}
2ff057
#%__spec_autodep_pre	%{___build_pre}
2ff057
#%__spec_autodep_body	%{___build_body}
2ff057
#%__spec_autodep_post	%{___build_post}
2ff057
#%__spec_autodep_template	#!%{__spec_autodep_shell}\
2ff057
#%{__spec_autodep_pre}\
2ff057
#%{nil}
2ff057
2ff057
#%{__spec_autodep_body}\
2ff057
#%{__spec_autodep_post}\
2ff057
#%{nil}
2ff057
2ff057
%__spec_clean_shell	%{___build_shell}
2ff057
%__spec_clean_args	%{___build_args}
2ff057
%__spec_clean_cmd	%{___build_cmd}
2ff057
%__spec_clean_pre	%{___build_pre}
2ff057
%__spec_clean_body	%{___build_body}
2ff057
%__spec_clean_post	%{___build_post}
2ff057
%__spec_clean_template	#!%{__spec_clean_shell}\
2ff057
%{__spec_clean_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_clean_body}\
2ff057
#%{__spec_clean_post}\
2ff057
#%{nil}
2ff057
2ff057
%__spec_rmbuild_shell	%{___build_shell}
2ff057
%__spec_rmbuild_args	%{___build_args}
2ff057
%__spec_rmbuild_cmd	%{___build_cmd}
2ff057
%__spec_rmbuild_pre	%{___build_pre}
2ff057
%__spec_rmbuild_body	%{___build_body}
2ff057
%__spec_rmbuild_post	%{___build_post}
2ff057
%__spec_rmbuild_template	#!%{__spec_rmbuild_shell}\
2ff057
%{__spec_rmbuild_pre}\
2ff057
%{nil}
2ff057
2ff057
#%{__spec_rmbuild_body}\
2ff057
#%{__spec_rmbuild_post}\
2ff057
#%{nil}
2ff057
2ff057
# XXX We don't expand pre/post install scriptlets (yet).
2ff057
#%__spec_pre_pre		%{nil}
2ff057
#%__spec_pre_post		%{nil}
2ff057
#%__spec_post_pre		%{nil}
2ff057
#%__spec_post_post		%{nil}
2ff057
#%__spec_preun_pre		%{nil}
2ff057
#%__spec_preun_post		%{nil}
2ff057
#%__spec_postun_pre		%{nil}
2ff057
#%__spec_postun_post		%{nil}
2ff057
#%__spec_triggerpostun_pre	%{nil}
2ff057
#%__spec_triggerpostun_post	%{nil}
2ff057
#%__spec_triggerun_pre		%{nil}
2ff057
#%__spec_triggerun_post		%{nil}
2ff057
#%__spec_triggerin_pre		%{nil}
2ff057
#%__spec_triggerin_post		%{nil}
2ff057
2ff057
#==============================================================================
2ff057
# ---- configure macros.
2ff057
#	Macro(s) slavishly copied from autoconf's config.status.
2ff057
#
2ff057
%_prefix		@prefix@
2ff057
%_exec_prefix		%{_prefix}
2ff057
%_bindir		%{_exec_prefix}/bin
2ff057
%_sbindir		%{_exec_prefix}/sbin
2ff057
%_libexecdir		%{_exec_prefix}/libexec
2ff057
%_datadir		%{_prefix}/share
2ff057
%_sysconfdir		/etc
2ff057
%_sharedstatedir	%{_prefix}/com
2ff057
%_localstatedir		%{_prefix}/var
2ff057
%_lib			lib
2ff057
%_libdir		%{_exec_prefix}/%{_lib}
2ff057
%_includedir		%{_prefix}/include
2ff057
%_infodir		%{_datadir}/info
2ff057
%_mandir		%{_datadir}/man
2ff057
2ff057
#==============================================================================
2ff057
# ---- config.guess platform macros.
2ff057
#	Macro(s) similar to the tokens used by configure.
2ff057
#
2ff057
%_build			%{_host}
2ff057
%_build_alias		%{_host_alias}
2ff057
%_build_cpu		%{_host_cpu}
2ff057
%_build_vendor		%{_host_vendor}
2ff057
%_build_os		%{_host_os}
2ff057
%_host			@host@
2ff057
%_host_alias		@host_alias@%{nil}
2ff057
%_host_cpu		@host_cpu@
2ff057
%_host_vendor		@host_vendor@
2ff057
%_host_os		@host_os@
2ff057
%_target		%{_host}
2ff057
%_target_alias		%{_host_alias}
2ff057
%_target_cpu		%{_host_cpu}
2ff057
%_target_vendor		%{_host_vendor}
2ff057
%_target_os		%{_host_os}
2ff057
2ff057
#==============================================================================
2ff057
# ---- specfile macros.
2ff057
#	Macro(s) here can be used reliably for reproducible builds.
2ff057
#	(Note: Above is the goal, below are the macros under development)
2ff057
#
2ff057
# The configure macro runs autoconf configure script with platform specific
2ff057
# directory structure (--prefix, --libdir etc) and compiler flags
2ff057
# such as CFLAGS.
2ff057
#
2ff057
%_configure ./configure
2ff057
%configure \
2ff057
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
2ff057
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
2ff057
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
2ff057
  %{_configure} --host=%{_host} --build=%{_build} \\\
2ff057
	--program-prefix=%{?_program_prefix} \\\
2ff057
	--disable-dependency-tracking \\\
2ff057
	--prefix=%{_prefix} \\\
2ff057
	--exec-prefix=%{_exec_prefix} \\\
2ff057
	--bindir=%{_bindir} \\\
2ff057
	--sbindir=%{_sbindir} \\\
2ff057
	--sysconfdir=%{_sysconfdir} \\\
2ff057
	--datadir=%{_datadir} \\\
2ff057
	--includedir=%{_includedir} \\\
2ff057
	--libdir=%{_libdir} \\\
2ff057
	--libexecdir=%{_libexecdir} \\\
2ff057
	--localstatedir=%{_localstatedir} \\\
2ff057
	--sharedstatedir=%{_sharedstatedir} \\\
2ff057
	--mandir=%{_mandir} \\\
2ff057
	--infodir=%{_infodir}
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# Tested features of make
2ff057
# Output synchronization for parallel make:
2ff057
%_make_output_sync %(! %{__make} --version -O >/dev/null 2>&1 || echo -O)
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# The "make" analogue, hiding the _smp_mflags magic from specs
2ff057
%make_build %{__make} %{_make_output_sync} %{?_smp_mflags}
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# The make install analogue of %configure for modern autotools:
2ff057
%make_install %{__make} install DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# Former make install analogue, kept for compatibility and for old/broken
2ff057
#  packages that don't support DESTDIR properly.
2ff057
%makeinstall \
2ff057
  echo "warning: %%makeinstall is deprecated, try %%make_install instead" 1>&2\
2ff057
  %{__make} \\\
2ff057
	prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
2ff057
	exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
2ff057
	bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
2ff057
	sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
2ff057
	sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
2ff057
	datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
2ff057
	includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
2ff057
	libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
2ff057
	libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
2ff057
	localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
2ff057
	sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
2ff057
	mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
2ff057
	infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
2ff057
  install
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
2ff057
%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
2ff057
#
2ff057
# For example, these can be used as (from ImageMagick.spec from PLD site)
2ff057
#	[...]
2ff057
#	BuildPrereq: perl
2ff057
#	[...]
2ff057
#	%package perl
2ff057
#	Summary: libraries and modules for access to ImageMagick from perl
2ff057
#	Group: Development/Languages/Perl
2ff057
#	Requires: %{name} = %{version}
2ff057
#	%requires_eq    perl
2ff057
#	[...]
2ff057
#	%install
2ff057
#	rm -fr $RPM_BUILD_ROOT
2ff057
#	install -d $RPM_BUILD_ROOT/%{perl_sitearch}
2ff057
#	[...]
2ff057
#	%files perl
2ff057
#	%defattr(644,root,root,755)
2ff057
#	%{perl_sitearch}/Image
2ff057
#	%dir %{perl_sitearch}/auto/Image
2ff057
#
2ff057
%requires_eq()	%(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
2ff057
%perl_sitearch	%(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
2ff057
%perl_sitelib	%(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
2ff057
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
2ff057
%perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
2ff057
%perl_archlib	%(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
2ff057
%perl_privlib	%(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# Useful python macros for determining python version and paths
2ff057
#
2ff057
%python_sitelib %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitelib)
2ff057
%python_sitearch %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitearch)
2ff057
%python_version %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper version)
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all Intel i?86 compatible processors
2ff057
#  (Note: This macro (and it's analogues) will probably be obsoleted when
2ff057
#   rpm can use regular expressions against target platforms in macro
2ff057
#   conditionals.
2ff057
#
2ff057
%ix86   i386 i486 i586 i686 pentium3 pentium4 athlon geode
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all supported ARM processors
2ff057
%arm	armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for 32-bit MIPS processors
2ff057
%mips32	mips mipsel mipsr6 mipsr6el
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for 64-bit MIPS processors
2ff057
%mips64	mips64 mips64el mips64r6 mips64r6el
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for big endian MIPS processors
2ff057
%mipseb	mips mipsr6 mips64 mips64r6
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for little endian MIPS processors
2ff057
%mipsel	mipsel mipsr6el mips64el mips64r6el
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all supported MIPS processors
2ff057
%mips	%{mips32} %{mips64}
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all supported Sparc processors
2ff057
%sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all supported Alpha processors
2ff057
%alpha	alpha alphaev56 alphaev6 alphaev67
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# arch macro for all supported PowerPC 64 processors
2ff057
%power64	ppc64 ppc64p7 ppc64le
2ff057
2ff057
#------------------------------------------------------------------------
2ff057
# Use in %install to generate locale specific file lists. For example,
2ff057
#
2ff057
# %install
2ff057
# ...
2ff057
# %find_lang %{name}
2ff057
# ...
2ff057
# %files -f %{name}.lang
2ff057
#
2ff057
%find_lang	%{_rpmconfigdir}/find-lang.sh %{buildroot}
2ff057
2ff057
# Commands + opts to use for retrieving remote files
2ff057
# Proxy opts can be set through --httpproxy/--httpport popt aliases,
2ff057
# for any special local needs use %__urlhelper_localopts in system-wide
2ff057
# or per-user macro configuration.
2ff057
%__urlhelpercmd         @__CURL@
2ff057
%__urlhelperopts        --silent --show-error --fail --globoff --location -o
2ff057
%__urlhelper_proxyopts   %{?_httpproxy:--proxy %{_httpproxy}%{?_httpport::%{_httpport}}}%{!?_httpproxy:%{nil}}
2ff057
%_urlhelper             %{__urlhelpercmd} %{?__urlhelper_localopts} %{?__urlhelper_proxyopts} %{__urlhelperopts}
2ff057
2ff057
# Transaction plugin macros
2ff057
%__plugindir		%{_libdir}/rpm-plugins
2ff057
%__transaction_systemd_inhibit	%{__plugindir}/systemd_inhibit.so
2ff057
%__transaction_selinux		%{__plugindir}/selinux.so
2ff057
%__transaction_syslog		%{__plugindir}/syslog.so
2ff057
%__transaction_ima		%{__plugindir}/ima.so
Packit Service 5f2a3b
%__transaction_fapolicyd	%{__plugindir}/fapolicyd.so
2ff057
%__transaction_prioreset	%{__plugindir}/prioreset.so
2ff057
2ff057
#------------------------------------------------------------------------------
2ff057
# Macros for further automated spec %setup and patch application
2ff057
2ff057
# default to plain patch
2ff057
%__scm patch
2ff057
# meh, figure something saner
2ff057
%__scm_username rpm-build
2ff057
%__scm_usermail <rpm-build>
2ff057
%__scm_author %{__scm_username} %{__scm_usermail}
2ff057
2ff057
# Plain patch (-m is unused)
2ff057
%__scm_setup_patch(q) %{nil}
2ff057
%__scm_apply_patch(qp:m:)\
2ff057
%{__patch} %{-p:-p%{-p*}} %{-q:-s} --fuzz=%{_default_patch_fuzz} %{_default_patch_flags}
2ff057
2ff057
# Plain patch with backups for gendiff
2ff057
%__scm_setup_gendiff(q) %{nil}
2ff057
%__scm_apply_gendiff(qp:m:)\
2ff057
%{__patch} %{-p:-p%{-p*}} %{-q:-s} --fuzz=%{_default_patch_fuzz} %{_default_patch_flags} -b --suffix ".%{2}"
2ff057
2ff057
# Mercurial (aka hg)
2ff057
%__scm_setup_hg(q)\
2ff057
%{__hg} init %{-q} .\
2ff057
%{__hg} add %{-q} .\
2ff057
%{__hg} commit %{-q} --user "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
2ff057
2ff057
%__scm_apply_hg(qp:m:)\
2ff057
%{__hg} import - %{-p:-p%{-p*}} %{-q} -m %{-m*} --user "%{__scm_author}"
2ff057
2ff057
# Git
2ff057
%__scm_setup_git(q)\
2ff057
%{__git} init %{-q}\
2ff057
%{__git} config user.name "%{__scm_username}"\
2ff057
%{__git} config user.email "%{__scm_usermail}"\
2ff057
%{__git} add .\
2ff057
%{__git} commit %{-q} --allow-empty -a\\\
2ff057
	--author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
2ff057
2ff057
%__scm_apply_git(qp:m:)\
2ff057
%{__git} apply --index %{-p:-p%{-p*}} -\
2ff057
%{__git} commit %{-q} -m %{-m*} --author "%{__scm_author}"
2ff057
2ff057
# Git, using "git am" (-m is unused)
2ff057
%__scm_setup_git_am(q)\
2ff057
%{expand:%__scm_setup_git %{-q}}
2ff057
2ff057
%__scm_apply_git_am(qp:m:)\
2ff057
%{__git} am %{-q} %{-p:-p%{-p*}}
2ff057
2ff057
# Quilt
2ff057
%__scm_setup_quilt(q) %{nil}
2ff057
%__scm_apply_quilt(qp:m:)\
2ff057
%{__quilt} import %{-p:-p%{-p*}} %{1} && %{__quilt} push %{-q}
2ff057
2ff057
# Bzr
2ff057
%__scm_setup_bzr(q)\
2ff057
%{__bzr} init %{-q}\
2ff057
%{__bzr} whoami --branch "%{__scm_author}"\
2ff057
%{__bzr} add .\
2ff057
%{__bzr} commit %{-q} -m "%{NAME}-%{VERSION} base"
2ff057
2ff057
# bzr doesn't seem to have its own command to apply patches?
2ff057
%__scm_apply_bzr(qp:m:)\
2ff057
%{__patch} %{-p:-p%{-p*}} %{-q:-s}\
2ff057
%{__bzr} commit %{-q} -m %{-m*}
2ff057
2ff057
# Single patch application
2ff057
%apply_patch(qp:m:)\
2ff057
%{lua:\
2ff057
local file = rpm.expand("%{1}")\
2ff057
local num = rpm.expand("%{2}")\
2ff057
if posix.access(file, "r") then\
2ff057
    local options = rpm.expand("%{-q} %{-p:-p%{-p*}} %{-m:-m%{-m*}}")\
2ff057
    local scm_apply = rpm.expand("%__scm_apply_%{__scm}")\
2ff057
    print(rpm.expand("%{uncompress:"..file.."} | "..scm_apply.." "..options.."  "..file.." "..num.."\\n"))\
2ff057
else\
2ff057
    print("echo 'Cannot read "..file.."'; exit 1;".."\\n")\
2ff057
end}
2ff057
2ff057
# Automatically apply all patches
Packit Service 204b01
# -m<min>       Apply patches with number >= min only
Packit Service 204b01
# -M<max>       Apply patches with number <= max only
Packit Service 204b01
%autopatch(vp:m:M:)\
2ff057
%{lua:\
2ff057
local options = rpm.expand("%{!-v:-q} %{-p:-p%{-p*}} ")\
Packit Service 204b01
local low_limit = tonumber(rpm.expand("%{-m:%{-m*}}"))\
Packit Service 204b01
local high_limit = tonumber(rpm.expand("%{-M:%{-M*}}"))\
2ff057
for i, p in ipairs(patches) do\
Packit Service 204b01
    local inum = patch_nums[i]\
Packit Service 204b01
    if ((not low_limit or inum>=low_limit) and (not high_limit or inum<=high_limit)) \
Packit Service 204b01
    then\
Packit Service 204b01
        print(rpm.expand("%apply_patch -m %{basename:"..p.."}  "..options..p.." "..i.."\\n")) \
Packit Service 204b01
    end\
2ff057
end}
2ff057
2ff057
# One macro to (optionally) do it all.
2ff057
# -S<scm name>	Sets the used patch application style, eg '-S git' enables
2ff057
#           	usage of git repository and per-patch commits.
2ff057
# -N		Disable automatic patch application
2ff057
# -p<num>	Use -p<num> for patch application	
2ff057
%autosetup(a:b:cDn:TvNS:p:)\
2ff057
%setup %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{!-v:-q}\
2ff057
%{-S:%global __scm %{-S*}}\
2ff057
%{expand:%__scm_setup_%{__scm} %{!-v:-q}}\
2ff057
%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
2ff057
2ff057
# \endverbatim
2ff057
#*/