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.
9 #==============================================================================
10 # Macro naming conventions (preliminary):
12 # Macros that begin with an underscore are "local" in the sense that
13 # they (if used) will not be exported in rpm headers. Some macros
14 # that don't start with an underscore (but look like they should)
15 # are compatible with macros generated by rpm-2.5.x and will be made
16 # more consistent in a future release.
19 #==============================================================================
20 # ---- A macro that expands to nothing.
24 #==============================================================================
25 # ---- filesystem macros.
31 #==============================================================================
32 # ---- Generally useful path macros.
47 %__install @__INSTALL@
49 # Deprecated, use %__xz instead.
50 %__lzma %__xz --format=lzma
66 #==============================================================================
67 # ---- Build system path macros.
76 %__objcopy @__OBJCOPY@
77 %__objdump @__OBJDUMP@
82 # XXX avoid failures if tools are not installed when rpm is built.
83 %__libtoolize libtoolize
85 %__autoheader autoheader
89 #==============================================================================
90 # Conditional build stuff.
92 # Check if symbol is defined.
93 # Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
94 %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
95 %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
97 # Shorthand for %{defined with_...}
98 %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
99 %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
101 # Handle conditional builds. %bcond_with is for case when feature is
102 # default off and needs to be activated with --with ... command line
103 # switch. %bcond_without is for the dual case.
105 # %bcond_with foo defines symbol with_foo if --with foo was specified on
107 # %bcond_without foo defines symbol with_foo if --without foo was *not*
108 # specified on command line.
110 # For example (spec file):
113 # %bcond_with extra_fonts
114 # %bcond_without static
116 # %if %{with extra_fonts}
121 # %if ! %{with static}
124 # %ifdef %{with static}
127 # %{?with_static: ... }
128 # %{!?with_static: ... }
129 # %{?with_extra_fonts: ... }
130 # %{!?with_extra_fonts: ... }
133 # The bottom line: never use without_foo, _with_foo nor _without_foo, only
134 # with_foo. This way changing default set of bconds for given spec is just
135 # a matter of changing single line in it and syntax is more readable.
136 %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
137 %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
139 #==============================================================================
140 # ---- Required rpmrc macros.
141 # Macros that used to be initialized as a side effect of rpmrc parsing.
142 # These are the default values that can be overridden by other
143 # (e.g. per-platform, per-system, per-packager, per-package) macros.
145 # The directory where rpm's configuration and scripts live
146 %_rpmconfigdir %{getconfdir}
148 # The directory where sources/patches will be unpacked and built.
149 %_builddir %{_topdir}/BUILD
151 # The interpreter used for build scriptlets.
154 # The path to the bzip2 executable (legacy, use %{__bzip2} instead).
155 %_bzip2bin %{__bzip2}
157 # The location of the rpm database file(s).
158 %_dbpath %{_var}/lib/rpm
160 # The location of the rpm database file(s) after "rpm --rebuilddb".
161 %_dbpath_rebuild %{_dbpath}
163 %_keyringpath %{_dbpath}/pubkeys/
166 # Path to script that creates debug symbols in a /usr/lib/debug
169 # A spec file can %%define _find_debuginfo_opts to pass options to
170 # the script. See the script for details.
172 %__debug_install_post \
173 %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
176 # Template for debug information sub-package.
179 %global __debug_package 1\
181 Summary: Debug information for package %{name}\
182 Group: Development/Debug\
185 This package provides debug information for package %{name}.\
186 Debug information is useful when developing applications that use this\
187 package or when debugging this package.\
188 %files debug -f debugfiles.list\
189 %defattr(-,root,root)\
193 %_defaultdocdir %{_datadir}/doc
195 # The path to the gzip executable (legacy, use %{__gzip} instead).
198 # The Unix time of the latest kept changelog entry in binary packages.
199 # Any older entry is not packaged in binary packages.
200 %_changelog_trimtime 0
202 # The directory where newly built binary packages will be written.
203 %_rpmdir %{_topdir}/RPMS
205 # A template used to generate the output binary package file name
207 %_rpmfilename %{_build_name_fmt}
209 # The default signature type.
212 # The directory where sources/patches from a source package will be
213 # installed. This is also where sources/patches are found when building.
214 %_sourcedir %{_topdir}/SOURCES
216 # The directory where the spec file from a source package will be
218 %_specdir %{_topdir}/SPECS
220 # The directory where newly built source packages will be written.
221 %_srcrpmdir %{_topdir}/SRPMS
223 # The directory where buildroots will be created.
224 %_buildrootdir %{_topdir}/BUILDROOT
226 # Build root path, where %install installs the package during build.
227 %buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
229 # Directory where temporaray files can be created.
230 %_tmppath %{_var}/tmp
232 # Path to top of build area.
233 %_topdir %{getenv:HOME}/rpmbuild
235 # The path to the unzip executable (legacy, use %{__unzip} instead).
236 %_unzipbin %{__unzip}
238 #==============================================================================
239 # ---- Optional rpmrc macros.
240 # Macros that are initialized as a side effect of rpmrc and/or spec
243 # The sub-directory (relative to %{_builddir}) where sources are compiled.
244 # This macro is set after processing %setup, either explicitly from the
245 # value given to -n or the default name-version.
249 # Configurable distribution information, same as Distribution: tag in a
254 # Configurable distribution URL, same as DistURL: tag in a specfile.
255 # The URL will be used to supply reliable information to tools like
258 # Note: You should not configure with disturl (or build packages with
259 # the DistURL: tag) unless you are willing to supply content in a
260 # yet-to-be-determined format at the URL specified.
264 # Configurable bug URL, same as BugURL: tag in a specfile.
265 # The URL will be used to supply reliable information to where
270 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
271 # marked as %doc should be installed.
274 # The port and machine name of a FTP proxy host running TIS firewall.
279 # The signature to use and the location of configuration files for
280 # signing packages with GNU gpg.
285 # The port and machine name of an HTTP proxy host.
290 # The PATH put into the environment before running %pre/%post et al.
292 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
294 # A colon separated list of desired locales to be installed;
295 # "all" means install all locale specific files.
299 # The value of CLASSPATH in build scriptlets (iff configured).
303 # Import packaging conventions from jpackage.org (prefixed with _
304 # to avoid name collisions).
306 %_javadir %{_datadir}/java
307 %_javadocdir %{_datadir}/javadoc
309 # A colon separated list of paths where files should *not* be installed.
310 # Usually, these are network file system mount points.
315 # The type of pattern match used on rpmdb iterator selectors:
316 # "default" simple glob-like regex, periods will be escaped,
317 # splats will have period prepended, full "^...$" match
318 # required. Also, file path tags will use glob(7).
319 # "strcmp" compare strings
320 # "regex" regex(7) patterns using regcomp(3)/regexec(3)
321 # "glob" glob(7) patterns using fnmatch(3)
323 %_query_selector_match default
325 # Configurable packager information, same as Packager: in a specfile.
329 # Compression type and level for source/binary package payloads.
330 # "w9.gzdio" gzip level 9 (default).
331 # "w9.bzdio" bzip2 level 9.
332 # "w7.xzdio" xz level 7, xz's default.
333 # "w7.lzdio" lzma-alone level 7, lzma's default
335 #%_source_payload w9.gzdio
336 #%_binary_payload w9.gzdio
338 # Algorithm to use for generating file checksum digests on build.
339 # If not specified or 0, MD5 is used.
340 # WARNING: non-MD5 is backwards incompatible, don't enable lightly!
341 # The supported algorithms may depend on NSS version, as of NSS
342 # 3.11.99.5 the following are supported:
349 #%_source_filedigest_algorithm 1
350 #%_binary_filedigest_algorithm 1
352 # Configurable vendor information, same as Vendor: in a specfile.
356 # Default fuzz level for %patch in spec file.
357 %_default_patch_fuzz 0
359 # Default patch flags
360 %_default_patch_flags -s
362 #==============================================================================
363 # ---- Build configuration macros.
365 # Script gets packaged file list on input and buildroot as first parameter.
366 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
368 # Note: Disable (by commenting out) for legacy compatibility.
369 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
372 # Should unpackaged files in a build root terminate a build?
374 # Note: The default value should be 0 for legacy compatibility.
375 %_unpackaged_files_terminate_build 1
378 # Should missing %doc files in the build directory terminate a build?
380 # Note: The default value should be 0 for legacy compatibility.
381 %_missing_doc_files_terminate_build 1
384 # Should binaries in noarch packages terminate a build?
385 %_binaries_in_noarch_packages_terminate_build 1
388 # Program to call for each successfully built and written binary package.
389 # The package name is passed to the program as a command-line argument.
391 #%_build_pkgcheck %{_bindir}/rpmlint
394 # Program to call for the whole binary package set after build.
395 # The package set is passed to the program via command-line arguments.
397 #%_build_pkgcheck_set %{_bindir}/rpmlint
400 # Program to call for successfully built and written SRPM.
401 # The package name is passed to the program as a command-line argument.
403 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
406 # Should the build of packages fail if package checker (if defined) returns
407 # non-zero exit status?
409 #%_nonzero_exit_pkgcheck_terminate_build 1
412 # Should an ELF file processed by find-debuginfo.sh having no build ID
413 # terminate a build? This is left undefined to disable it and defined to
416 #%_missing_build_ids_terminate_build 1
419 # Use internal dependency generator rather than external helpers?
420 %_use_internal_dependency_generator 1
423 # Filter GLIBC_PRIVATE Provides: and Requires:
424 %_filter_GLIBC_PRIVATE 0
426 # Desired selinux policy tree
427 %__policy_tree %{expand:%%global __policy_tree %{lua:\
429 f = io.open("/etc/selinux/config")\
431 for l in f:lines() do\
432 if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
439 # Path to selinux file context patterns.
440 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
442 # Directories whose contents should be considered as documentation.
443 %__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
446 # Path to selinux file context patterns used to add
447 # RPMTAG_FILECONTEXTS to packages when building.
449 # Undefined, missing or %{nil} will disable.
450 %_build_file_context_path %{nil}
453 # Path to selinux file context patterns used to set
454 # (or override package content) file contexts when installing.
456 # Undefined, missing or %{nil} will use package content (if available).
457 %_install_file_context_path %{__file_context_path}
460 # Path to selinux file context patterns used to verify
461 # file contexts on file system.
463 # Undefined, missing or %{nil} will use package content (if available).
464 %_verify_file_context_path %{__file_context_path}
467 # Path to scripts to autogenerate package dependencies,
469 # Note: Used iff _use_internal_dependency_generator is zero.
470 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
471 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
472 %__find_provides %{_rpmconfigdir}/find-provides
473 %__find_requires %{_rpmconfigdir}/find-requires
474 #%__find_conflicts ???
475 #%__find_obsoletes ???
478 # Path to scripts to autogenerate per-interpreter package dependencies.
479 # If the script supports extra options they can be passed by defining
480 # <helper_macro>_opts macro(s), eg in spec:
481 # %define __ocaml_requires_opts -i Warnings
483 # Note: Used iff _use_internal_dependency_generator is non-zero. The
484 # helpers are also used by %{_rpmconfigdir}/rpmdeps {--provides|--requires}.
485 #%__perl_provides %{_rpmconfigdir}/perldeps.pl --provides
486 #%__perl_requires %{_rpmconfigdir}/perldeps.pl --requires
487 %__perl_provides %{_rpmconfigdir}/perl.prov
488 %__perl_requires %{_rpmconfigdir}/perl.req
490 %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
491 %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
493 %__mono_provides %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
494 %__mono_requires %{_rpmconfigdir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
496 %__libtool_provides %{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
497 %__libtool_requires %{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
499 %__pkgconfig_provides %{_rpmconfigdir}/pkgconfigdeps.sh --provides
500 %__pkgconfig_requires %{_rpmconfigdir}/pkgconfigdeps.sh --requires
502 %__ocaml_provides %{_rpmconfigdir}/ocaml-find-provides.sh
503 %__ocaml_requires %{_rpmconfigdir}/ocaml-find-requires.sh
505 %__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov
506 %__desktop_provides %{_rpmconfigdir}/desktop-file.prov
508 #==============================================================================
509 # ---- Database configuration macros.
510 # Macros used to configure Berkley db parameters.
512 # rpmdb macro configuration values are a colon (or white space) separated
513 # list of tokens, with an optional '!' negation to explicitly disable bit
514 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
515 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
516 # (e.g. %_dbi_config). The configuration is also conditioned on the
517 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
518 # the configuration while rebuilding an rpmdb database.
520 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
521 # see that for the latest gory details. Note carefully that, unless you
522 # are writing an rpm installer, you shouldn't have to touch *any* of these
525 # Here's a short list of the tokens, with a guess of whether the option is
527 # (nothing) currently used in rpm, known to work.
528 # "+++" under development, will be supported in rpm eventually.
529 # "???" I have no clue, you're mostly on your own.
531 # If you do find yourself inclined to fiddle, here's what I see (shrug):
532 # 1) Only the value of mp_size has any serious impact on overall performance,
533 # and you will need ~256Kb to handle a typical machine install.
534 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
535 # will ever need tuning. Diddle the pagesize if you're interested, although
536 # I believe that you will find pagesize=512 "best".
537 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
538 # and/or mp_size instead.
539 # 4) btree is faster than hash, but would require some painful rpm release
540 # engineering to convert everbody's databases to btree, not gonna happen
543 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
546 # token works? Berkeley db flag or value
547 #==================================================
548 #---------------------- DBENV->open parameters and tunable values:
549 # mmapsize=16Mb DBENV->set_mp_mmapsize
550 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
551 #---------------------- DBENV->open and DB->open common bits:
553 # thread ??? DB_THREAD (useless w/o posix mutexes on linux)
554 #---------------------- DBENV->open bits:
555 # joinenv DB_JOIN_ENV
556 # mpool DB_INIT_MPOOL
557 # cdb +++ DB_INIT_CDB
558 # txn ??? DB_INIT_TXN
559 # log ??? DB_INIT_LOG
560 # lock ??? DB_INIT_LOCK
561 # recover ??? DB_RECOVER
562 # recover_fatal ??? DB_RECOVER_FATAL
563 # use_environ ??? DB_USE_ENVIRON
564 # use_environ_root ??? DB_USE_ENVIRON_ROOT
565 # private +++ DB_PRIVATE
566 # lockdown ??? DB_LOCKDOWN
567 # shared +++ DB_SYSTEM_MEM
568 #---------------------- DB->open parameters and tunable values:
569 # pagesize=512 +++ DB->set_pagesize
570 #---------------------- DB->open bits:
572 # nommap ??? DB_NOMMAP
574 #---------------------- DB->open types:
579 # unknown +++ DB_UNKNOWN
580 #---------------------- DB->set_flags bits:
581 # bt_dup +++ (btree only) DB_DUP
582 # bt_dupsort +++ (btree only) DB_DUPSORT
583 # ht_dup +++ (hash only) DB_DUP
584 # ht_dupsort +++ (hash only) DB_DUPSORT
585 #----------------------- rpmdb specific configuration:
586 # usedbenv (always on) Use db3 environment?
587 # verify (db3 only) Verify Packages db after RW close?
588 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
589 # nofsync Disable fsync(2) call performed after db3 writes?
590 # temporary Unlink file when closing.
593 # XXX Use transactions and logs for rpmdb durability (no clue yet):
594 #%__dbi_other create joinenv mpool txn log \
595 # mp_mmapsize=8Mb mp_size=512Kb
597 # Use a CDB database model for concurrent access.
598 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
599 %__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
601 %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
603 # Note: adding nofsync here speeds up --rebuilddb a lot.
604 %__dbi_rebuild nofsync !log !txn !cdb
605 %__dbi_transient %{__dbi_rebuild} temporary private
606 %__dbi_perms perms=0644
609 #--- Hash database configuration
616 %__dbi_htconfig_current %{__dbi_htconfig}
617 %__dbi_htconfig_rebuild %{__dbi_htconfig} %{__dbi_rebuild}
620 %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
621 %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
625 #--- Btree database configuration
632 %__dbi_btconfig_current %{__dbi_btconfig}
633 %__dbi_btconfig_rebuild %{__dbi_btconfig} %{__dbi_rebuild}
636 %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
637 %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
640 # The list of tags for which indices will be built.
641 %_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Obsoletename:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Depends:Pubkeys
643 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
644 %_dbi_config_Packages %{_dbi_htconfig} lockdbfd
646 # "Depends" is a per-transaction cache of known dependency resolutions.
647 %_dbi_config_Depends %{_dbi_htconfig} temporary private
649 %_dbi_config_Dirnames %{_dbi_btconfig}
650 %_dbi_config_Requireversion %{_dbi_btconfig}
651 %_dbi_config_Provideversion %{_dbi_btconfig}
652 %_dbi_config_Installtid %{_dbi_btconfig}
653 %_dbi_config_Removetid %{_dbi_btconfig}
655 %_dbi_config %{_dbi_htconfig}
657 # XXX legacy configuration.
658 # Choose db interface:
659 # 3 native db3 interface.
661 # There are two macros so that --rebuilddb can convert db1 -> db3.
666 #==============================================================================
667 # ---- GPG/PGP/PGP5 signature macros.
668 # Macro(s) to hold the arguments passed to GPG/PGP for package
669 # signing and verification.
671 %__gpg_check_password_cmd %{__gpg} \
672 gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
674 %__gpg_sign_cmd %{__gpg} \
675 gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
676 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
678 # XXX rpm >= 4.1 verifies signatures internally
679 #%__gpg_verify_cmd %{__gpg} \
680 # gpg --batch --no-verbose --verify --no-secmem-warning \
681 # %{__signature_filename} %{__plaintext_filename}
683 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
684 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
685 # with the prelink package. If the macro is undefined, then prelinked
686 # shared libraries contents are MD5 digest verified (as usual), rather
687 # than MD5 verifying the output of the prelink undo helper.
689 # Note: The 2nd token is used as argv[0] and "library" is a
690 # placeholder that will be deleted and replaced with the appropriate
692 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
694 # Horowitz Key Protocol server configuration
696 %_hkp_keyserver http://pgp.mit.edu
697 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
699 #==============================================================================
700 # ---- Transaction macros.
701 # Macro(s) used to parameterize transactions.
703 # The output binary package file name template used when building
706 # XXX Note: escaped %% for use in headerSprintf()
707 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
709 # The default transaction color. This value is a set of bits to
710 # determine file and dependency affinity for this arch.
711 # 0 uncolored (i.e. use only arch as install hint)
714 %_transaction_color @RPMCANONCOLOR@
716 # Verify digest/signature flags for various rpm modes:
717 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
718 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
719 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
720 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
722 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
723 # digest/signature checking, disables signature checking, but attempts
724 # digest checking, also when retrieving headers from the database.
727 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
730 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
732 # at the python prompt for example, after "import rpm".
734 # The checking overhead is ~11ms per header for digests/signatures;
735 # each header from the database is checked only when first encountered
736 # for each database open.
738 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
742 %_vsflags_build %{__vsflags}
743 %_vsflags_erase %{__vsflags}
744 %_vsflags_install %{__vsflags}
745 %_vsflags_query %{__vsflags}
746 %_vsflags_rebuilddb %{__vsflags}
747 %_vsflags_verify %{__vsflags}
749 # Relations between package names that cause dependency loops
750 # with legacy packages that cannot be fixed. Relations are
753 # where package p has a Requires: on something that package q Provides:
755 # XXX Note: that there cannot be any whitespace within the string "p>q",
756 # and that both p and q are package names (i.e. no version/release).
759 %_dependency_whiteout \
763 # Default output format string for rpm -qa
765 # XXX Note: escaped %% for use in headerFormat()
766 %_query_all_fmt %%{nvra}
769 # Default path to the file used for transaction fcntl lock.
770 %_rpmlock_path %{_dbpath}/.rpm.lock
772 #==============================================================================
773 # ---- per-platform macros.
774 # Macros that are specific to an individual platform. The values here
775 # will be used if the per-platform macro file does not exist..
777 %_arch @RPMCANONARCH@
778 %_build_arch @RPMCANONARCH@
779 %_vendor @RPMCANONVENDOR@
782 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
785 # Define a generic value for optflags. Normally overridden by per-target macros.
789 # ISA dependency marker, none for noarch and name-bitness for others
790 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
793 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
794 %__arch_install_post %{nil}
795 %__os_install_post %{___build_post}
797 #==============================================================================
798 # ---- Scriptlet template templates.
799 # Global defaults used for building scriptlet templates.
802 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
804 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
806 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
807 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
808 RPM_OPT_FLAGS=\"%{optflags}\"\
809 RPM_ARCH=\"%{_arch}\"\
811 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
812 RPM_DOC_DIR=\"%{_docdir}\"\
814 RPM_PACKAGE_NAME=\"%{name}\"\
815 RPM_PACKAGE_VERSION=\"%{version}\"\
816 RPM_PACKAGE_RELEASE=\"%{release}\"\
817 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
820 unset CDPATH DISPLAY ||:\
821 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
822 export RPM_BUILD_ROOT}\
823 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
826 %{verbose:set -x}%{!verbose:exec > /dev/null}\
828 cd \"%{u2p:%{_builddir}}\"\
831 #%___build_body %{nil}
832 %___build_post exit 0
834 %___build_template #!%{___build_shell}\
842 #==============================================================================
843 # ---- Scriptlet templates.
844 # Macro(s) that expand to a command and script that is executed.
845 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
847 %__spec_prep_shell %{___build_shell}
848 %__spec_prep_args %{___build_args}
849 %__spec_prep_cmd %{___build_cmd}
850 %__spec_prep_pre %{___build_pre}
851 %__spec_prep_body %{___build_body}
852 %__spec_prep_post %{___build_post}
853 %__spec_prep_template #!%{__spec_prep_shell}\
857 #%{__spec_prep_body}\
858 #%{__spec_prep_post}\
861 %__spec_build_shell %{___build_shell}
862 %__spec_build_args %{___build_args}
863 %__spec_build_cmd %{___build_cmd}
864 %__spec_build_pre %{___build_pre}
865 %__spec_build_body %{___build_body}
866 %__spec_build_post %{___build_post}
867 %__spec_build_template #!%{__spec_build_shell}\
871 #%{__spec_build_body}\
872 #%{__spec_build_post}\
875 %__spec_install_shell %{___build_shell}
876 %__spec_install_args %{___build_args}
877 %__spec_install_cmd %{___build_cmd}
878 %__spec_install_pre %{___build_pre}
879 %__spec_install_body %{___build_body}
880 %__spec_install_post\
881 %{?__debug_package:%{__debug_install_post}}\
882 %{__arch_install_post}\
883 %{__os_install_post}\
885 %__spec_install_template #!%{__spec_install_shell}\
886 %{__spec_install_pre}\
889 #%{__spec_install_body}\
890 #%{__spec_install_post}\
893 %__spec_check_shell %{___build_shell}
894 %__spec_check_args %{___build_args}
895 %__spec_check_cmd %{___build_cmd}
896 %__spec_check_pre %{___build_pre}
897 %__spec_check_body %{___build_body}
898 %__spec_check_post %{___build_post}
899 %__spec_check_template #!%{__spec_check_shell}\
903 #%{__spec_check_body}\
904 #%{__spec_check_post}\
907 #%__spec_autodep_shell %{___build_shell}
908 #%__spec_autodep_args %{___build_args}
909 #%__spec_autodep_cmd %{___build_cmd}
910 #%__spec_autodep_pre %{___build_pre}
911 #%__spec_autodep_body %{___build_body}
912 #%__spec_autodep_post %{___build_post}
913 #%__spec_autodep_template #!%{__spec_autodep_shell}\
914 #%{__spec_autodep_pre}\
917 #%{__spec_autodep_body}\
918 #%{__spec_autodep_post}\
921 %__spec_clean_shell %{___build_shell}
922 %__spec_clean_args %{___build_args}
923 %__spec_clean_cmd %{___build_cmd}
924 %__spec_clean_pre %{___build_pre}
925 %__spec_clean_body %{___build_body}
926 %__spec_clean_post %{___build_post}
927 %__spec_clean_template #!%{__spec_clean_shell}\
931 #%{__spec_clean_body}\
932 #%{__spec_clean_post}\
935 %__spec_rmbuild_shell %{___build_shell}
936 %__spec_rmbuild_args %{___build_args}
937 %__spec_rmbuild_cmd %{___build_cmd}
938 %__spec_rmbuild_pre %{___build_pre}
939 %__spec_rmbuild_body %{___build_body}
940 %__spec_rmbuild_post %{___build_post}
941 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
942 %{__spec_rmbuild_pre}\
945 #%{__spec_rmbuild_body}\
946 #%{__spec_rmbuild_post}\
949 # XXX We don't expand pre/post install scriptlets (yet).
950 #%__spec_pre_pre %{nil}
951 #%__spec_pre_post %{nil}
952 #%__spec_post_pre %{nil}
953 #%__spec_post_post %{nil}
954 #%__spec_preun_pre %{nil}
955 #%__spec_preun_post %{nil}
956 #%__spec_postun_pre %{nil}
957 #%__spec_postun_post %{nil}
958 #%__spec_triggerpostun_pre %{nil}
959 #%__spec_triggerpostun_post %{nil}
960 #%__spec_triggerun_pre %{nil}
961 #%__spec_triggerun_post %{nil}
962 #%__spec_triggerin_pre %{nil}
963 #%__spec_triggerin_post %{nil}
965 #==============================================================================
966 # ---- configure macros.
967 # Macro(s) slavishly copied from autoconf's config.status.
970 %_exec_prefix %{_prefix}
971 %_bindir %{_exec_prefix}/bin
972 %_sbindir %{_exec_prefix}/sbin
973 %_libexecdir %{_exec_prefix}/libexec
974 %_datadir %{_prefix}/share
976 %_sharedstatedir %{_prefix}/com
977 %_localstatedir %{_prefix}/var
979 %_libdir %{_exec_prefix}/%{_lib}
980 %_includedir %{_prefix}/include
981 %_infodir %{_datadir}/info
982 %_mandir %{_datadir}/man
984 #==============================================================================
985 # ---- config.guess platform macros.
986 # Macro(s) similar to the tokens used by configure.
989 %_build_alias %{_host_alias}
990 %_build_cpu %{_host_cpu}
991 %_build_vendor %{_host_vendor}
992 %_build_os %{_host_os}
994 %_host_alias @host_alias@%{nil}
995 %_host_cpu @host_cpu@
996 %_host_vendor @host_vendor@
999 %_target_alias %{_host_alias}
1000 %_target_cpu %{_host_cpu}
1001 %_target_vendor %{_host_vendor}
1002 %_target_os %{_host_os}
1004 #==============================================================================
1005 # ---- specfile macros.
1006 # Macro(s) here can be used reliably for reproducible builds.
1007 # (Note: Above is the goal, below are the macros under development)
1009 # The configure macro runs autoconf configure script with platform specific
1010 # directory structure (--prefix, --libdir etc) and compiler flags
1013 # The configure macro should be invoked as %configure (rather than %{configure})
1014 # because the rest of the arguments will be expanded using %*.
1016 %_configure ./configure
1018 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1019 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1020 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1021 %{_configure} --host=%{_host} --build=%{_build} \\\
1022 --program-prefix=%{?_program_prefix} \\\
1023 --prefix=%{_prefix} \\\
1024 --exec-prefix=%{_exec_prefix} \\\
1025 --bindir=%{_bindir} \\\
1026 --sbindir=%{_sbindir} \\\
1027 --sysconfdir=%{_sysconfdir} \\\
1028 --datadir=%{_datadir} \\\
1029 --includedir=%{_includedir} \\\
1030 --libdir=%{_libdir} \\\
1031 --libexecdir=%{_libexecdir} \\\
1032 --localstatedir=%{_localstatedir} \\\
1033 --sharedstatedir=%{_sharedstatedir} \\\
1034 --mandir=%{_mandir} \\\
1035 --infodir=%{_infodir}
1037 #------------------------------------------------------------------------------
1038 # The make install analogue of %configure for modern autotools:
1039 %make_install make install DESTDIR=%{?buildroot}
1041 #------------------------------------------------------------------------------
1042 # Former make install analogue, kept for compatibility and for old/broken
1043 # packages that don't support DESTDIR properly.
1046 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1047 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1048 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1049 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1050 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1051 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1052 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1053 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1054 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1055 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1056 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1057 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1058 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1061 #------------------------------------------------------------------------------
1062 # The GNUconfigure macro does the following:
1063 # update config.guess and config.sub.
1064 # regenerate all autoconf/automake files
1065 # optionally change to a directory (make the directory if requested).
1066 # run configure with correct prefix, platform, and CFLAGS.
1067 # optionally restore current directory.
1069 # Based on autogen.sh from GNOME and orginal GNUconfigure
1071 %GNUconfigure(MCs:) \
1072 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1073 LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1074 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1075 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1076 for coin in `echo ${dirs}` \
1078 dr=`dirname ${coin}`; \
1079 if test -f ${dr}/NO-AUTO-GEN; then \
1082 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1084 aclocalinclude="${ACLOCAL_FLAGS}"; \
1085 for k in ${macrodirs}; do \
1086 if test -d ${k}; then \
1087 aclocalinclude="${aclocalinclude} -I ${k}"; \
1089 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1092 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1093 if grep "sed.*POTFILES" configure.in >/dev/null; then \
1094 : do nothing -- we still have an old unmodified configure.in \
1096 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1097 echo "no" | gettextize --force --copy; \
1098 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1101 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1102 %{__libtoolize} --force --copy; \
1104 aclocal ${aclocalinclude}; \
1105 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1108 echo "Running automake --gnu ${am_opt} ..."; \
1109 %{__automake} --add-missing --gnu ${am_opt}; \
1114 %{-C:${_mydir}}%{!-C:.}/configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
1115 %{-C:cd ${_mydir}; unset _mydir}
1117 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1118 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1120 #------------------------------------------------------------------------------
1121 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1123 # For example, these can be used as (from ImageMagick.spec from PLD site)
1128 # Summary: libraries and modules for access to ImageMagick from perl
1129 # Group: Development/Languages/Perl
1130 # Requires: %{name} = %{version}
1134 # rm -fr $RPM_BUILD_ROOT
1135 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1138 # %defattr(644,root,root,755)
1139 # %{perl_sitearch}/Image
1140 # %dir %{perl_sitearch}/auto/Image
1142 %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")
1143 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1144 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1145 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1146 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1147 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1148 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1150 #------------------------------------------------------------------------------
1151 # Useful python macros for determining python version and paths
1153 %python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
1154 %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
1155 %python_version %(%{__python} -c "import sys; print sys.version[:3]")
1157 #------------------------------------------------------------------------------
1158 # arch macro for all Intel i?86 compatibile processors
1159 # (Note: This macro (and it's analogues) will probably be obsoleted when
1160 # rpm can use regular expressions against target platforms in macro
1163 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1165 #------------------------------------------------------------------------------
1166 # arch macro for all supported ARM processors
1167 %arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
1169 #------------------------------------------------------------------------------
1170 # arch macro for all supported Sparc processors
1171 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1173 #------------------------------------------------------------------------------
1174 # arch macro for all supported Alpha processors
1175 %alpha alpha alphaev56 alphaev6 alphaev67
1177 #------------------------------------------------------------------------
1178 # Use in %install to generate locale specific file lists. For example,
1182 # %find_lang %{name}
1184 # %files -f %{name}.lang
1186 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1188 # Commands + opts to use for retrieving remote files
1189 %__urlhelpercmd @__CURL@
1190 %__urlhelperopts --silent --show-error --fail --location -o
1191 %_urlhelper %{__urlhelpercmd} %{__urlhelperopts}