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 # Configurable bug URL, same as BugURL: tag in a specfile.
264 # The URL will be used to supply reliable information to where
269 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
270 # marked as %doc should be installed.
273 # The port and machine name of a FTP proxy host running TIS firewall.
278 # The signature to use and the location of configuration files for
279 # signing packages with GNU gpg.
284 # The port and machine name of an HTTP proxy host.
289 # The PATH put into the environment before running %pre/%post et al.
291 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
293 # A colon separated list of desired locales to be installed;
294 # "all" means install all locale specific files.
298 # The value of CLASSPATH in build scriptlets (iff configured).
302 # Import packaging conventions from jpackage.org (prefixed with _
303 # to avoid name collisions).
305 %_javadir %{_datadir}/java
306 %_javadocdir %{_datadir}/javadoc
308 # A colon separated list of paths where files should *not* be installed.
309 # Usually, these are network file system mount points.
314 # The type of pattern match used on rpmdb iterator selectors:
315 # "default" simple glob-like regex, periods will be escaped,
316 # splats will have period prepended, full "^...$" match
317 # required. Also, file path tags will use glob(7).
318 # "strcmp" compare strings
319 # "regex" regex(7) patterns using regcomp(3)/regexec(3)
320 # "glob" glob(7) patterns using fnmatch(3)
322 %_query_selector_match default
324 # Configurable packager information, same as Packager: in a specfile.
328 # Compression type and level for source/binary package payloads.
329 # "w9.gzdio" gzip level 9 (default).
330 # "w9.bzdio" bzip2 level 9.
331 # "w7.xzdio" xz level 7, xz's default.
332 # "w7.lzdio" lzma-alone level 7, lzma's default
334 #%_source_payload w9.gzdio
335 #%_binary_payload w9.gzdio
337 # Algorithm to use for generating file checksum digests on build.
338 # If not specified or 0, MD5 is used.
339 # WARNING: non-MD5 is backwards incompatible, don't enable lightly!
340 # The supported algorithms may depend on NSS version, as of NSS
341 # 3.11.99.5 the following are supported:
348 #%_source_filedigest_algorithm 1
349 #%_binary_filedigest_algorithm 1
351 # Configurable vendor information, same as Vendor: in a specfile.
355 # Default fuzz level for %patch in spec file.
356 %_default_patch_fuzz 0
358 # Default patch flags
359 %_default_patch_flags -s
361 #==============================================================================
362 # ---- Build configuration macros.
364 # Script gets packaged file list on input and buildroot as first parameter.
365 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
367 # Note: Disable (by commenting out) for legacy compatibility.
368 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
371 # Should unpackaged files in a build root terminate a build?
373 # Note: The default value should be 0 for legacy compatibility.
374 %_unpackaged_files_terminate_build 1
377 # Should missing %doc files in the build directory terminate a build?
379 # Note: The default value should be 0 for legacy compatibility.
380 %_missing_doc_files_terminate_build 1
383 # Should binaries in noarch packages terminate a build?
384 %_binaries_in_noarch_packages_terminate_build 1
387 # Program to call for each successfully built and written binary package.
388 # The package name is passed to the program as a command-line argument.
390 #%_build_pkgcheck %{_bindir}/rpmlint
393 # Program to call for the whole binary package set after build.
394 # The package set is passed to the program via command-line arguments.
396 #%_build_pkgcheck_set %{_bindir}/rpmlint
399 # Program to call for successfully built and written SRPM.
400 # The package name is passed to the program as a command-line argument.
402 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
405 # Should the build of packages fail if package checker (if defined) returns
406 # non-zero exit status?
408 #%_nonzero_exit_pkgcheck_terminate_build 1
411 # Should an ELF file processed by find-debuginfo.sh having no build ID
412 # terminate a build? This is left undefined to disable it and defined to
415 #%_missing_build_ids_terminate_build 1
418 # Use internal dependency generator rather than external helpers?
419 %_use_internal_dependency_generator 1
422 # Filter GLIBC_PRIVATE Provides: and Requires:
423 %_filter_GLIBC_PRIVATE 0
425 # Desired selinux policy tree
426 %__policy_tree %{expand:%%global __policy_tree %{lua:\
428 f = io.open("/etc/selinux/config")\
430 for l in f:lines() do\
431 if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
438 # Path to selinux file context patterns.
439 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
441 # Directories whose contents should be considered as documentation.
442 %__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
445 # Path to selinux file context patterns used to add
446 # RPMTAG_FILECONTEXTS to packages when building.
448 # Undefined, missing or %{nil} will disable.
449 %_build_file_context_path %{nil}
452 # Path to selinux file context patterns used to set
453 # (or override package content) file contexts when installing.
455 # Undefined, missing or %{nil} will use package content (if available).
456 %_install_file_context_path %{__file_context_path}
459 # Path to selinux file context patterns used to verify
460 # file contexts on file system.
462 # Undefined, missing or %{nil} will use package content (if available).
463 %_verify_file_context_path %{__file_context_path}
466 # Path to scripts to autogenerate package dependencies,
468 # Note: Used iff _use_internal_dependency_generator is zero.
469 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
470 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
471 %__find_provides %{_rpmconfigdir}/find-provides
472 %__find_requires %{_rpmconfigdir}/find-requires
473 #%__find_conflicts ???
474 #%__find_obsoletes ???
477 # Path to scripts to autogenerate per-interpreter package dependencies,
479 # Note: Used iff _use_internal_dependency_generator is non-zero. The
480 # helpers are also used by %{_rpmconfigdir}/rpmdeps {--provides|--requires}.
481 #%__perl_provides %{_rpmconfigdir}/perldeps.pl --provides
482 #%__perl_requires %{_rpmconfigdir}/perldeps.pl --requires
483 %__perl_provides %{_rpmconfigdir}/perl.prov
484 %__perl_requires %{_rpmconfigdir}/perl.req
486 %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
487 %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
489 %__mono_provides %{_rpmconfigdir}/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
490 %__mono_requires %{_rpmconfigdir}/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
492 %__libtool_provides %{_rpmconfigdir}/libtooldeps.sh --provides %{buildroot} %{name}
493 %__libtool_requires %{_rpmconfigdir}/libtooldeps.sh --requires %{buildroot} %{name}
495 %__pkgconfig_provides %{_rpmconfigdir}/pkgconfigdeps.sh --provides
496 %__pkgconfig_requires %{_rpmconfigdir}/pkgconfigdeps.sh --requires
498 %__fontconfig_provides %{_rpmconfigdir}/fontconfig.prov
499 %__desktop_provides %{_rpmconfigdir}/desktop-file.prov
501 #==============================================================================
502 # ---- Database configuration macros.
503 # Macros used to configure Berkley db parameters.
505 # rpmdb macro configuration values are a colon (or white space) separated
506 # list of tokens, with an optional '!' negation to explicitly disable bit
507 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
508 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
509 # (e.g. %_dbi_config). The configuration is also conditioned on the
510 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
511 # the configuration while rebuilding an rpmdb database.
513 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
514 # see that for the latest gory details. Note carefully that, unless you
515 # are writing an rpm installer, you shouldn't have to touch *any* of these
518 # Here's a short list of the tokens, with a guess of whether the option is
520 # (nothing) currently used in rpm, known to work.
521 # "+++" under development, will be supported in rpm eventually.
522 # "???" I have no clue, you're mostly on your own.
524 # If you do find yourself inclined to fiddle, here's what I see (shrug):
525 # 1) Only the value of mp_size has any serious impact on overall performance,
526 # and you will need ~256Kb to handle a typical machine install.
527 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
528 # will ever need tuning. Diddle the pagesize if you're interested, although
529 # I believe that you will find pagesize=512 "best".
530 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
531 # and/or mp_size instead.
532 # 4) btree is faster than hash, but would require some painful rpm release
533 # engineering to convert everbody's databases to btree, not gonna happen
536 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
539 # token works? Berkeley db flag or value
540 #==================================================
541 #---------------------- DBENV->open parameters and tunable values:
542 # mmapsize=16Mb DBENV->set_mp_mmapsize
543 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
544 #---------------------- DBENV->open and DB->open common bits:
546 # thread ??? DB_THREAD (useless w/o posix mutexes on linux)
547 #---------------------- DBENV->open bits:
548 # joinenv DB_JOIN_ENV
549 # mpool DB_INIT_MPOOL
550 # cdb +++ DB_INIT_CDB
551 # txn ??? DB_INIT_TXN
552 # log ??? DB_INIT_LOG
553 # lock ??? DB_INIT_LOCK
554 # recover ??? DB_RECOVER
555 # recover_fatal ??? DB_RECOVER_FATAL
556 # use_environ ??? DB_USE_ENVIRON
557 # use_environ_root ??? DB_USE_ENVIRON_ROOT
558 # private +++ DB_PRIVATE
559 # lockdown ??? DB_LOCKDOWN
560 # shared +++ DB_SYSTEM_MEM
561 #---------------------- DB->open parameters and tunable values:
562 # pagesize=512 +++ DB->set_pagesize
563 #---------------------- DB->open bits:
565 # nommap ??? DB_NOMMAP
567 #---------------------- DB->open types:
572 # unknown +++ DB_UNKNOWN
573 #---------------------- DB->set_flags bits:
574 # bt_dup +++ (btree only) DB_DUP
575 # bt_dupsort +++ (btree only) DB_DUPSORT
576 # ht_dup +++ (hash only) DB_DUP
577 # ht_dupsort +++ (hash only) DB_DUPSORT
578 #----------------------- rpmdb specific configuration:
579 # usedbenv (always on) Use db3 environment?
580 # verify (db3 only) Verify Packages db after RW close?
581 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
582 # nofsync Disable fsync(2) call performed after db3 writes?
583 # temporary Unlink file when closing.
586 # XXX Use transactions and logs for rpmdb durability (no clue yet):
587 #%__dbi_other create joinenv mpool txn log \
588 # mp_mmapsize=8Mb mp_size=512Kb
590 # Use a CDB database model for concurrent access.
591 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
592 %__dbi_cdb create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
594 %__dbi_other %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
596 # Note: adding nofsync here speeds up --rebuilddb a lot.
597 %__dbi_rebuild nofsync !log !txn !cdb
598 %__dbi_transient %{__dbi_rebuild} temporary private
599 %__dbi_perms perms=0644
602 #--- Hash database configuration
609 %__dbi_htconfig_current %{__dbi_htconfig}
610 %__dbi_htconfig_rebuild %{__dbi_htconfig} %{__dbi_rebuild}
613 %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
614 %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
618 #--- Btree database configuration
625 %__dbi_btconfig_current %{__dbi_btconfig}
626 %__dbi_btconfig_rebuild %{__dbi_btconfig} %{__dbi_rebuild}
629 %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
630 %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
633 # The list of tags for which indices will be built.
634 %_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Obsoletename:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Depends:Pubkeys
636 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
637 %_dbi_config_Packages %{_dbi_htconfig} lockdbfd
639 # "Depends" is a per-transaction cache of known dependency resolutions.
640 %_dbi_config_Depends %{_dbi_htconfig} temporary private
642 %_dbi_config_Dirnames %{_dbi_btconfig}
643 %_dbi_config_Requireversion %{_dbi_btconfig}
644 %_dbi_config_Provideversion %{_dbi_btconfig}
645 %_dbi_config_Installtid %{_dbi_btconfig}
646 %_dbi_config_Removetid %{_dbi_btconfig}
648 %_dbi_config %{_dbi_htconfig}
650 # XXX legacy configuration.
651 # Choose db interface:
652 # 3 native db3 interface.
654 # There are two macros so that --rebuilddb can convert db1 -> db3.
659 #==============================================================================
660 # ---- GPG/PGP/PGP5 signature macros.
661 # Macro(s) to hold the arguments passed to GPG/PGP for package
662 # signing and verification.
664 %__gpg_check_password_cmd %{__gpg} \
665 gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
667 %__gpg_sign_cmd %{__gpg} \
668 gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
669 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
671 # XXX rpm >= 4.1 verifies signatures internally
672 #%__gpg_verify_cmd %{__gpg} \
673 # gpg --batch --no-verbose --verify --no-secmem-warning \
674 # %{__signature_filename} %{__plaintext_filename}
676 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
677 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
678 # with the prelink package. If the macro is undefined, then prelinked
679 # shared libraries contents are MD5 digest verified (as usual), rather
680 # than MD5 verifying the output of the prelink undo helper.
682 # Note: The 2nd token is used as argv[0] and "library" is a
683 # placeholder that will be deleted and replaced with the appropriate
685 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
687 # Horowitz Key Protocol server configuration
689 %_hkp_keyserver http://pgp.mit.edu
690 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
692 #==============================================================================
693 # ---- Transaction macros.
694 # Macro(s) used to parameterize transactions.
696 # The output binary package file name template used when building
699 # XXX Note: escaped %% for use in headerSprintf()
700 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
702 # The default transaction color. This value is a set of bits to
703 # determine file and dependency affinity for this arch.
704 # 0 uncolored (i.e. use only arch as install hint)
707 %_transaction_color @RPMCANONCOLOR@
709 # Verify digest/signature flags for various rpm modes:
710 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
711 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
712 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
713 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
715 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
716 # digest/signature checking, disables signature checking, but attempts
717 # digest checking, also when retrieving headers from the database.
720 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
723 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
725 # at the python prompt for example, after "import rpm".
727 # The checking overhead is ~11ms per header for digests/signatures;
728 # each header from the database is checked only when first encountered
729 # for each database open.
731 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
735 %_vsflags_build %{__vsflags}
736 %_vsflags_erase %{__vsflags}
737 %_vsflags_install %{__vsflags}
738 %_vsflags_query %{__vsflags}
739 %_vsflags_rebuilddb %{__vsflags}
740 %_vsflags_verify %{__vsflags}
742 # Relations between package names that cause dependency loops
743 # with legacy packages that cannot be fixed. Relations are
746 # where package p has a Requires: on something that package q Provides:
748 # XXX Note: that there cannot be any whitespace within the string "p>q",
749 # and that both p and q are package names (i.e. no version/release).
752 %_dependency_whiteout \
756 # Default output format string for rpm -qa
758 # XXX Note: escaped %% for use in headerFormat()
759 %_query_all_fmt %%{nvra}
762 # Default path to the file used for transaction fcntl lock.
763 %_rpmlock_path %{_dbpath}/.rpm.lock
765 #==============================================================================
766 # ---- per-platform macros.
767 # Macros that are specific to an individual platform. The values here
768 # will be used if the per-platform macro file does not exist..
770 %_arch @RPMCANONARCH@
771 %_build_arch @RPMCANONARCH@
772 %_vendor @RPMCANONVENDOR@
775 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
778 # Define a generic value for optflags. Normally overridden by per-target macros.
782 # ISA dependency marker, none for noarch and name-bitness for others
783 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
786 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
787 %__arch_install_post %{nil}
788 %__os_install_post %{___build_post}
790 #==============================================================================
791 # ---- Scriptlet template templates.
792 # Global defaults used for building scriptlet templates.
795 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
797 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
799 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
800 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
801 RPM_OPT_FLAGS=\"%{optflags}\"\
802 RPM_ARCH=\"%{_arch}\"\
804 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
805 RPM_DOC_DIR=\"%{_docdir}\"\
807 RPM_PACKAGE_NAME=\"%{name}\"\
808 RPM_PACKAGE_VERSION=\"%{version}\"\
809 RPM_PACKAGE_RELEASE=\"%{release}\"\
810 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
813 unset CDPATH DISPLAY ||:\
814 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
815 export RPM_BUILD_ROOT}\
816 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
819 %{verbose:set -x}%{!verbose:exec > /dev/null}\
821 cd \"%{u2p:%{_builddir}}\"\
824 #%___build_body %{nil}
825 %___build_post exit 0
827 %___build_template #!%{___build_shell}\
835 #==============================================================================
836 # ---- Scriptlet templates.
837 # Macro(s) that expand to a command and script that is executed.
838 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
840 %__spec_prep_shell %{___build_shell}
841 %__spec_prep_args %{___build_args}
842 %__spec_prep_cmd %{___build_cmd}
843 %__spec_prep_pre %{___build_pre}
844 %__spec_prep_body %{___build_body}
845 %__spec_prep_post %{___build_post}
846 %__spec_prep_template #!%{__spec_prep_shell}\
850 #%{__spec_prep_body}\
851 #%{__spec_prep_post}\
854 %__spec_build_shell %{___build_shell}
855 %__spec_build_args %{___build_args}
856 %__spec_build_cmd %{___build_cmd}
857 %__spec_build_pre %{___build_pre}
858 %__spec_build_body %{___build_body}
859 %__spec_build_post %{___build_post}
860 %__spec_build_template #!%{__spec_build_shell}\
864 #%{__spec_build_body}\
865 #%{__spec_build_post}\
868 %__spec_install_shell %{___build_shell}
869 %__spec_install_args %{___build_args}
870 %__spec_install_cmd %{___build_cmd}
871 %__spec_install_pre %{___build_pre}
872 %__spec_install_body %{___build_body}
873 %__spec_install_post\
874 %{?__debug_package:%{__debug_install_post}}\
875 %{__arch_install_post}\
876 %{__os_install_post}\
878 %__spec_install_template #!%{__spec_install_shell}\
879 %{__spec_install_pre}\
882 #%{__spec_install_body}\
883 #%{__spec_install_post}\
886 %__spec_check_shell %{___build_shell}
887 %__spec_check_args %{___build_args}
888 %__spec_check_cmd %{___build_cmd}
889 %__spec_check_pre %{___build_pre}
890 %__spec_check_body %{___build_body}
891 %__spec_check_post %{___build_post}
892 %__spec_check_template #!%{__spec_check_shell}\
896 #%{__spec_check_body}\
897 #%{__spec_check_post}\
900 #%__spec_autodep_shell %{___build_shell}
901 #%__spec_autodep_args %{___build_args}
902 #%__spec_autodep_cmd %{___build_cmd}
903 #%__spec_autodep_pre %{___build_pre}
904 #%__spec_autodep_body %{___build_body}
905 #%__spec_autodep_post %{___build_post}
906 #%__spec_autodep_template #!%{__spec_autodep_shell}\
907 #%{__spec_autodep_pre}\
910 #%{__spec_autodep_body}\
911 #%{__spec_autodep_post}\
914 %__spec_clean_shell %{___build_shell}
915 %__spec_clean_args %{___build_args}
916 %__spec_clean_cmd %{___build_cmd}
917 %__spec_clean_pre %{___build_pre}
918 %__spec_clean_body %{___build_body}
919 %__spec_clean_post %{___build_post}
920 %__spec_clean_template #!%{__spec_clean_shell}\
924 #%{__spec_clean_body}\
925 #%{__spec_clean_post}\
928 %__spec_rmbuild_shell %{___build_shell}
929 %__spec_rmbuild_args %{___build_args}
930 %__spec_rmbuild_cmd %{___build_cmd}
931 %__spec_rmbuild_pre %{___build_pre}
932 %__spec_rmbuild_body %{___build_body}
933 %__spec_rmbuild_post %{___build_post}
934 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
935 %{__spec_rmbuild_pre}\
938 #%{__spec_rmbuild_body}\
939 #%{__spec_rmbuild_post}\
942 # XXX We don't expand pre/post install scriptlets (yet).
943 #%__spec_pre_pre %{nil}
944 #%__spec_pre_post %{nil}
945 #%__spec_post_pre %{nil}
946 #%__spec_post_post %{nil}
947 #%__spec_preun_pre %{nil}
948 #%__spec_preun_post %{nil}
949 #%__spec_postun_pre %{nil}
950 #%__spec_postun_post %{nil}
951 #%__spec_triggerpostun_pre %{nil}
952 #%__spec_triggerpostun_post %{nil}
953 #%__spec_triggerun_pre %{nil}
954 #%__spec_triggerun_post %{nil}
955 #%__spec_triggerin_pre %{nil}
956 #%__spec_triggerin_post %{nil}
958 #==============================================================================
959 # ---- configure macros.
960 # Macro(s) slavishly copied from autoconf's config.status.
963 %_exec_prefix %{_prefix}
964 %_bindir %{_exec_prefix}/bin
965 %_sbindir %{_exec_prefix}/sbin
966 %_libexecdir %{_exec_prefix}/libexec
967 %_datadir %{_prefix}/share
969 %_sharedstatedir %{_prefix}/com
970 %_localstatedir %{_prefix}/var
972 %_libdir %{_exec_prefix}/%{_lib}
973 %_includedir %{_prefix}/include
974 %_infodir %{_datadir}/info
975 %_mandir %{_datadir}/man
977 #==============================================================================
978 # ---- config.guess platform macros.
979 # Macro(s) similar to the tokens used by configure.
982 %_build_alias %{_host_alias}
983 %_build_cpu %{_host_cpu}
984 %_build_vendor %{_host_vendor}
985 %_build_os %{_host_os}
987 %_host_alias @host_alias@%{nil}
988 %_host_cpu @host_cpu@
989 %_host_vendor @host_vendor@
992 %_target_alias %{_host_alias}
993 %_target_cpu %{_host_cpu}
994 %_target_vendor %{_host_vendor}
995 %_target_os %{_host_os}
997 #==============================================================================
998 # ---- specfile macros.
999 # Macro(s) here can be used reliably for reproducible builds.
1000 # (Note: Above is the goal, below are the macros under development)
1002 # The configure macro runs autoconf configure script with platform specific
1003 # directory structure (--prefix, --libdir etc) and compiler flags
1006 # The configure macro should be invoked as %configure (rather than %{configure})
1007 # because the rest of the arguments will be expanded using %*.
1009 %_configure ./configure
1011 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1012 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1013 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1014 %{_configure} --host=%{_host} --build=%{_build} \\\
1015 --program-prefix=%{?_program_prefix} \\\
1016 --prefix=%{_prefix} \\\
1017 --exec-prefix=%{_exec_prefix} \\\
1018 --bindir=%{_bindir} \\\
1019 --sbindir=%{_sbindir} \\\
1020 --sysconfdir=%{_sysconfdir} \\\
1021 --datadir=%{_datadir} \\\
1022 --includedir=%{_includedir} \\\
1023 --libdir=%{_libdir} \\\
1024 --libexecdir=%{_libexecdir} \\\
1025 --localstatedir=%{_localstatedir} \\\
1026 --sharedstatedir=%{_sharedstatedir} \\\
1027 --mandir=%{_mandir} \\\
1028 --infodir=%{_infodir}
1030 #------------------------------------------------------------------------------
1031 # The make install analogue of %configure for modern autotools:
1032 %make_install make install DESTDIR=%{?buildroot}
1034 #------------------------------------------------------------------------------
1035 # Former make install analogue, kept for compatibility and for old/broken
1036 # packages that don't support DESTDIR properly.
1039 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1040 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1041 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1042 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1043 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1044 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1045 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1046 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1047 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1048 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1049 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1050 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1051 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1054 #------------------------------------------------------------------------------
1055 # The GNUconfigure macro does the following:
1056 # update config.guess and config.sub.
1057 # regenerate all autoconf/automake files
1058 # optionally change to a directory (make the directory if requested).
1059 # run configure with correct prefix, platform, and CFLAGS.
1060 # optionally restore current directory.
1062 # Based on autogen.sh from GNOME and orginal GNUconfigure
1064 %GNUconfigure(MCs:) \
1065 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1066 LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1067 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1068 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1069 for coin in `echo ${dirs}` \
1071 dr=`dirname ${coin}`; \
1072 if test -f ${dr}/NO-AUTO-GEN; then \
1075 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1077 aclocalinclude="${ACLOCAL_FLAGS}"; \
1078 for k in ${macrodirs}; do \
1079 if test -d ${k}; then \
1080 aclocalinclude="${aclocalinclude} -I ${k}"; \
1082 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1085 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1086 if grep "sed.*POTFILES" configure.in >/dev/null; then \
1087 : do nothing -- we still have an old unmodified configure.in \
1089 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1090 echo "no" | gettextize --force --copy; \
1091 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1094 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1095 %{__libtoolize} --force --copy; \
1097 aclocal ${aclocalinclude}; \
1098 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1101 echo "Running automake --gnu ${am_opt} ..."; \
1102 %{__automake} --add-missing --gnu ${am_opt}; \
1107 %{-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} %* ; \
1108 %{-C:cd ${_mydir}; unset _mydir}
1110 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1111 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1113 #------------------------------------------------------------------------------
1114 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1116 # For example, these can be used as (from ImageMagick.spec from PLD site)
1121 # Summary: libraries and modules for access to ImageMagick from perl
1122 # Group: Development/Languages/Perl
1123 # Requires: %{name} = %{version}
1127 # rm -fr $RPM_BUILD_ROOT
1128 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1131 # %defattr(644,root,root,755)
1132 # %{perl_sitearch}/Image
1133 # %dir %{perl_sitearch}/auto/Image
1135 %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")
1136 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1137 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1138 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1139 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1140 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1141 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1143 #------------------------------------------------------------------------------
1144 # Useful python macros for determining python version and paths
1146 %python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
1147 %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
1148 %python_version %(%{__python} -c "import sys; print sys.version[:3]")
1150 #------------------------------------------------------------------------------
1151 # arch macro for all Intel i?86 compatibile processors
1152 # (Note: This macro (and it's analogues) will probably be obsoleted when
1153 # rpm can use regular expressions against target platforms in macro
1156 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1158 #------------------------------------------------------------------------------
1159 # arch macro for all supported ARM processors
1160 %arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
1162 #------------------------------------------------------------------------------
1163 # arch macro for all supported Sparc processors
1164 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1166 #------------------------------------------------------------------------------
1167 # arch macro for all supported Alpha processors
1168 %alpha alpha alphaev56 alphaev6 alphaev67
1170 #------------------------------------------------------------------------
1171 # Use in %install to generate locale specific file lists. For example,
1175 # %find_lang %{name}
1177 # %files -f %{name}.lang
1179 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1181 # Commands + opts to use for retrieving remote files
1182 %__urlhelpercmd @__CURL@
1183 %__urlhelperopts --silent --show-error --fail --location -o
1184 %_urlhelper %{__urlhelpercmd} %{__urlhelperopts}