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@
65 #==============================================================================
66 # ---- Build system path macros.
75 %__objcopy @__OBJCOPY@
76 %__objdump @__OBJDUMP@
81 # XXX avoid failures if tools are not installed when rpm is built.
82 %__libtoolize libtoolize
84 %__autoheader autoheader
88 #==============================================================================
89 # Conditional build stuff.
91 # Check if symbol is defined.
92 # Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
93 %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
94 %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
96 # Shorthand for %{defined with_...}
97 %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
98 %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
100 # Handle conditional builds. %bcond_with is for case when feature is
101 # default off and needs to be activated with --with ... command line
102 # switch. %bcond_without is for the dual case.
104 # %bcond_with foo defines symbol with_foo if --with foo was specified on
106 # %bcond_without foo defines symbol with_foo if --without foo was *not*
107 # specified on command line.
109 # For example (spec file):
112 # %bcond_with extra_fonts
113 # %bcond_without static
115 # %if %{with extra_fonts}
120 # %if ! %{with static}
123 # %ifdef %{with static}
126 # %{?with_static: ... }
127 # %{!?with_static: ... }
128 # %{?with_extra_fonts: ... }
129 # %{!?with_extra_fonts: ... }
132 # The bottom line: never use without_foo, _with_foo nor _without_foo, only
133 # with_foo. This way changing default set of bconds for given spec is just
134 # a matter of changing single line in it and syntax is more readable.
135 %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
136 %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
138 #==============================================================================
139 # ---- Required rpmrc macros.
140 # Macros that used to be initialized as a side effect of rpmrc parsing.
141 # These are the default values that can be overridden by other
142 # (e.g. per-platform, per-system, per-packager, per-package) macros.
144 # The directory where rpm's configuration and scripts live
145 %_rpmconfigdir %{getconfdir}
147 # The directory where sources/patches will be unpacked and built.
148 %_builddir %{_topdir}/BUILD
150 # The interpreter used for build scriptlets.
153 # The path to the bzip2 executable (legacy, use %{__bzip2} instead).
154 %_bzip2bin %{__bzip2}
156 # The location of the rpm database file(s).
157 %_dbpath %{_var}/lib/rpm
159 # The location of the rpm database file(s) after "rpm --rebuilddb".
160 %_dbpath_rebuild %{_dbpath}
162 %_keyringpath %{_dbpath}/pubkeys/
165 # Path to script that creates debug symbols in a /usr/lib/debug
168 # A spec file can %%define _find_debuginfo_opts to pass options to
169 # the script. See the script for details.
171 %__debug_install_post \
172 %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
175 # Template for debug information sub-package.
178 %global __debug_package 1\
180 Summary: Debug information for package %{name}\
181 Group: Development/Debug\
184 This package provides debug information for package %{name}.\
185 Debug information is useful when developing applications that use this\
186 package or when debugging this package.\
187 %files debug -f debugfiles.list\
188 %defattr(-,root,root)\
192 %_defaultdocdir %{_datadir}/doc
194 # The path to the gzip executable (legacy, use %{__gzip} instead).
197 # The Unix time of the latest kept changelog entry in binary packages.
198 # Any older entry is not packaged in binary packages.
199 %_changelog_trimtime 0
201 # The directory where newly built binary packages will be written.
202 %_rpmdir %{_topdir}/RPMS
204 # A template used to generate the output binary package file name
206 %_rpmfilename %{_build_name_fmt}
208 # The default signature type.
211 # The directory where sources/patches from a source package will be
212 # installed. This is also where sources/patches are found when building.
213 %_sourcedir %{_topdir}/SOURCES
215 # The directory where the spec file from a source package will be
217 %_specdir %{_topdir}/SPECS
219 # The directory where newly built source packages will be written.
220 %_srcrpmdir %{_topdir}/SRPMS
222 # The directory where buildroots will be created.
223 %_buildrootdir %{_topdir}/BUILDROOT
225 # Build root path, where %install installs the package during build.
226 %buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
228 # Directory where temporaray files can be created.
229 %_tmppath %{_var}/tmp
231 # Path to top of build area.
232 %_topdir %{getenv:HOME}/rpmbuild
234 # The path to the unzip executable (legacy, use %{__unzip} instead).
235 %_unzipbin %{__unzip}
237 #==============================================================================
238 # ---- Optional rpmrc macros.
239 # Macros that are initialized as a side effect of rpmrc and/or spec
242 # The sub-directory (relative to %{_builddir}) where sources are compiled.
243 # This macro is set after processing %setup, either explicitly from the
244 # value given to -n or the default name-version.
248 # Configurable distribution information, same as Distribution: tag in a
253 # Configurable distribution URL, same as DistURL: tag in a specfile.
254 # The URL will be used to supply reliable information to tools like
257 # Note: You should not configure with disturl (or build packages with
258 # the DistURL: tag) unless you are willing to supply content in a
259 # yet-to-be-determined format at the URL specified.
263 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
264 # marked as %doc should be installed.
267 # The port and machine name of a FTP proxy host running TIS firewall.
272 # The signature to use and the location of configuration files for
273 # signing packages with GNU gpg.
278 # The port and machine name of an HTTP proxy host.
283 # The PATH put into the environment before running %pre/%post et al.
285 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
287 # A colon separated list of desired locales to be installed;
288 # "all" means install all locale specific files.
292 # The value of CLASSPATH in build scriptlets (iff configured).
296 # Import packaging conventions from jpackage.org (prefixed with _
297 # to avoid name collisions).
299 %_javadir %{_datadir}/java
300 %_javadocdir %{_datadir}/javadoc
302 # A colon separated list of paths where files should *not* be installed.
303 # Usually, these are network file system mount points.
308 # The type of pattern match used on rpmdb iterator selectors:
309 # "default" simple glob-like regex, periods will be escaped,
310 # splats will have period prepended, full "^...$" match
311 # required. Also, file path tags will use glob(7).
312 # "strcmp" compare strings
313 # "regex" regex(7) patterns using regcomp(3)/regexec(3)
314 # "glob" glob(7) patterns using fnmatch(3)
316 %_query_selector_match default
318 # Configurable packager information, same as Packager: in a specfile.
322 # Compression type and level for source/binary package payloads.
323 # "w9.gzdio" gzip level 9 (default).
324 # "w9.bzdio" bzip2 level 9.
325 # "w7.xzdio" xz level 7, xz's default.
326 # "w7.lzdio" lzma-alone level 7, lzma's default
328 #%_source_payload w9.gzdio
329 #%_binary_payload w9.gzdio
331 # Algorithm to use for generating file checksum digests on build.
332 # If not specified or 0, MD5 is used.
333 # WARNING: non-MD5 is backwards incompatible, don't enable lightly!
334 # The supported algorithms may depend on NSS version, as of NSS
335 # 3.11.99.5 the following are supported:
342 #%_source_filedigest_algorithm 1
343 #%_binary_filedigest_algorithm 1
345 # Configurable vendor information, same as Vendor: in a specfile.
349 # Default fuzz level for %patch in spec file.
350 %_default_patch_fuzz 0
352 # Default patch flags
353 %_default_patch_flags -s
355 #==============================================================================
356 # ---- Build configuration macros.
358 # Script gets packaged file list on input and buildroot as first parameter.
359 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
361 # Note: Disable (by commenting out) for legacy compatibility.
362 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
365 # Should unpackaged files in a build root terminate a build?
367 # Note: The default value should be 0 for legacy compatibility.
368 %_unpackaged_files_terminate_build 1
371 # Should missing %doc files in the build directory terminate a build?
373 # Note: The default value should be 0 for legacy compatibility.
374 %_missing_doc_files_terminate_build 1
377 # Should binaries in noarch packages terminate a build?
378 %_binaries_in_noarch_packages_terminate_build 1
381 # Program to call for each successfully built and written binary package.
382 # The package name is passed to the program as a command-line argument.
384 #%_build_pkgcheck %{_bindir}/rpmlint
387 # Program to call for the whole binary package set after build.
388 # The package set is passed to the program via command-line arguments.
390 #%_build_pkgcheck_set %{_bindir}/rpmlint
393 # Program to call for successfully built and written SRPM.
394 # The package name is passed to the program as a command-line argument.
396 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
399 # Should the build of packages fail if package checker (if defined) returns
400 # non-zero exit status?
402 #%_nonzero_exit_pkgcheck_terminate_build 1
405 # Should an ELF file processed by find-debuginfo.sh having no build ID
406 # terminate a build? This is left undefined to disable it and defined to
409 #%_missing_build_ids_terminate_build 1
412 # Use internal dependency generator rather than external helpers?
413 %_use_internal_dependency_generator 1
416 # Filter GLIBC_PRIVATE Provides: and Requires:
417 %_filter_GLIBC_PRIVATE 0
419 # Desired selinux policy tree
420 %__policy_tree %{expand:%%global __policy_tree %{lua:\
422 f = io.open("/etc/selinux/config")\
424 for l in f:lines() do\
425 if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
432 # Path to selinux file context patterns.
433 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
435 # Directories whose contents should be considered as documentation.
436 %__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
439 # Path to selinux file context patterns used to add
440 # RPMTAG_FILECONTEXTS to packages when building.
442 # Undefined, missing or %{nil} will disable.
443 %_build_file_context_path %{nil}
446 # Path to selinux file context patterns used to set
447 # (or override package content) file contexts when installing.
449 # Undefined, missing or %{nil} will use package content (if available).
450 %_install_file_context_path %{__file_context_path}
453 # Path to selinux file context patterns used to verify
454 # file contexts on file system.
456 # Undefined, missing or %{nil} will use package content (if available).
457 %_verify_file_context_path %{__file_context_path}
460 # Path to scripts to autogenerate package dependencies,
462 # Note: Used iff _use_internal_dependency_generator is zero.
463 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
464 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
465 %__find_provides %{_rpmconfigdir}/find-provides
466 %__find_requires %{_rpmconfigdir}/find-requires
467 #%__find_conflicts ???
468 #%__find_obsoletes ???
471 # Path to scripts to autogenerate per-interpreter package dependencies,
473 # Note: Used iff _use_internal_dependency_generator is non-zero. The
474 # helpers are also used by %{_rpmconfigdir}/rpmdeps {--provides|--requires}.
475 #%__perl_provides %{_rpmconfigdir}/perldeps.pl --provides
476 #%__perl_requires %{_rpmconfigdir}/perldeps.pl --requires
477 %__perl_provides %{_rpmconfigdir}/perl.prov
478 %__perl_requires %{_rpmconfigdir}/perl.req
480 %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
481 %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
483 %__mono_provides %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
484 %__mono_requires %{_rpmconfigdir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
486 %__libtool_provides %{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
487 %__libtool_requires %{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
489 %__pkgconfig_provides %{_rpmconfigdir}/pkgconfigdeps.sh --provides
490 %__pkgconfig_requires %{_rpmconfigdir}/pkgconfigdeps.sh --requires
492 #==============================================================================
493 # ---- Database configuration macros.
494 # Macros used to configure Berkley db parameters.
496 # rpmdb macro configuration values are a colon (or white space) separated
497 # list of tokens, with an optional '!' negation to explicitly disable bit
498 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
499 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
500 # (e.g. %_dbi_config). The configuration is also conditioned on the
501 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
502 # the configuration while rebuilding an rpmdb database.
504 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
505 # see that for the latest gory details. Note carefully that, unless you
506 # are writing an rpm installer, you shouldn't have to touch *any* of these
509 # Here's a short list of the tokens, with a guess of whether the option is
511 # (nothing) currently used in rpm, known to work.
512 # "+++" under development, will be supported in rpm eventually.
513 # "???" I have no clue, you're mostly on your own.
515 # If you do find yourself inclined to fiddle, here's what I see (shrug):
516 # 1) Only the value of mp_size has any serious impact on overall performance,
517 # and you will need ~256Kb to handle a typical machine install.
518 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
519 # will ever need tuning. Diddle the pagesize if you're interested, although
520 # I believe that you will find pagesize=512 "best".
521 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
522 # and/or mp_size instead.
523 # 4) btree is faster than hash, but would require some painful rpm release
524 # engineering to convert everbody's databases to btree, not gonna happen
527 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
530 # token works? Berkeley db flag or value
531 #==================================================
532 #---------------------- DBENV->open parameters and tunable values:
533 # mmapsize=16Mb DBENV->set_mp_mmapsize
534 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
535 #---------------------- DBENV->open and DB->open common bits:
537 # thread ??? DB_THREAD (useless w/o posix mutexes on linux)
538 #---------------------- DBENV->open bits:
539 # joinenv DB_JOIN_ENV
540 # mpool DB_INIT_MPOOL
541 # cdb +++ DB_INIT_CDB
542 # txn ??? DB_INIT_TXN
543 # log ??? DB_INIT_LOG
544 # lock ??? DB_INIT_LOCK
545 # recover ??? DB_RECOVER
546 # recover_fatal ??? DB_RECOVER_FATAL
547 # use_environ ??? DB_USE_ENVIRON
548 # use_environ_root ??? DB_USE_ENVIRON_ROOT
549 # private +++ DB_PRIVATE
550 # lockdown ??? DB_LOCKDOWN
551 # shared +++ DB_SYSTEM_MEM
552 #---------------------- DB->open parameters and tunable values:
553 # pagesize=512 +++ DB->set_pagesize
554 #---------------------- DB->open bits:
556 # nommap ??? DB_NOMMAP
558 #---------------------- DB->open types:
563 # unknown +++ DB_UNKNOWN
564 #---------------------- DB->set_flags bits:
565 # bt_dup +++ (btree only) DB_DUP
566 # bt_dupsort +++ (btree only) DB_DUPSORT
567 # ht_dup +++ (hash only) DB_DUP
568 # ht_dupsort +++ (hash only) DB_DUPSORT
569 #----------------------- rpmdb specific configuration:
570 # usedbenv (always on) Use db3 environment?
571 # verify (db3 only) Verify Packages db after RW close?
572 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
573 # nofsync Disable fsync(2) call performed after db3 writes?
574 # temporary Unlink file when closing.
577 # XXX Use transactions and logs for rpmdb durability (no clue yet):
578 #%__dbi_other create joinenv mpool txn log \
579 # mp_mmapsize=8Mb mp_size=512Kb
581 # Use a CDB database model for concurrent access.
582 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
583 %__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
585 %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
587 # Note: adding nofsync here speeds up --rebuilddb a lot.
588 %__dbi_rebuild nofsync !log !txn !cdb
589 %__dbi_transient %{__dbi_rebuild} temporary private
590 %__dbi_perms perms=0644
593 #--- Hash database configuration
600 %__dbi_htconfig_current %{__dbi_htconfig}
601 %__dbi_htconfig_rebuild %{__dbi_htconfig} %{__dbi_rebuild}
604 %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
605 %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
609 #--- Btree database configuration
616 %__dbi_btconfig_current %{__dbi_btconfig}
617 %__dbi_btconfig_rebuild %{__dbi_btconfig} %{__dbi_rebuild}
620 %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
621 %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
624 # The list of tags for which indices will be built.
625 %_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Obsoletename:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Depends:Pubkeys
627 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
628 %_dbi_config_Packages %{_dbi_htconfig} lockdbfd
630 # "Depends" is a per-transaction cache of known dependency resolutions.
631 %_dbi_config_Depends %{_dbi_htconfig} temporary private
633 %_dbi_config_Dirnames %{_dbi_btconfig}
634 %_dbi_config_Requireversion %{_dbi_btconfig}
635 %_dbi_config_Provideversion %{_dbi_btconfig}
636 %_dbi_config_Installtid %{_dbi_btconfig}
637 %_dbi_config_Removetid %{_dbi_btconfig}
639 %_dbi_config %{_dbi_htconfig}
641 # XXX legacy configuration.
642 # Choose db interface:
643 # 3 native db3 interface.
645 # There are two macros so that --rebuilddb can convert db1 -> db3.
650 #==============================================================================
651 # ---- GPG/PGP/PGP5 signature macros.
652 # Macro(s) to hold the arguments passed to GPG/PGP for package
653 # signing and verification.
655 %__gpg_check_password_cmd %{__gpg} \
656 gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
658 %__gpg_sign_cmd %{__gpg} \
659 gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
660 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
662 # XXX rpm >= 4.1 verifies signatures internally
663 #%__gpg_verify_cmd %{__gpg} \
664 # gpg --batch --no-verbose --verify --no-secmem-warning \
665 # %{__signature_filename} %{__plaintext_filename}
667 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
668 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
669 # with the prelink package. If the macro is undefined, then prelinked
670 # shared libraries contents are MD5 digest verified (as usual), rather
671 # than MD5 verifying the output of the prelink undo helper.
673 # Note: The 2nd token is used as argv[0] and "library" is a
674 # placeholder that will be deleted and replaced with the appropriate
676 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
678 # Horowitz Key Protocol server configuration
680 %_hkp_keyserver http://pgp.mit.edu
681 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
683 #==============================================================================
684 # ---- Transaction macros.
685 # Macro(s) used to parameterize transactions.
687 # The output binary package file name template used when building
690 # XXX Note: escaped %% for use in headerSprintf()
691 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
693 # The default transaction color. This value is a set of bits to
694 # determine file and dependency affinity for this arch.
695 # 0 uncolored (i.e. use only arch as install hint)
698 %_transaction_color @RPMCANONCOLOR@
700 # Verify digest/signature flags for various rpm modes:
701 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
702 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
703 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
704 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
706 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
707 # digest/signature checking, disables signature checking, but attempts
708 # digest checking, also when retrieving headers from the database.
711 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
714 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
716 # at the python prompt for example, after "import rpm".
718 # The checking overhead is ~11ms per header for digests/signatures;
719 # each header from the database is checked only when first encountered
720 # for each database open.
722 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
726 %_vsflags_build %{__vsflags}
727 %_vsflags_erase %{__vsflags}
728 %_vsflags_install %{__vsflags}
729 %_vsflags_query %{__vsflags}
730 %_vsflags_rebuilddb %{__vsflags}
731 %_vsflags_verify %{__vsflags}
733 # Relations between package names that cause dependency loops
734 # with legacy packages that cannot be fixed. Relations are
737 # where package p has a Requires: on something that package q Provides:
739 # XXX Note: that there cannot be any whitespace within the string "p>q",
740 # and that both p and q are package names (i.e. no version/release).
743 %_dependency_whiteout \
747 # Default headerSprintf() output format string for rpm -qa
749 # XXX Note: escaped %% for use in headerSprintf()
750 %_query_all_fmt %%{name}-%%{version}-%%{release}%%|arch?{.%%{arch}}:{}|
753 # Default path to the file used for transaction fcmtl lock.
755 # The previous, FHS clompliant, name was /var/lock/run/transaction,
756 # but the transaction lock needs to be per-database, not global, for
757 # some rpmdb operations.
759 # XXX Note: the file name is chosen as __db.000 to expedite
760 # support issues, many users are doing "rm -f /var/lib/rpm/__db*"
762 %_rpmlock_path %{_dbpath}/__db.000
764 #==============================================================================
765 # ---- per-platform macros.
766 # Macros that are specific to an individual platform. The values here
767 # will be used if the per-platform macro file does not exist..
769 %_arch @RPMCANONARCH@
770 %_build_arch @RPMCANONARCH@
771 %_vendor @RPMCANONVENDOR@
774 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
777 # Define a generic value for optflags. Normally overridden by per-target macros.
781 # ISA dependency marker, none for noarch and name-bitness for others
782 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
785 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
786 %__arch_install_post %{nil}
787 %__os_install_post %{___build_post}
789 #==============================================================================
790 # ---- Scriptlet template templates.
791 # Global defaults used for building scriptlet templates.
794 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
796 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
798 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
799 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
800 RPM_OPT_FLAGS=\"%{optflags}\"\
801 RPM_ARCH=\"%{_arch}\"\
803 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
804 RPM_DOC_DIR=\"%{_docdir}\"\
806 RPM_PACKAGE_NAME=\"%{name}\"\
807 RPM_PACKAGE_VERSION=\"%{version}\"\
808 RPM_PACKAGE_RELEASE=\"%{release}\"\
809 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
810 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
811 export RPM_BUILD_ROOT}\
812 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
815 %{verbose:set -x}%{!verbose:exec > /dev/null}\
817 cd \"%{u2p:%{_builddir}}\"\
820 #%___build_body %{nil}
821 %___build_post exit 0
823 %___build_template #!%{___build_shell}\
831 #==============================================================================
832 # ---- Scriptlet templates.
833 # Macro(s) that expand to a command and script that is executed.
834 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
836 %__spec_prep_shell %{___build_shell}
837 %__spec_prep_args %{___build_args}
838 %__spec_prep_cmd %{___build_cmd}
839 %__spec_prep_pre %{___build_pre}
840 %__spec_prep_body %{___build_body}
841 %__spec_prep_post %{___build_post}
842 %__spec_prep_template #!%{__spec_prep_shell}\
846 #%{__spec_prep_body}\
847 #%{__spec_prep_post}\
850 %__spec_build_shell %{___build_shell}
851 %__spec_build_args %{___build_args}
852 %__spec_build_cmd %{___build_cmd}
853 %__spec_build_pre %{___build_pre}
854 %__spec_build_body %{___build_body}
855 %__spec_build_post %{___build_post}
856 %__spec_build_template #!%{__spec_build_shell}\
860 #%{__spec_build_body}\
861 #%{__spec_build_post}\
864 %__spec_install_shell %{___build_shell}
865 %__spec_install_args %{___build_args}
866 %__spec_install_cmd %{___build_cmd}
867 %__spec_install_pre %{___build_pre}
868 %__spec_install_body %{___build_body}
869 %__spec_install_post\
870 %{?__debug_package:%{__debug_install_post}}\
871 %{__arch_install_post}\
872 %{__os_install_post}\
874 %__spec_install_template #!%{__spec_install_shell}\
875 %{__spec_install_pre}\
878 #%{__spec_install_body}\
879 #%{__spec_install_post}\
882 %__spec_check_shell %{___build_shell}
883 %__spec_check_args %{___build_args}
884 %__spec_check_cmd %{___build_cmd}
885 %__spec_check_pre %{___build_pre}
886 %__spec_check_body %{___build_body}
887 %__spec_check_post %{___build_post}
888 %__spec_check_template #!%{__spec_check_shell}\
892 #%{__spec_check_body}\
893 #%{__spec_check_post}\
896 #%__spec_autodep_shell %{___build_shell}
897 #%__spec_autodep_args %{___build_args}
898 #%__spec_autodep_cmd %{___build_cmd}
899 #%__spec_autodep_pre %{___build_pre}
900 #%__spec_autodep_body %{___build_body}
901 #%__spec_autodep_post %{___build_post}
902 #%__spec_autodep_template #!%{__spec_autodep_shell}\
903 #%{__spec_autodep_pre}\
906 #%{__spec_autodep_body}\
907 #%{__spec_autodep_post}\
910 %__spec_clean_shell %{___build_shell}
911 %__spec_clean_args %{___build_args}
912 %__spec_clean_cmd %{___build_cmd}
913 %__spec_clean_pre %{___build_pre}
914 %__spec_clean_body %{___build_body}
915 %__spec_clean_post %{___build_post}
916 %__spec_clean_template #!%{__spec_clean_shell}\
920 #%{__spec_clean_body}\
921 #%{__spec_clean_post}\
924 %__spec_rmbuild_shell %{___build_shell}
925 %__spec_rmbuild_args %{___build_args}
926 %__spec_rmbuild_cmd %{___build_cmd}
927 %__spec_rmbuild_pre %{___build_pre}
928 %__spec_rmbuild_body %{___build_body}
929 %__spec_rmbuild_post %{___build_post}
930 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
931 %{__spec_rmbuild_pre}\
934 #%{__spec_rmbuild_body}\
935 #%{__spec_rmbuild_post}\
938 # XXX We don't expand pre/post install scriptlets (yet).
939 #%__spec_pre_pre %{nil}
940 #%__spec_pre_post %{nil}
941 #%__spec_post_pre %{nil}
942 #%__spec_post_post %{nil}
943 #%__spec_preun_pre %{nil}
944 #%__spec_preun_post %{nil}
945 #%__spec_postun_pre %{nil}
946 #%__spec_postun_post %{nil}
947 #%__spec_triggerpostun_pre %{nil}
948 #%__spec_triggerpostun_post %{nil}
949 #%__spec_triggerun_pre %{nil}
950 #%__spec_triggerun_post %{nil}
951 #%__spec_triggerin_pre %{nil}
952 #%__spec_triggerin_post %{nil}
954 #==============================================================================
955 # ---- configure macros.
956 # Macro(s) slavishly copied from autoconf's config.status.
959 %_exec_prefix %{_prefix}
960 %_bindir %{_exec_prefix}/bin
961 %_sbindir %{_exec_prefix}/sbin
962 %_libexecdir %{_exec_prefix}/libexec
963 %_datadir %{_prefix}/share
965 %_sharedstatedir %{_prefix}/com
966 %_localstatedir %{_prefix}/var
968 %_libdir %{_exec_prefix}/%{_lib}
969 %_includedir %{_prefix}/include
970 %_infodir %{_datadir}/info
971 %_mandir %{_datadir}/man
973 #==============================================================================
974 # ---- config.guess platform macros.
975 # Macro(s) similar to the tokens used by configure.
978 %_build_alias %{_host_alias}
979 %_build_cpu %{_host_cpu}
980 %_build_vendor %{_host_vendor}
981 %_build_os %{_host_os}
983 %_host_alias @host_alias@%{nil}
984 %_host_cpu @host_cpu@
985 %_host_vendor @host_vendor@
988 %_target_alias %{_host_alias}
989 %_target_cpu %{_host_cpu}
990 %_target_vendor %{_host_vendor}
991 %_target_os %{_host_os}
993 #==============================================================================
994 # ---- specfile macros.
995 # Macro(s) here can be used reliably for reproducible builds.
996 # (Note: Above is the goal, below are the macros under development)
998 # The configure macro runs autoconf configure script with platform specific
999 # directory structure (--prefix, --libdir etc) and compiler flags
1002 # The configure macro should be invoked as %configure (rather than %{configure})
1003 # because the rest of the arguments will be expanded using %*.
1005 %_configure ./configure
1007 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1008 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1009 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1010 %{_configure} --host=%{_host} --build=%{_build} \\\
1011 --target=%{_target_platform} \\\
1012 --program-prefix=%{?_program_prefix} \\\
1013 --prefix=%{_prefix} \\\
1014 --exec-prefix=%{_exec_prefix} \\\
1015 --bindir=%{_bindir} \\\
1016 --sbindir=%{_sbindir} \\\
1017 --sysconfdir=%{_sysconfdir} \\\
1018 --datadir=%{_datadir} \\\
1019 --includedir=%{_includedir} \\\
1020 --libdir=%{_libdir} \\\
1021 --libexecdir=%{_libexecdir} \\\
1022 --localstatedir=%{_localstatedir} \\\
1023 --sharedstatedir=%{_sharedstatedir} \\\
1024 --mandir=%{_mandir} \\\
1025 --infodir=%{_infodir}
1027 #------------------------------------------------------------------------------
1028 # The make install analogue of %configure:
1031 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1032 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1033 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1034 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1035 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1036 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1037 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1038 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1039 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1040 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1041 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1042 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1043 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1046 #------------------------------------------------------------------------------
1047 # The GNUconfigure macro does the following:
1048 # update config.guess and config.sub.
1049 # regenerate all autoconf/automake files
1050 # optionally change to a directory (make the directory if requested).
1051 # run configure with correct prefix, platform, and CFLAGS.
1052 # optionally restore current directory.
1054 # Based on autogen.sh from GNOME and orginal GNUconfigure
1056 %GNUconfigure(MCs:) \
1057 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1058 LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1059 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1060 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1061 for coin in `echo ${dirs}` \
1063 dr=`dirname ${coin}`; \
1064 if test -f ${dr}/NO-AUTO-GEN; then \
1067 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1069 aclocalinclude="${ACLOCAL_FLAGS}"; \
1070 for k in ${macrodirs}; do \
1071 if test -d ${k}; then \
1072 aclocalinclude="${aclocalinclude} -I ${k}"; \
1074 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1077 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1078 if grep "sed.*POTFILES" configure.in >/dev/null; then \
1079 : do nothing -- we still have an old unmodified configure.in \
1081 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1082 echo "no" | gettextize --force --copy; \
1083 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1086 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1087 %{__libtoolize} --force --copy; \
1089 aclocal ${aclocalinclude}; \
1090 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1093 echo "Running automake --gnu ${am_opt} ..."; \
1094 %{__automake} --add-missing --gnu ${am_opt}; \
1099 %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
1100 %{-C:cd ${_mydir}; unset _mydir}
1102 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1103 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1105 #------------------------------------------------------------------------------
1106 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1108 # For example, these can be used as (from ImageMagick.spec from PLD site)
1113 # Summary: libraries and modules for access to ImageMagick from perl
1114 # Group: Development/Languages/Perl
1115 # Requires: %{name} = %{version}
1119 # rm -fr $RPM_BUILD_ROOT
1120 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1123 # %defattr(644,root,root,755)
1124 # %{perl_sitearch}/Image
1125 # %dir %{perl_sitearch}/auto/Image
1127 %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")
1128 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1129 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1130 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1131 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1132 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1133 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1135 #------------------------------------------------------------------------------
1136 # arch macro for all Intel i?86 compatibile processors
1137 # (Note: This macro (and it's analogues) will probably be obsoleted when
1138 # rpm can use regular expressions against target platforms in macro
1141 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1143 #------------------------------------------------------------------------------
1144 # arch macro for all supported ARM processors
1145 %arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
1147 #------------------------------------------------------------------------------
1148 # arch macro for all supported Sparc processors
1149 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1151 #------------------------------------------------------------------------------
1152 # arch macro for all supported Alpha processors
1153 %alpha alpha alphaev56 alphaev6 alphaev67
1155 #------------------------------------------------------------------------
1156 # Use in %install to generate locale specific file lists. For example,
1160 # %find_lang %{name}
1162 # %files -f %{name}.lang
1164 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1166 # Commands + opts to use for retrieving remote files
1167 %__urlhelpercmd @__CURL@
1168 %__urlhelperopts --silent --show-error --fail --location -o
1169 %_urlhelper %{__urlhelpercmd} %{__urlhelperopts}