1 #/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
4 # This is a global RPM configuration file. All changes made here will
5 # be lost when the rpm package is upgraded. Any per-system configuration
6 # should be added to /etc/rpm/macros, while per-user configuration should
7 # be added to ~/.rpmmacros.
10 #==============================================================================
11 # ---- A macro that expands to nothing.
15 #==============================================================================
16 # ---- filesystem macros.
22 #==============================================================================
23 # ---- Generally useful path macros.
40 %__install @__INSTALL@
44 # Deprecated, use %__xz instead.
45 %__lzma %__xz --format=lzma
49 %__mkdir_p @__MKDIR_P@
54 %__restorecon @__RESTORECON@
58 %__semodule @__SEMODULE@
69 #==============================================================================
70 # ---- Build system path macros.
79 %__objcopy @__OBJCOPY@
80 %__objdump @__OBJDUMP@
85 # XXX avoid failures if tools are not installed when rpm is built.
86 %__libtoolize libtoolize
88 %__autoheader autoheader
92 #==============================================================================
93 # Conditional build stuff.
95 # Check if symbol is defined.
96 # Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
97 %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
98 %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
100 # Shorthand for %{defined with_...}
101 %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
102 %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
104 # Handle conditional builds. %bcond_with is for case when feature is
105 # default off and needs to be activated with --with ... command line
106 # switch. %bcond_without is for the dual case.
108 # %bcond_with foo defines symbol with_foo if --with foo was specified on
110 # %bcond_without foo defines symbol with_foo if --without foo was *not*
111 # specified on command line.
113 # For example (spec file):
116 # %bcond_with extra_fonts
117 # %bcond_without static
119 # %if %{with extra_fonts}
124 # %if ! %{with static}
130 # %{?with_static: ... }
131 # %{!?with_static: ... }
132 # %{?with_extra_fonts: ... }
133 # %{!?with_extra_fonts: ... }
136 # The bottom line: never use without_foo, _with_foo nor _without_foo, only
137 # with_foo. This way changing default set of bconds for given spec is just
138 # a matter of changing single line in it and syntax is more readable.
139 %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
140 %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
142 #==============================================================================
143 # ---- Required rpmrc macros.
144 # Macros that used to be initialized as a side effect of rpmrc parsing.
145 # These are the default values that can be overridden by other
146 # (e.g. per-platform, per-system, per-packager, per-package) macros.
148 # The directory where rpm's configuration and scripts live
149 %_rpmconfigdir %{getconfdir}
150 # The directory where rpm's macro files live
151 %_rpmmacrodir %{_rpmconfigdir}/macros.d
153 # The directory where sources/patches will be unpacked and built.
154 %_builddir %{_topdir}/BUILD
156 # The interpreter used for build scriptlets.
159 # The path to the bzip2 executable (legacy, use %{__bzip2} instead).
160 %_bzip2bin %{__bzip2}
162 # The location of the rpm database file(s).
163 %_dbpath %{_var}/lib/rpm
165 # The location of the rpm database file(s) after "rpm --rebuilddb".
166 %_dbpath_rebuild %{_dbpath}
168 %_keyringpath %{_dbpath}/pubkeys/
171 # Path to script that creates debug symbols in a /usr/lib/debug
174 # A spec file can %%define _find_debuginfo_opts to pass options to
175 # the script. See the script for details.
178 %_find_debuginfo_opts %{?_rpm_strip_disable:--strip-disable}
179 %_find_debuginfo_strip_opts %{?_rpm_strip_option:\'--strip-option=%{_rpm_strip_option}\'}
180 %_find_debuginfo_ko_strip_opts %{?_rpm_ko_strip_option:\'--strip-ko-option=%{_rpm_ko_strip_option}\'}
182 %__debug_install_post \
183 %{_rpmconfigdir}/find-debuginfo.sh \\\
185 %{?_missing_build_ids_terminate_build:--strict-build-id} \\\
186 %{?_no_recompute_build_ids:-n} \\\
187 %{?_include_minidebuginfo:-m} \\\
188 %{?_include_gdb_index:-i} \\\
189 %{?_unique_build_ids:--build-id-seed "%{VERSION}-%{RELEASE}"} \\\
190 %{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
191 %{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
192 %{?_find_debuginfo_dwz_opts} \\\
193 %{?_find_debuginfo_opts} \\\
194 %{?_find_debuginfo_strip_opts} \\\
195 %{?_find_debuginfo_ko_strip_opts} \\\
196 %{?_debugsource_packages:-S debugsourcefiles.list} \\\
197 "%{_builddir}/%{?buildsubdir}"\\\
198 %{?_install_debug_manifest} \
201 # Template for debug information sub-package.
202 %_debuginfo_template \
204 Summary: Debug information for package %{name}\
205 Group: Development/Debug\
208 %description debuginfo\
209 This package provides debug information for package %{name}.\
210 Debug information is useful when developing applications that use this\
211 package or when debugging this package.\
212 %files debuginfo -f debugfiles.list\
215 %_debugsource_template \
216 %package debugsource\
217 Summary: Debug sources for package %{name}\
218 Group: Development/Debug\
220 %description debugsource\
221 This package provides debug sources for package %{name}.\
222 Debug sources are useful when developing applications that use this\
223 package or when debugging this package.\
224 %files debugsource -f debugsourcefiles.list\
225 %defattr(-,root,root)\
226 %manifest %{name}-debugsource.manifest \
231 %global __debug_package 1\
232 %_debuginfo_template\
233 %{?_debugsource_packages:%_debugsource_template}\
237 %_defaultdocdir %{_datadir}/doc/packages
238 %_docdir_fmt %%{NAME}
239 %_defaultlicensedir %{_datadir}/licenses
241 # Following macros for filtering auto deps must not be used in spec files.
242 # Their purpouse is to set up global filtering for all packages. If you need
243 # to set up specific filtering for your package use %__requires_exclude_from
244 # and %__provides_exclude_from instead.
245 %__global_requires_exclude_from %{?_docdir:%{_docdir}}
246 %__global_provides_exclude_from %{?_docdir:%{_docdir}}
248 # The path to the gzip executable (legacy, use %{__gzip} instead).
251 # The Unix time of the latest kept changelog entry in binary packages.
252 # Any older entry is not packaged in binary packages.
253 %_changelog_trimtime 0
255 # If true, set the SOURCE_DATE_EPOCH environment variable
256 # to the timestamp of the topmost changelog entry
257 %source_date_epoch_from_changelog 0
259 # If true, make sure that timestamps in built rpms
260 # are not later than the value of SOURCE_DATE_EPOCH.
261 # Is ignored when SOURCE_DATE_EPOCH is not set.
262 %clamp_mtime_to_source_date_epoch 0
264 # The directory where newly built binary packages will be written.
265 %_rpmdir %{_topdir}/RPMS
267 # A template used to generate the output binary package file name
269 %_rpmfilename %{_build_name_fmt}
271 # The directory where sources/patches from a source package will be
272 # installed. This is also where sources/patches are found when building.
273 %_sourcedir %{_topdir}/SOURCES
275 # The directory where the spec file from a source package will be
277 %_specdir %{_topdir}/SPECS
279 # The directory where newly built source packages will be written.
280 %_srcrpmdir %{_topdir}/SRPMS
282 # The directory where buildroots will be created.
283 %_buildrootdir %{_topdir}/BUILDROOT
285 # Build root path, where %install installs the package during build.
286 %buildroot %{_buildrootdir}/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}
288 # Directory where temporaray files can be created.
289 %_tmppath %{_var}/tmp
291 # Path to top of build area.
292 %_topdir %{expand:%%global _topdir %{lua:if posix.access(rpm.expand("%{_usrsrc}/packages"), "w") then print "%{_usrsrc}/packages" else print "%{getenv:HOME}/rpmbuild" end} \
295 # The path to the unzip executable (legacy, use %{__unzip} instead).
296 %_unzipbin %{__unzip}
298 #==============================================================================
299 # ---- Optional rpmrc macros.
300 # Macros that are initialized as a side effect of rpmrc and/or spec
303 # The sub-directory (relative to %{_builddir}) where sources are compiled.
304 # This macro is set after processing %setup, either explicitly from the
305 # value given to -n or the default name-version.
309 # Configurable distribution information, same as Distribution: tag in a
314 # Configurable distribution URL, same as DistURL: tag in a specfile.
315 # The URL will be used to supply reliable information to tools like
318 # Note: You should not configure with disturl (or build packages with
319 # the DistURL: tag) unless you are willing to supply content in a
320 # yet-to-be-determined format at the URL specified.
324 # Configurable bug URL, same as BugURL: tag in a specfile.
325 # The URL will be used to supply reliable information to where
330 # Configurable distribution tag, same as Disttag: tag in a specfile.
331 # The tag will be used to supply reliable information to tools like
334 # Note: You should not configure with disturl (or build packages with
335 # the Disttag: tag) unless you are willing to supply content in a
336 # yet-to-be-determined format at the tag specified.
340 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
341 # marked as %doc should be installed.
344 # The port and machine name of a FTP proxy host running TIS firewall.
349 # The signature to use and the location of configuration files for
350 # signing packages with GNU gpg.
355 # The port and machine name of an HTTP proxy host.
360 # The PATH put into the environment before running %pre/%post et al.
362 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
364 # A colon separated list of desired locales to be installed;
365 # "all" means install all locale specific files.
369 # The value of CLASSPATH in build scriptlets (iff configured).
373 # Import packaging conventions from jpackage.org (prefixed with _
374 # to avoid name collisions).
376 %_javadir %{_datadir}/java
377 %_javadocdir %{_datadir}/javadoc
379 # A colon separated list of paths where files should *not* be installed.
380 # Usually, these are network file system mount points.
385 # The type of pattern match used on rpmdb iterator selectors:
386 # "default" simple glob-like regex, periods will be escaped,
387 # splats will have period prepended, full "^...$" match
388 # required. Also, file path tags will use glob(7).
389 # "strcmp" compare strings
390 # "regex" regex(7) patterns using regcomp(3)/regexec(3)
391 # "glob" glob(7) patterns using fnmatch(3)
393 %_query_selector_match default
395 # Configurable packager information, same as Packager: in a specfile.
399 # Compression type and level for source/binary package payloads.
400 # "w9.gzdio" gzip level 9 (default).
401 # "w9.bzdio" bzip2 level 9.
402 # "w6.xzdio" xz level 6, xz's default.
403 # "w7T16.xzdio" xz level 7 using 16 thread (xz only)
404 # "w6.lzdio" lzma-alone level 6, lzma's default
405 # "w3.zstdio" zstd level 3, zstd's default
406 # "w.ufdio" uncompressed
408 #%_source_payload w9.gzdio
409 #%_binary_payload w9.gzdio
410 %_binary_payload w19.zstdio
412 # Algorithm to use for generating file checksum digests on build.
413 # If not specified or 0, MD5 is used.
414 # WARNING: non-MD5 is backwards incompatible with rpm < 4.6!
415 # The supported algorithms may depend on the underlying crypto
416 # implementation but generally at least the following are supported:
423 %_source_filedigest_algorithm 8
424 %_binary_filedigest_algorithm 8
426 # Configurable vendor information, same as Vendor: in a specfile.
430 # Default fuzz level for %patch in spec file.
431 %_default_patch_fuzz 0
433 # Default patch flags
434 #%_default_patch_flags -s
435 %_default_patch_flags --no-backup-if-mismatch
437 #==============================================================================
438 # ---- Build configuration macros.
440 # Script gets packaged file list on input and buildroot as first parameter.
441 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
443 # Note: Disable (by commenting out) for legacy compatibility.
444 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
447 # Should unpackaged files in a build root terminate a build?
449 # Note: The default value should be 0 for legacy compatibility.
450 %_unpackaged_files_terminate_build 1
453 # Should missing %doc files in the build directory terminate a build?
455 # Note: The default value should be 0 for legacy compatibility.
456 %_missing_doc_files_terminate_build 1
459 # Should empty %files manifest file terminate a build?
461 # Note: The default value should be 0 for legacy compatibility.
462 %_empty_manifest_terminate_build 0
465 # Should binaries in noarch packages terminate a build?
466 %_binaries_in_noarch_packages_terminate_build 1
468 # Should invalid utf8 encoding in package metadata terminate a build?
469 %_invalid_encoding_terminates_build 0
471 # Should invalid version format in requires, provides, ... terminate a build?
472 %_wrong_version_format_terminate_build 0
475 # Should rpm try to download missing sources at build-time?
476 # Enabling this is dangerous as long as rpm has no means to validate
477 # the integrity of the download with a digest or signature.
478 %_disable_source_fetch 1
481 # Program to call for each successfully built and written binary package.
482 # The package name is passed to the program as a command-line argument.
484 #%_build_pkgcheck %{_bindir}/rpmlint
487 # Program to call for the whole binary package set after build.
488 # The package set is passed to the program via command-line arguments.
490 #%_build_pkgcheck_set %{_bindir}/rpmlint
493 # Program to call for successfully built and written SRPM.
494 # The package name is passed to the program as a command-line argument.
496 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
499 # Should the build of packages fail if package checker (if defined) returns
500 # non-zero exit status?
502 #%_nonzero_exit_pkgcheck_terminate_build 1
505 # Should an ELF file processed by find-debuginfo.sh having no build ID
506 # terminate a build? This is left undefined to disable it and defined to
509 #%_missing_build_ids_terminate_build 1
512 # Include minimal debug information in build binaries.
513 # Requires _enable_debug_packages.
515 #%_include_minidebuginfo 1
518 # Include a .gdb_index section in the .debug files.
519 # Requires _enable_debug_packages and gdb-add-index installed.
521 #%_include_gdb_index 1
524 # Defines how and if build_id links are generated for ELF files.
525 # The following settings are supported:
528 # No build_id links are generated.
531 # build_id links are generated only when the __debug_package global is
532 # defined. This will generate build_id links in the -debuginfo package
533 # for both the main file as /usr/lib/debug/.build-id/xx/yyy and for
534 # the .debug file as /usr/lib/debug/.build-id/xx/yyy.debug.
535 # This is the old style build_id links as generated by the original
536 # find-debuginfo.sh script.
539 # build_id links are generate for all binary packages. If this is a
540 # main package (the __debug_package global isn't set) then the
541 # build_id link is generated as /usr/lib/.build-id/xx/yyy. If this is
542 # a -debuginfo package (the __debug_package global is set) then the
543 # build_id link is generated as /usr/lib/debug/.build-id/xx/yyy.
546 # Same as for "separate" but if the __debug_package global is set then
547 # the -debuginfo package will have a compatibility link for the main
548 # ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy
549 %_build_id_links alldebug
551 # Whether build-ids should be made unique between package version/releases
552 # when generating debuginfo packages. If set to 1 this will pass
553 # --build-id-seed "%{VERSION}-%{RELEASE}" to find-debuginfo.sh which will
554 # pass it onto debugedit --build-id-seed to be used to prime the build-id
558 # Do not recompute build-ids but keep whatever is in the ELF file already.
559 # Cannot be used together with _unique_build_ids (which forces recomputation).
560 # Defaults to undefined (unset).
561 #%_no_recompute_build_ids 1
563 # Whether .debug files should be made unique between package version,
564 # release and architecture. If set to 1 this will pass
565 # --unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch} find-debuginfo.sh
566 # to create debuginfo files which end in -<ver>-<rel>.<arch>.debug
567 # Requires _unique_build_ids.
568 #%_unique_debug_names 0
570 # Whether the /usr/debug/src/<package> directories should be unique between
571 # package version, release and architecture. If set to 1 this will pass
572 # --unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}" to
573 # find-debuginfo.sh to name the directory under /usr/debug/src as
574 # <name>-<ver>-<rel>.<arch>.
575 %_unique_debug_srcs 1
577 # Whether rpm should put debug source files into its own subpackage
578 %_debugsource_packages 1
580 # Whether rpm should create extra debuginfo packages for each subpackage
581 %_debuginfo_subpackages 1
584 # Use internal dependency generator rather than external helpers?
585 %_use_internal_dependency_generator 1
588 # Filter GLIBC_PRIVATE Provides: and Requires:
589 %_filter_GLIBC_PRIVATE 0
591 # Directories whose contents should be considered as documentation.
592 %__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
594 # maxnum,cuttime,minnum
595 # 2014/10/13 (SLES12 GA)
596 %_binarychangelogtrim 0,1413151200,10
599 # Path to scripts to autogenerate package dependencies,
601 %__set_helper_env %{lua:
602 posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile"));
603 posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
605 # Note: Used iff _use_internal_dependency_generator is zero.
606 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
607 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
608 %__find_provides %{_rpmconfigdir}/find-provides %name
609 %__find_requires %{_rpmconfigdir}/find-requires %name
610 #%__find_conflicts ???
611 #%__find_obsoletes ???
612 %__find_supplements %{_rpmconfigdir}/find-supplements %name
613 #%__find_enhances ???
616 # Path to file attribute classifications for automatic dependency
617 # extraction, used when _use_internal_dependency_generator
618 # is used (on by default). Files can have any number of attributes
619 # attached to them, and dependencies are separately extracted for
622 # To define a new file attribute called "myattr", add a file named
623 # "myattr" to this directory, defining the requires and/or provides
624 # finder script(s) + magic and/or path pattern regex(es).
625 # provides finder and
626 # %__myattr_requires path + args to requires finder script for <myattr>
627 # %__myattr_provides path + args to provides finder script for <myattr>
628 # %__myattr_magic libmagic classification match regex
629 # %__myattr_path path based classification match regex
630 # %__myattr_flags flags to control behavior (just "exeonly" for now)
631 # %__myattr_exclude_magic exclude by magic regex
632 # %__myattr_exclude_path exclude by path regex
634 %_fileattrsdir %{_rpmconfigdir}/fileattrs
636 # This macro defines how much space (in bytes) in package should be
637 # reserved for gpg signatures during building of a package. If this space is
638 # big enough for gpg signatures to fit into it then signing of the packages is
639 # very quick because it is not necessary to rewrite the whole package to make
640 # some space for gpg signatures.
641 %__gpg_reserved_space 4096
643 #==============================================================================
644 # ---- Database configuration macros.
646 # Select backend database. The following values are supported:
648 # lmdb Lightning Memory-mapped Database
649 # ndb new data base format
654 # Macros used to configure Berkley db parameters.
656 # rpmdb macro configuration values are a colon (or white space) separated
657 # list of tokens, with an optional '!' negation to explicitly disable bit
658 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
659 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
660 # (e.g. %_dbi_config).
662 # Here's a short list of the tokens, with a guess of whether the option is
664 # (nothing) currently used in rpm, known to work.
665 # "+++" under development, will be supported in rpm eventually.
666 # "???" I have no clue, you're mostly on your own.
668 # If you do find yourself inclined to fiddle, here's what I see (shrug):
669 # 1) Only the value of mp_size has any serious impact on overall performance,
670 # and you will need ~256Kb to handle a typical machine install.
671 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
672 # will ever need tuning. Diddle the pagesize if you're interested, although
673 # I believe that you will find pagesize=512 "best".
674 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
675 # and/or mp_size instead.
677 # token works? Berkeley db flag or value
678 #==================================================
679 #---------------------- DBENV tunable values:
680 # mmapsize=16Mb DBENV->set_mp_mmapsize
681 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
682 #---------------------- DB->open bits:
683 # nommap ??? DB_NOMMAP
684 #----------------------- rpmdb specific configuration:
685 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
686 # nofsync Disable fsync(2) call performed after db3 writes?
689 # Misc BDB tuning options
690 %__dbi_other mp_mmapsize=128Mb mp_size=1Mb
692 %_dbi_config %{?__dbi_other} nofsync
694 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
695 %_dbi_config_Packages %{?__dbi_other} lockdbfd
697 #==============================================================================
698 # ---- GPG/PGP/PGP5 signature macros.
699 # Macro(s) to hold the arguments passed to GPG/PGP for package
700 # signing and verification.
703 %__gpg_sign_cmd %{__gpg} \
704 gpg --no-verbose --no-armor \
705 %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \
706 --no-secmem-warning \
707 %{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
708 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
710 # XXX rpm >= 4.1 verifies signatures internally
711 #%__gpg_verify_cmd %{__gpg} \
712 # gpg --batch --no-verbose --verify --no-secmem-warning \
713 # %{__signature_filename} %{__plaintext_filename}
715 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
716 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
717 # with the prelink package. If the macro is undefined, then prelinked
718 # shared libraries contents are MD5 digest verified (as usual), rather
719 # than MD5 verifying the output of the prelink undo helper.
721 # Note: The 2nd token is used as argv[0] and "library" is a
722 # placeholder that will be deleted and replaced with the appropriate
724 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
726 # Horowitz Key Protocol server configuration
728 %_hkp_keyserver http://pgp.mit.edu
729 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
731 #==============================================================================
732 # ---- Transaction macros.
733 # Macro(s) used to parameterize transactions.
735 # The output binary package file name template used when building
738 # XXX Note: escaped %% for use in headerSprintf()
739 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
741 # Verify digest/signature flags for various rpm modes:
742 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
743 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
744 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
745 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
747 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
748 # digest/signature checking, disables signature checking, but attempts
749 # digest checking, also when retrieving headers from the database.
752 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
755 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
757 # at the python prompt for example, after "import rpm".
759 # The checking overhead is ~11ms per header for digests/signatures;
760 # each header from the database is checked only when first encountered
761 # for each database open.
763 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
767 %_vsflags_build %{__vsflags}
768 %_vsflags_erase %{__vsflags}
769 %_vsflags_install %{__vsflags}
770 %_vsflags_query %{__vsflags}
771 %_vsflags_rebuilddb 0xc0c00
772 %_vsflags_verify %{__vsflags}
774 # Set to 1 to minimize writing (at the cost of more reads) to
775 # conserve eg SSD disks.
778 # Set to 1 to flush file IO during transactions (at a severe cost in
779 # performance for rotational disks)
783 # Default output format string for rpm -qa
785 # XXX Note: escaped %% for use in headerFormat()
786 %_query_all_fmt %%{nvra}
789 # Default for coloring output
790 # valid values are always never and auto
794 # Default path to the file used for transaction fcntl lock.
795 %_rpmlock_path %{_dbpath}/.rpm.lock
798 # ISA dependency marker, none for noarch and name-bitness for others
799 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
802 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
803 %__arch_install_post %{nil}
804 %__os_install_post %{___build_post}
806 # Macro to fix broken permissions in sources
807 %_fixperms %{__chmod} -Rf @FIXPERMS@
809 #==============================================================================
810 # ---- Scriptlet template templates.
811 # Global defaults used for building scriptlet templates.
814 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
816 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
818 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
819 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
820 RPM_OPT_FLAGS=\"%{optflags}\"\
821 RPM_ARCH=\"%{_arch}\"\
823 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
824 RPM_DOC_DIR=\"%{_docdir}\"\
826 RPM_PACKAGE_NAME=\"%{NAME}\"\
827 RPM_PACKAGE_VERSION=\"%{VERSION}\"\
828 RPM_PACKAGE_RELEASE=\"%{RELEASE}\"\
829 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
832 unset CDPATH DISPLAY ||:\
833 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
834 export RPM_BUILD_ROOT}\
835 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
837 PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
838 export PKG_CONFIG_PATH\
840 %{verbose:set -x}%{!verbose:exec > /dev/null}\
842 cd \"%{u2p:%{_builddir}}\"\
845 #%___build_body %{nil}
846 %___build_post exit $?
848 %___build_template #!%{___build_shell}\
856 #==============================================================================
857 # ---- Scriptlet templates.
858 # Macro(s) that expand to a command and script that is executed.
860 %__spec_prep_shell %{___build_shell}
861 %__spec_prep_args %{___build_args}
862 %__spec_prep_cmd %{___build_cmd}
863 %__spec_prep_pre %{___build_pre}
864 %__spec_prep_body %{___build_body}
865 %__spec_prep_post %{___build_post}
866 %__spec_prep_template #!%{__spec_prep_shell}\
870 #%{__spec_prep_body}\
871 #%{__spec_prep_post}\
874 %__spec_build_shell %{___build_shell}
875 %__spec_build_args %{___build_args}
876 %__spec_build_cmd %{___build_cmd}
877 %__spec_build_pre %{___build_pre}
878 %__spec_build_body %{___build_body}
879 %__spec_build_post %{___build_post}
880 %__spec_build_template #!%{__spec_build_shell}\
884 #%{__spec_build_body}\
885 #%{__spec_build_post}\
888 %__spec_install_shell %{___build_shell}
889 %__spec_install_args %{___build_args}
890 %__spec_install_cmd %{___build_cmd}
891 %__spec_install_pre %{___build_pre}
892 %__spec_install_body %{___build_body}
893 %__spec_install_post\
894 %{?__debug_package:%{__debug_install_post}}\
895 %{__arch_install_post}\
896 %{__os_install_post}\
898 %__spec_install_template #!%{__spec_install_shell}\
899 %{__spec_install_pre}\
902 #%{__spec_install_body}\
903 #%{__spec_install_post}\
906 %__spec_check_shell %{___build_shell}
907 %__spec_check_args %{___build_args}
908 %__spec_check_cmd %{___build_cmd}
909 %__spec_check_pre %{___build_pre}
910 %__spec_check_body %{___build_body}
911 %__spec_check_post %{___build_post}
912 %__spec_check_template #!%{__spec_check_shell}\
916 #%{__spec_check_body}\
917 #%{__spec_check_post}\
920 #%__spec_autodep_shell %{___build_shell}
921 #%__spec_autodep_args %{___build_args}
922 #%__spec_autodep_cmd %{___build_cmd}
923 #%__spec_autodep_pre %{___build_pre}
924 #%__spec_autodep_body %{___build_body}
925 #%__spec_autodep_post %{___build_post}
926 #%__spec_autodep_template #!%{__spec_autodep_shell}\
927 #%{__spec_autodep_pre}\
930 #%{__spec_autodep_body}\
931 #%{__spec_autodep_post}\
934 %__spec_clean_shell %{___build_shell}
935 %__spec_clean_args %{___build_args}
936 %__spec_clean_cmd %{___build_cmd}
937 %__spec_clean_pre %{___build_pre}
938 %__spec_clean_body %{___build_body}
939 %__spec_clean_post %{___build_post}
940 %__spec_clean_template #!%{__spec_clean_shell}\
944 #%{__spec_clean_body}\
945 #%{__spec_clean_post}\
948 %__spec_rmbuild_shell %{___build_shell}
949 %__spec_rmbuild_args %{___build_args}
950 %__spec_rmbuild_cmd %{___build_cmd}
951 %__spec_rmbuild_pre %{___build_pre}
952 %__spec_rmbuild_body %{___build_body}
953 %__spec_rmbuild_post %{___build_post}
954 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
955 %{__spec_rmbuild_pre}\
958 #%{__spec_rmbuild_body}\
959 #%{__spec_rmbuild_post}\
962 # XXX We don't expand pre/post install scriptlets (yet).
963 #%__spec_pre_pre %{nil}
964 #%__spec_pre_post %{nil}
965 #%__spec_post_pre %{nil}
966 #%__spec_post_post %{nil}
967 #%__spec_preun_pre %{nil}
968 #%__spec_preun_post %{nil}
969 #%__spec_postun_pre %{nil}
970 #%__spec_postun_post %{nil}
971 #%__spec_triggerpostun_pre %{nil}
972 #%__spec_triggerpostun_post %{nil}
973 #%__spec_triggerun_pre %{nil}
974 #%__spec_triggerun_post %{nil}
975 #%__spec_triggerin_pre %{nil}
976 #%__spec_triggerin_post %{nil}
978 #==============================================================================
979 # ---- configure macros.
980 # Macro(s) slavishly copied from autoconf's config.status.
983 %_exec_prefix %{_prefix}
984 %_bindir %{_exec_prefix}/bin
985 %_sbindir %{_exec_prefix}/sbin
986 %_libexecdir %{_exec_prefix}/libexec
987 %_datadir %{_prefix}/share
989 %_sharedstatedir %{_prefix}/com
990 %_localstatedir %{_prefix}/var
992 %_libdir %{_exec_prefix}/%{_lib}
993 %_includedir %{_prefix}/include
994 %_infodir %{_datadir}/info
995 %_mandir %{_datadir}/man
998 %_hal_bindir %{_hal_prefix}/bin
999 %_hal_sbindir %{_hal_prefix}/sbin
1000 %_hal_libdir %{_hal_prefix}/%{_lib}
1001 %_hal_includedir %{_hal_prefix}/include
1002 %_hal_sysconfdir %{_hal_prefix}%{_sysconfdir}
1003 %_hal_datadir %{_hal_prefix}/share
1004 %_hal_licensedir %{_hal_prefix}/share/licenses
1006 #==============================================================================
1007 # ---- config.guess platform macros.
1008 # Macro(s) similar to the tokens used by configure.
1011 %_build_alias %{_host_alias}
1012 %_build_cpu %{_host_cpu}
1013 %_build_vendor %{_host_vendor}
1014 %_build_os %{_host_os}
1016 %_host_alias @host@%{nil}
1017 %_host_cpu @host_cpu@
1018 %_host_vendor @host_vendor@
1021 %_target_alias %{_host_alias}
1022 %_target_cpu %{_host_cpu}
1023 %_target_vendor %{_host_vendor}
1024 %_target_os %{_host_os}
1026 #==============================================================================
1027 # ---- specfile macros.
1028 # Macro(s) here can be used reliably for reproducible builds.
1029 # (Note: Above is the goal, below are the macros under development)
1031 # The configure macro runs autoconf configure script with platform specific
1032 # directory structure (--prefix, --libdir etc) and compiler flags
1035 %_configure ./configure
1037 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1038 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1039 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1040 %{_configure} --host=%{_host} --build=%{_build} \\\
1041 --program-prefix=%{?_program_prefix} \\\
1042 --disable-dependency-tracking \\\
1043 --prefix=%{_prefix} \\\
1044 --exec-prefix=%{_exec_prefix} \\\
1045 --bindir=%{_bindir} \\\
1046 --sbindir=%{_sbindir} \\\
1047 --sysconfdir=%{_sysconfdir} \\\
1048 --datadir=%{_datadir} \\\
1049 --includedir=%{_includedir} \\\
1050 --libdir=%{_libdir} \\\
1051 --libexecdir=%{_libexecdir} \\\
1052 --localstatedir=%{_localstatedir} \\\
1053 --sharedstatedir=%{_sharedstatedir} \\\
1054 --mandir=%{_mandir} \\\
1055 --infodir=%{_infodir} \\\
1056 --disable-dependency-tracking
1058 #------------------------------------------------------------------------------
1059 # Tested features of make
1060 # Output synchronization for parallel make:
1061 %_make_output_sync %(! %{__make} --version -O >/dev/null 2>&1 || echo -O)
1063 #------------------------------------------------------------------------------
1064 # The "make" analogue, hiding the _smp_mflags magic from specs
1065 %make_build %{__make} %{_make_output_sync} %{?_smp_mflags}
1067 #------------------------------------------------------------------------------
1068 # The make install analogue of %configure for modern autotools:
1069 %make_install %{__make} install DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
1071 #------------------------------------------------------------------------------
1072 # Former make install analogue, kept for compatibility and for old/broken
1073 # packages that don't support DESTDIR properly.
1075 echo "warning: %%makeinstall is deprecated, try %%make_install instead" 1>&2\
1077 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1078 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1079 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1080 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1081 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1082 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1083 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1084 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1085 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1086 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1087 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1088 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1089 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1092 #------------------------------------------------------------------------------
1093 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1094 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1096 #------------------------------------------------------------------------------
1097 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1099 # For example, these can be used as (from ImageMagick.spec from PLD site)
1104 # Summary: libraries and modules for access to ImageMagick from perl
1105 # Group: Development/Languages/Perl
1106 # Requires: %{name} = %{version}
1110 # rm -fr $RPM_BUILD_ROOT
1111 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1114 # %defattr(644,root,root,755)
1115 # %{perl_sitearch}/Image
1116 # %dir %{perl_sitearch}/auto/Image
1118 %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")
1119 %requires_ge() %(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")
1120 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1121 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1122 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1123 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1124 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1125 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1127 #------------------------------------------------------------------------------
1128 # Useful python macros for determining python version and paths
1130 %python_sitelib %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitelib)
1131 %python_sitearch %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitearch)
1132 %python_version %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper version)
1134 #------------------------------------------------------------------------------
1135 # arch macro for all Intel i?86 compatible processors
1136 # (Note: This macro (and it's analogues) will probably be obsoleted when
1137 # rpm can use regular expressions against target platforms in macro
1140 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1142 #------------------------------------------------------------------------------
1143 # arch macro for all supported ARM processors
1144 %arm armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
1146 #------------------------------------------------------------------------------
1147 # arch macro for 32-bit MIPS processors
1148 %mips32 mips mipsel mipsr6 mipsr6el
1150 #------------------------------------------------------------------------------
1151 # arch macro for 64-bit MIPS processors
1152 %mips64 mips64 mips64el mips64r6 mips64r6el
1154 #------------------------------------------------------------------------------
1155 # arch macro for big endian MIPS processors
1156 %mipseb mips mipsr6 mips64 mips64r6
1158 #------------------------------------------------------------------------------
1159 # arch macro for little endian MIPS processors
1160 %mipsel mipsel mipsr6el mips64el mips64r6el
1162 #------------------------------------------------------------------------------
1163 # arch macro for all supported MIPS processors
1164 %mips %{mips32} %{mips64}
1166 #------------------------------------------------------------------------------
1167 # arch macro for all supported Sparc processors
1168 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1170 #------------------------------------------------------------------------------
1171 # arch macro for all supported Alpha processors
1172 %alpha alpha alphaev56 alphaev6 alphaev67
1174 #------------------------------------------------------------------------------
1175 # arch macro for all supported PowerPC 64 processors
1176 %power64 ppc64 ppc64p7 ppc64le
1178 #------------------------------------------------------------------------
1179 # Use in %install to generate locale specific file lists. For example,
1183 # %find_lang %{name}
1185 # %files -f %{name}.lang
1187 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1188 %no_lang_C --without-C
1191 # Commands + opts to use for retrieving remote files
1192 # Proxy opts can be set through --httpproxy/--httpport popt aliases,
1193 # for any special local needs use %__urlhelper_localopts in system-wide
1194 # or per-user macro configuration.
1195 %__urlhelpercmd @__CURL@
1196 %__urlhelperopts --silent --show-error --fail --globoff --location -o
1197 %__urlhelper_proxyopts %{?_httpproxy:--proxy %{_httpproxy}%{?_httpport::%{_httpport}}}%{!?_httpproxy:%{nil}}
1198 %_urlhelper %{__urlhelpercmd} %{?__urlhelper_localopts} %{?__urlhelper_proxyopts} %{__urlhelperopts}
1200 # Transaction plugin macros
1201 %__plugindir %{_libdir}/rpm-plugins
1202 #%__transaction_systemd_inhibit %{__plugindir}/systemd_inhibit.so
1203 #%__transaction_selinux %{__plugindir}/selinux.so
1204 #%__transaction_syslog %{__plugindir}/syslog.so
1205 #%__transaction_ima %{__plugindir}/ima.so
1206 #%__transaction_prioreset %{__plugindir}/prioreset.so
1208 #------------------------------------------------------------------------------
1209 # transaction specific macros
1210 #%__transaction_plugins msm
1211 #%__plugindir %{_libdir}/rpm-plugins
1212 #%__transaction_msm %{__plugindir}/msm.so
1213 #%__transaction_msm_default_policy %{_libdir}/rpm-plugins/msm-device-sec-policy
1214 #------------------------------------------------------------------------------
1215 # Macros for further automated spec %setup and patch application
1217 # default to plain patch
1219 # meh, figure something saner
1220 %__scm_username rpm-build
1221 %__scm_usermail <rpm-build>
1222 %__scm_author %{__scm_username} %{__scm_usermail}
1224 # Plain patch (-m is unused)
1225 %__scm_setup_patch(q) %{nil}
1226 %__scm_apply_patch(qp:m:)\
1227 %{__patch} %{-p:-p%{-p*}} %{-q:-s} --fuzz=%{_default_patch_fuzz} %{_default_patch_flags}
1229 # Plain patch with backups for gendiff
1230 %__scm_setup_gendiff(q) %{nil}
1231 %__scm_apply_gendiff(qp:m:)\
1232 %{__patch} %{-p:-p%{-p*}} %{-q:-s} --fuzz=%{_default_patch_fuzz} %{_default_patch_flags} -b --suffix ".%{2}"
1234 # Mercurial (aka hg)
1236 %{__hg} init %{-q} .\
1237 %{__hg} add %{-q} .\
1238 %{__hg} commit %{-q} --user "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
1240 %__scm_apply_hg(qp:m:)\
1241 %{__hg} import - %{-p:-p%{-p*}} %{-q} -m %{-m*} --user "%{__scm_author}"
1244 %__scm_setup_git(q)\
1245 %{__git} init %{-q}\
1246 %{__git} config user.name "%{__scm_username}"\
1247 %{__git} config user.email "%{__scm_usermail}"\
1249 %{__git} commit %{-q} -a\\\
1250 --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
1252 %__scm_apply_git(qp:m:)\
1253 %{__git} apply --index %{-p:-p%{-p*}} -\
1254 %{__git} commit %{-q} -m %{-m*} --author "%{__scm_author}"
1256 # Git, using "git am" (-m is unused)
1257 %__scm_setup_git_am(q)\
1258 %{expand:%__scm_setup_git %{-q}}
1260 %__scm_apply_git_am(qp:m:)\
1261 %{__git} am %{-q} %{-p:-p%{-p*}}
1264 %__scm_setup_quilt(q) %{nil}
1265 %__scm_apply_quilt(qp:m:)\
1266 %{__quilt} import %{-p:-p%{-p*}} %{1} && %{__quilt} push %{-q}
1269 %__scm_setup_bzr(q)\
1270 %{__bzr} init %{-q}\
1271 %{__bzr} whoami --branch "%{__scm_author}"\
1273 %{__bzr} commit %{-q} -m "%{NAME}-%{VERSION} base"
1275 # bzr doesn't seem to have its own command to apply patches?
1276 %__scm_apply_bzr(qp:m:)\
1277 %{__patch} %{-p:-p%{-p*}} %{-q:-s}\
1278 %{__bzr} commit %{-q} -m %{-m*}
1280 # Single patch application
1281 %apply_patch(qp:m:)\
1283 local file = rpm.expand("%{1}")\
1284 local num = rpm.expand("%{2}")\
1285 if posix.access(file, "r") then\
1286 local options = rpm.expand("%{-q} %{-p:-p%{-p*}} %{-m:-m%{-m*}}")\
1287 local scm_apply = rpm.expand("%__scm_apply_%{__scm}")\
1288 print(rpm.expand("%{uncompress:"..file.."} | "..scm_apply.." "..options.." "..file.." "..num.."\\n"))\
1290 print("echo 'Cannot read "..file.."'; exit 1;".."\\n")\
1293 # Automatically apply all patches
1296 local options = rpm.expand("%{!-v:-q} %{-p:-p%{-p*}} ")\
1297 for i, p in ipairs(patches) do\
1298 print(rpm.expand("%apply_patch -m %{basename:"..p.."} "..options..p.." "..i.."\\n"))\
1301 # One macro to (optionally) do it all.
1302 # -S<scm name> Sets the used patch application style, eg '-S git' enables
1303 # usage of git repository and per-patch commits.
1304 # -N Disable automatic patch application
1305 # -p<num> Use -p<num> for patch application
1306 %autosetup(a:b:cDn:TvNS:p:)\
1307 %setup %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{!-v:-q}\
1308 %{-S:%global __scm %{-S*}}\
1309 %{expand:%__scm_setup_%{__scm} %{!-v:-q}}\
1310 %{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
1316 #------------------------------------------------------------------------
1317 # standard build service macros
1322 %info_add() test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
1325 %info_del() test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
1329 /usr/sbin/groupadd -o -r %{1} 2>/dev/null || :\
1330 /usr/sbin/useradd -o -r -g %{1} -d %{2} -s %{3} -c %{4} %{1} 2>/dev/null || :\