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 sources/patches will be unpacked and built.
145 %_builddir %{_topdir}/BUILD
147 # The interpreter used for build scriptlets.
150 # The path to the bzip2 executable (legacy, use %{__bzip2} instead).
151 %_bzip2bin %{__bzip2}
153 # The location of the rpm database file(s).
154 %_dbpath %{_var}/lib/rpm
156 # The location of the rpm database file(s) after "rpm --rebuilddb".
157 %_dbpath_rebuild %{_dbpath}
159 %_keyringpath %{_dbpath}/pubkeys/
162 # Path to script that creates debug symbols in a /usr/lib/debug
165 # A spec file can %%define _find_debuginfo_opts to pass options to
166 # the script. See the script for details.
168 %__debug_install_post \
169 %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
172 # Template for debug information sub-package.
175 %global __debug_package 1\
177 Summary: Debug information for package %{name}\
178 Group: Development/Debug\
181 This package provides debug information for package %{name}.\
182 Debug information is useful when developing applications that use this\
183 package or when debugging this package.\
184 %files debug -f debugfiles.list\
185 %defattr(-,root,root)\
189 %_defaultdocdir %{_datadir}/doc
191 # The path to the gzip executable (legacy, use %{__gzip} instead).
194 # The number of changelog entries kept when installing (legacy, unused in
195 # rpm-4.0.1 and later).
198 # The path to the pgp executable (legacy, use %{__pgp} instead).
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 %(echo $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.lzdio" lzma level 7, lzma's default.
327 #%_source_payload w9.gzdio
328 #%_binary_payload w9.gzdio
330 # Algorithm to use for generating file checksum digests on build.
331 # If not specified or 0, MD5 is used.
332 # WARNING: non-MD5 is backwards incompatible, don't enable lightly!
333 # The supported algorithms may depend on NSS version, as of NSS
334 # 3.11.99.5 the following are supported:
341 #%_source_filedigest_algorithm 1
342 #%_binary_filedigest_algorithm 1
344 # The signature to use and the location of configuration files for
345 # signing packages with PGP.
350 # Configurable vendor information, same as Vendor: in a specfile.
354 # Default fuzz level for %patch in spec file.
355 %_default_patch_fuzz 0
357 # Default patch flags
358 %_default_patch_flags -s
360 #==============================================================================
361 # ---- Build configuration macros.
363 # Script gets packaged file list on input and buildroot as first parameter.
364 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
366 # Note: Disable (by commenting out) for legacy compatibility.
367 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
370 # Should unpackaged files in a build root terminate a build?
372 # Note: The default value should be 0 for legacy compatibility.
373 %_unpackaged_files_terminate_build 1
376 # Should missing %doc files in the build directory terminate a build?
378 # Note: The default value should be 0 for legacy compatibility.
379 %_missing_doc_files_terminate_build 1
382 # Program to call for each successfully built and written binary package.
383 # The package name is passed to the program as a command-line argument.
385 #%_build_pkgcheck %{_bindir}/rpmlint
388 # Program to call for the whole binary package set after build.
389 # The package set is passed to the program via command-line arguments.
391 #%_build_pkgcheck_set %{_bindir}/rpmlint
394 # Program to call for successfully built and written SRPM.
395 # The package name is passed to the program as a command-line argument.
397 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
400 # Should the build of packages fail if package checker (if defined) returns
401 # non-zero exit status?
403 #%_nonzero_exit_pkgcheck_terminate_build 1
406 # Should an ELF file processed by find-debuginfo.sh having no build ID
407 # terminate a build? This is left undefined to disable it and defined to
410 #%_missing_build_ids_terminate_build 1
413 # Use internal dependency generator rather than external helpers?
414 %_use_internal_dependency_generator 1
417 # Filter GLIBC_PRIVATE Provides: and Requires:
418 %_filter_GLIBC_PRIVATE 0
420 # Desired selinux policy tree
421 %__policy_tree %{expand:%%global __policy_tree %{lua:\
423 f = io.open("/etc/selinux/config")\
425 for l in f:lines() do\
426 if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
433 # Path to selinux file context patterns.
434 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
436 # Directories whose contents should be considered as documentation.
437 %__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
440 # Path to selinux file context patterns used to add
441 # RPMTAG_FILECONTEXTS to packages when building.
443 # Undefined, missing or %{nil} will disable.
444 %_build_file_context_path %{nil}
447 # Path to selinux file context patterns used to set
448 # (or override package content) file contexts when installing.
450 # Undefined, missing or %{nil} will use package content (if available).
451 %_install_file_context_path %{__file_context_path}
454 # Path to selinux file context patterns used to verify
455 # file contexts on file system.
457 # Undefined, missing or %{nil} will use package content (if available).
458 %_verify_file_context_path %{__file_context_path}
461 # Path to scripts to autogenerate package dependencies,
463 # Note: Used iff _use_internal_dependency_generator is zero.
464 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
465 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
466 %__find_provides %{_rpmconfigdir}/find-provides
467 %__find_requires %{_rpmconfigdir}/find-requires
468 #%__find_conflicts ???
469 #%__find_obsoletes ???
472 # Path to scripts to autogenerate per-interpreter package dependencies,
474 # Note: Used iff _use_internal_dependency_generator is non-zero. The
475 # helpers are also used by %{_rpmconfigdir}/rpmdeps {--provides|--requires}.
476 #%__perl_provides %{_rpmconfigdir}/perldeps.pl --provides
477 #%__perl_requires %{_rpmconfigdir}/perldeps.pl --requires
478 %__perl_provides %{_rpmconfigdir}/perl.prov
479 %__perl_requires %{_rpmconfigdir}/perl.req
481 %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
482 %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
484 %__mono_provides %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
485 %__mono_requires %{_rpmconfigdir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
487 %__libtool_provides %{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
488 %__libtool_requires %{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
490 %__pkgconfig_provides %{_rpmconfigdir}/pkgconfigdeps.sh --provides
491 %__pkgconfig_requires %{_rpmconfigdir}/pkgconfigdeps.sh --requires
493 #==============================================================================
494 # ---- Database configuration macros.
495 # Macros used to configure Berkley db parameters.
497 # rpmdb macro configuration values are a colon (or white space) separated
498 # list of tokens, with an optional '!' negation to explicitly disable bit
499 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
500 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
501 # (e.g. %_dbi_config). The configuration is also conditioned on the
502 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
503 # the configuration while rebuilding an rpmdb database.
505 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
506 # see that for the latest gory details. Note carefully that, unless you
507 # are writing an rpm installer, you shouldn't have to touch *any* of these
510 # Here's a short list of the tokens, with a guess of whether the option is
512 # (nothing) currently used in rpm, known to work.
513 # "+++" under development, will be supported in rpm eventually.
514 # "???" I have no clue, you're mostly on your own.
516 # If you do find yourself inclined to fiddle, here's what I see (shrug):
517 # 1) Only the value of mp_size has any serious impact on overall performance,
518 # and you will need ~256Kb to handle a typical machine install.
519 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
520 # will ever need tuning. Diddle the pagesize if you're interested, although
521 # I believe that you will find pagesize=512 "best".
522 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
523 # and/or mp_size instead.
524 # 4) btree is faster than hash, but would require some painful rpm release
525 # engineering to convert everbody's databases to btree, not gonna happen
528 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
531 # token works? Berkeley db flag or value
532 #==================================================
533 #---------------------- DBENV->open parameters and tunable values:
534 # mmapsize=16Mb DBENV->set_mp_mmapsize
535 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
536 #---------------------- DBENV->open and DB->open common bits:
538 # thread ??? DB_THREAD (useless w/o posix mutexes on linux)
539 #---------------------- DBENV->open bits:
540 # joinenv DB_JOIN_ENV
541 # mpool DB_INIT_MPOOL
542 # cdb +++ DB_INIT_CDB
543 # txn ??? DB_INIT_TXN
544 # log ??? DB_INIT_LOG
545 # lock ??? DB_INIT_LOCK
546 # recover ??? DB_RECOVER
547 # recover_fatal ??? DB_RECOVER_FATAL
548 # use_environ ??? DB_USE_ENVIRON
549 # use_environ_root ??? DB_USE_ENVIRON_ROOT
550 # private +++ DB_PRIVATE
551 # lockdown ??? DB_LOCKDOWN
552 # shared +++ DB_SYSTEM_MEM
553 #---------------------- DB->open parameters and tunable values:
554 # pagesize=512 +++ DB->set_pagesize
555 #---------------------- DB->open bits:
557 # nommap ??? DB_NOMMAP
559 #---------------------- DB->open types:
564 # unknown +++ DB_UNKNOWN
565 #---------------------- DB->set_flags bits:
566 # bt_dup +++ (btree only) DB_DUP
567 # bt_dupsort +++ (btree only) DB_DUPSORT
568 # ht_dup +++ (hash only) DB_DUP
569 # ht_dupsort +++ (hash only) DB_DUPSORT
570 #----------------------- rpmdb specific configuration:
571 # usedbenv (always on) Use db3 environment?
572 # verify (db3 only) Verify Packages db after RW close?
573 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
574 # nofsync Disable fsync(2) call performed after db3 writes?
575 # temporary Unlink file when closing.
578 # XXX Use transactions and logs for rpmdb durability (no clue yet):
579 #%__dbi_other create joinenv mpool txn log \
580 # mp_mmapsize=8Mb mp_size=512Kb
582 # Use a CDB database model for concurrent access.
583 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
584 %__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
586 %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
588 # Note: adding nofsync here speeds up --rebuilddb a lot.
589 %__dbi_rebuild nofsync !log !txn !cdb
590 %__dbi_transient %{__dbi_rebuild} temporary private
591 %__dbi_perms perms=0644
594 #--- Hash database configuration
601 %__dbi_htconfig_current %{__dbi_htconfig}
602 %__dbi_htconfig_rebuild %{__dbi_htconfig} %{__dbi_rebuild}
605 %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
606 %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
610 #--- Btree database configuration
617 %__dbi_btconfig_current %{__dbi_btconfig}
618 %__dbi_btconfig_rebuild %{__dbi_btconfig} %{__dbi_rebuild}
621 %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
622 %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
625 # The list of tags for which indices will be built.
626 %_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys
628 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
629 %_dbi_config_Packages %{_dbi_htconfig} lockdbfd
631 # "Depends" is a per-transaction cache of known dependency resolutions.
632 %_dbi_config_Depends %{_dbi_htconfig} temporary private
634 %_dbi_config_Dirnames %{_dbi_btconfig}
635 %_dbi_config_Requireversion %{_dbi_btconfig}
636 %_dbi_config_Provideversion %{_dbi_btconfig}
637 %_dbi_config_Installtid %{_dbi_btconfig}
638 %_dbi_config_Removetid %{_dbi_btconfig}
640 %_dbi_config %{_dbi_htconfig}
642 # XXX legacy configuration.
643 # Choose db interface:
644 # 3 native db3 interface.
646 # There are two macros so that --rebuilddb can convert db1 -> db3.
651 #==============================================================================
652 # ---- GPG/PGP/PGP5 signature macros.
653 # Macro(s) to hold the arguments passed to GPG/PGP for package
654 # signing and verification.
656 %__gpg_check_password_cmd %{__gpg} \
657 gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
658 %__pgp_check_password_cmd %{__pgp} \
659 pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
660 %__pgp5_check_password_cmd %{__pgp} \
661 pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f
663 %__gpg_sign_cmd %{__gpg} \
664 gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
665 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
666 %__pgp_sign_cmd %{__pgp} \
667 pgp +batchmode=on +verbose=0 +armor=off \
668 "+myname=%{_pgp_name}" -sb %{__plaintext_filename} %{__signature_filename}
669 %__pgp5_sign_cmd %{__pgp} \
670 pgps +batchmode=on +verbose=0 +armor=off \
671 "+myname=%{_pgp_name}" -b %{__plaintext_filename} -o %{__signature_filename}
673 # XXX rpm >= 4.1 verifies signatures internally
674 #%__gpg_verify_cmd %{__gpg} \
675 # gpg --batch --no-verbose --verify --no-secmem-warning \
676 # %{__signature_filename} %{__plaintext_filename}
677 #%__pgp_verify_cmd %{__pgp} \
678 # pgp +batchmode=on +verbose=0 \
679 # %{__signature_filename} %{__plaintext_filename}
680 #%__pgp5_verify_cmd %{__pgp} \
681 # pgpv +batchmode=on +verbose=0 \
682 # +OutputInformationFD=1 +OutputWarningFD=1 \
683 # -o %{__signature_filename} %{__plaintext_filename}
686 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
687 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
688 # with the prelink package. If the macro is undefined, then prelinked
689 # shared libraries contents are MD5 digest verified (as usual), rather
690 # than MD5 verifying the output of the prelink undo helper.
692 # Note: The 2nd token is used as argv[0] and "library" is a
693 # placeholder that will be deleted and replaced with the appropriate
695 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
697 # Horowitz Key Protocol server configuration
699 %_hkp_keyserver http://pgp.mit.edu
700 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
702 #==============================================================================
703 # ---- Transaction macros.
704 # Macro(s) used to parameterize transactions.
706 # The output binary package file name template used when building
709 # XXX Note: escaped %% for use in headerSprintf()
710 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
712 # The default transaction color. This value is a set of bits to
713 # determine file and dependency affinity for this arch.
714 # 0 uncolored (i.e. use only arch as install hint)
717 %_transaction_color @RPMCANONCOLOR@
719 # Verify digest/signature flags for various rpm modes:
720 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
721 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
722 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
723 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
725 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
726 # digest/signature checking, disables signature checking, but attempts
727 # digest checking, also when retrieving headers from the database.
730 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
733 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
735 # at the python prompt for example, after "import rpm".
737 # The checking overhead is ~11ms per header for digests/signatures;
738 # each header from the database is checked only when first encountered
739 # for each database open.
741 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
745 %_vsflags_build %{__vsflags}
746 %_vsflags_erase %{__vsflags}
747 %_vsflags_install %{__vsflags}
748 %_vsflags_query %{__vsflags}
749 %_vsflags_rebuilddb %{__vsflags}
750 %_vsflags_verify %{__vsflags}
752 # Relations between package names that cause dependency loops
753 # with legacy packages that cannot be fixed. Relations are
756 # where package p has a Requires: on something that package q Provides:
758 # XXX Note: that there cannot be any whitespace within the string "p>q",
759 # and that both p and q are package names (i.e. no version/release).
762 %_dependency_whiteout \
766 # Default headerSprintf() output format string for rpm -qa
768 # XXX Note: escaped %% for use in headerSprintf()
769 %_query_all_fmt %%{name}-%%{version}-%%{release}%%|arch?{.%%{arch}}:{}|
772 # Default path to the file used for transaction fcmtl lock.
774 # The previous, FHS clompliant, name was /var/lock/run/transaction,
775 # but the transaction lock needs to be per-database, not global, for
776 # some rpmdb operations.
778 # XXX Note: the file name is chosen as __db.000 to expedite
779 # support issues, many users are doing "rm -f /var/lib/rpm/__db*"
781 %_rpmlock_path %{_dbpath}/__db.000
783 #==============================================================================
784 # ---- per-platform macros.
785 # Macros that are specific to an individual platform. The values here
786 # will be used if the per-platform macro file does not exist..
788 %_arch @RPMCANONARCH@
789 %_build_arch @RPMCANONARCH@
790 %_vendor @RPMCANONVENDOR@
793 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
796 # Define a generic value for optflags. Normally overridden by per-target macros.
800 # ISA dependency marker, none for noarch and name-bitness for others
801 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
804 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
805 %__arch_install_post %{nil}
806 %__os_install_post %{___build_post}
808 #==============================================================================
809 # ---- Scriptlet template templates.
810 # Global defaults used for building scriptlet templates.
813 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
815 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
817 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
818 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
819 RPM_OPT_FLAGS=\"%{optflags}\"\
820 RPM_ARCH=\"%{_arch}\"\
822 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
823 RPM_DOC_DIR=\"%{_docdir}\"\
825 RPM_PACKAGE_NAME=\"%{name}\"\
826 RPM_PACKAGE_VERSION=\"%{version}\"\
827 RPM_PACKAGE_RELEASE=\"%{release}\"\
828 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
829 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
830 export RPM_BUILD_ROOT}\
831 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
834 %{verbose:set -x}%{!verbose:exec > /dev/null}\
836 cd \"%{u2p:%{_builddir}}\"\
839 #%___build_body %{nil}
840 %___build_post exit 0
842 %___build_template #!%{___build_shell}\
850 #==============================================================================
851 # ---- Scriptlet templates.
852 # Macro(s) that expand to a command and script that is executed.
853 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
855 %__spec_prep_shell %{___build_shell}
856 %__spec_prep_args %{___build_args}
857 %__spec_prep_cmd %{___build_cmd}
858 %__spec_prep_pre %{___build_pre}
859 %__spec_prep_body %{___build_body}
860 %__spec_prep_post %{___build_post}
861 %__spec_prep_template #!%{__spec_prep_shell}\
865 #%{__spec_prep_body}\
866 #%{__spec_prep_post}\
869 %__spec_build_shell %{___build_shell}
870 %__spec_build_args %{___build_args}
871 %__spec_build_cmd %{___build_cmd}
872 %__spec_build_pre %{___build_pre}
873 %__spec_build_body %{___build_body}
874 %__spec_build_post %{___build_post}
875 %__spec_build_template #!%{__spec_build_shell}\
879 #%{__spec_build_body}\
880 #%{__spec_build_post}\
883 %__spec_install_shell %{___build_shell}
884 %__spec_install_args %{___build_args}
885 %__spec_install_cmd %{___build_cmd}
886 %__spec_install_pre %{___build_pre}
887 %__spec_install_body %{___build_body}
888 %__spec_install_post\
889 %{?__debug_package:%{__debug_install_post}}\
890 %{__arch_install_post}\
891 %{__os_install_post}\
893 %__spec_install_template #!%{__spec_install_shell}\
894 %{__spec_install_pre}\
897 #%{__spec_install_body}\
898 #%{__spec_install_post}\
901 %__spec_check_shell %{___build_shell}
902 %__spec_check_args %{___build_args}
903 %__spec_check_cmd %{___build_cmd}
904 %__spec_check_pre %{___build_pre}
905 %__spec_check_body %{___build_body}
906 %__spec_check_post %{___build_post}
907 %__spec_check_template #!%{__spec_check_shell}\
911 #%{__spec_check_body}\
912 #%{__spec_check_post}\
915 #%__spec_autodep_shell %{___build_shell}
916 #%__spec_autodep_args %{___build_args}
917 #%__spec_autodep_cmd %{___build_cmd}
918 #%__spec_autodep_pre %{___build_pre}
919 #%__spec_autodep_body %{___build_body}
920 #%__spec_autodep_post %{___build_post}
921 #%__spec_autodep_template #!%{__spec_autodep_shell}\
922 #%{__spec_autodep_pre}\
925 #%{__spec_autodep_body}\
926 #%{__spec_autodep_post}\
929 %__spec_clean_shell %{___build_shell}
930 %__spec_clean_args %{___build_args}
931 %__spec_clean_cmd %{___build_cmd}
932 %__spec_clean_pre %{___build_pre}
933 %__spec_clean_body %{___build_body}
934 %__spec_clean_post %{___build_post}
935 %__spec_clean_template #!%{__spec_clean_shell}\
939 #%{__spec_clean_body}\
940 #%{__spec_clean_post}\
943 %__spec_rmbuild_shell %{___build_shell}
944 %__spec_rmbuild_args %{___build_args}
945 %__spec_rmbuild_cmd %{___build_cmd}
946 %__spec_rmbuild_pre %{___build_pre}
947 %__spec_rmbuild_body %{___build_body}
948 %__spec_rmbuild_post %{___build_post}
949 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
950 %{__spec_rmbuild_pre}\
953 #%{__spec_rmbuild_body}\
954 #%{__spec_rmbuild_post}\
957 # XXX We don't expand pre/post install scriptlets (yet).
958 #%__spec_pre_pre %{nil}
959 #%__spec_pre_post %{nil}
960 #%__spec_post_pre %{nil}
961 #%__spec_post_post %{nil}
962 #%__spec_preun_pre %{nil}
963 #%__spec_preun_post %{nil}
964 #%__spec_postun_pre %{nil}
965 #%__spec_postun_post %{nil}
966 #%__spec_triggerpostun_pre %{nil}
967 #%__spec_triggerpostun_post %{nil}
968 #%__spec_triggerun_pre %{nil}
969 #%__spec_triggerun_post %{nil}
970 #%__spec_triggerin_pre %{nil}
971 #%__spec_triggerin_post %{nil}
973 #==============================================================================
974 # ---- configure macros.
975 # Macro(s) slavishly copied from autoconf's config.status.
978 %_exec_prefix %{_prefix}
979 %_bindir %{_exec_prefix}/bin
980 %_sbindir %{_exec_prefix}/sbin
981 %_libexecdir %{_exec_prefix}/libexec
982 %_datadir %{_prefix}/share
984 %_sharedstatedir %{_prefix}/com
985 %_localstatedir %{_prefix}/var
987 %_libdir %{_exec_prefix}/%{_lib}
988 %_includedir %{_prefix}/include
989 %_infodir %{_datadir}/info
990 %_mandir %{_datadir}/man
992 #==============================================================================
993 # ---- config.guess platform macros.
994 # Macro(s) similar to the tokens used by configure.
997 %_build_alias %{_host_alias}
998 %_build_cpu %{_host_cpu}
999 %_build_vendor %{_host_vendor}
1000 %_build_os %{_host_os}
1002 %_host_alias @host_alias@%{nil}
1003 %_host_cpu @host_cpu@
1004 %_host_vendor @host_vendor@
1007 %_target_alias %{_host_alias}
1008 %_target_cpu %{_host_cpu}
1009 %_target_vendor %{_host_vendor}
1010 %_target_os %{_host_os}
1012 #==============================================================================
1013 # ---- specfile macros.
1014 # Macro(s) here can be used reliably for reproducible builds.
1015 # (Note: Above is the goal, below are the macros under development)
1017 # The configure macro does the following:
1018 # optionally change to a subdirectory (not implemented).
1019 # attempt to update config.guess and config.sub.
1020 # run configure with correct prefix, platform, and CFLAGS.
1021 # optionally restore current directory (not implemented).
1022 # The configure macro should be invoked as %configure (rather than %{configure})
1023 # because the rest of the arguments will be expanded using %*.
1025 # This is the version of %configure used through rpm-3.0.4.
1027 # %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
1028 # CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
1030 #------------------------------------------------------------------------------
1031 # This is an improved version of %configure (from PLD team).
1032 %_configure ./configure
1034 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1035 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1036 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1037 %{_configure} --host=%{_host} --build=%{_build} \\\
1038 --target=%{_target_platform} \\\
1039 --program-prefix=%{?_program_prefix} \\\
1040 --prefix=%{_prefix} \\\
1041 --exec-prefix=%{_exec_prefix} \\\
1042 --bindir=%{_bindir} \\\
1043 --sbindir=%{_sbindir} \\\
1044 --sysconfdir=%{_sysconfdir} \\\
1045 --datadir=%{_datadir} \\\
1046 --includedir=%{_includedir} \\\
1047 --libdir=%{_libdir} \\\
1048 --libexecdir=%{_libexecdir} \\\
1049 --localstatedir=%{_localstatedir} \\\
1050 --sharedstatedir=%{_sharedstatedir} \\\
1051 --mandir=%{_mandir} \\\
1052 --infodir=%{_infodir}
1054 #------------------------------------------------------------------------------
1055 # The make install analogue of %configure:
1058 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1059 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1060 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1061 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1062 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1063 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1064 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1065 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1066 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1067 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1068 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1069 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1070 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1073 #------------------------------------------------------------------------------
1074 # The GNUconfigure macro does the following:
1075 # update config.guess and config.sub.
1076 # regenerate all autoconf/automake files
1077 # optionally change to a directory (make the directory if requested).
1078 # run configure with correct prefix, platform, and CFLAGS.
1079 # optionally restore current directory.
1081 # Based on autogen.sh from GNOME and orginal GNUconfigure
1083 %GNUconfigure(MCs:) \
1084 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1085 LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1086 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1087 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1088 for coin in `echo ${dirs}` \
1090 dr=`dirname ${coin}`; \
1091 if test -f ${dr}/NO-AUTO-GEN; then \
1094 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1096 aclocalinclude="${ACLOCAL_FLAGS}"; \
1097 for k in ${macrodirs}; do \
1098 if test -d ${k}; then \
1099 aclocalinclude="${aclocalinclude} -I ${k}"; \
1101 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1104 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1105 if grep "sed.*POTFILES" configure.in >/dev/null; then \
1106 : do nothing -- we still have an old unmodified configure.in \
1108 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1109 echo "no" | gettextize --force --copy; \
1110 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1113 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1114 %{__libtoolize} --force --copy; \
1116 aclocal ${aclocalinclude}; \
1117 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1120 echo "Running automake --gnu ${am_opt} ..."; \
1121 %{__automake} --add-missing --gnu ${am_opt}; \
1126 %{-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} %* ; \
1127 %{-C:cd ${_mydir}; unset _mydir}
1129 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1130 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1132 #------------------------------------------------------------------------------
1133 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1135 # For example, these can be used as (from ImageMagick.spec from PLD site)
1140 # Summary: libraries and modules for access to ImageMagick from perl
1141 # Group: Development/Languages/Perl
1142 # Requires: %{name} = %{version}
1146 # rm -fr $RPM_BUILD_ROOT
1147 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1150 # %defattr(644,root,root,755)
1151 # %{perl_sitearch}/Image
1152 # %dir %{perl_sitearch}/auto/Image
1154 %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")
1155 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1156 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1157 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1158 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1159 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1160 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1162 #------------------------------------------------------------------------------
1163 # arch macro for all Intel i?86 compatibile processors
1164 # (Note: This macro (and it's analogues) will probably be obsoleted when
1165 # rpm can use regular expressions against target platforms in macro
1168 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1170 #------------------------------------------------------------------------------
1171 # arch macro for all supported ARM processors
1172 %arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l
1174 #------------------------------------------------------------------------------
1175 # arch macro for all supported Sparc processors
1176 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1178 #------------------------------------------------------------------------------
1179 # arch macro for all supported Alpha processors
1180 %alpha alpha alphaev56 alphaev6 alphaev67
1182 #------------------------------------------------------------------------
1183 # Use in %install to generate locale specific file lists. For example,
1187 # %find_lang %{name}
1189 # %files -f %{name}.lang
1191 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1193 # Commands + opts to use for retrieving remote files
1194 %__urlhelpercmd @__CURL@
1195 %__urlhelperopts --silent --show-error --fail --location -o
1196 %_urlhelper %{__urlhelpercmd} %{__urlhelperopts}