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.
48 %__install @__INSTALL@
50 # Deprecated, use %__xz instead.
51 %__lzma %__xz --format=lzma
55 %__mkdir_p @__MKDIR_P@
60 %__restorecon @__RESTORECON@
64 %__semodule @__SEMODULE@
69 #==============================================================================
70 # ---- Build system path macros.
79 %__objcopy @__OBJCOPY@
80 %__objdump @__OBJDUMP@
85 # XXX avoid failures if tools are not installed when rpm is built.
86 %__libtoolize libtoolize
88 %__autoheader autoheader
92 #==============================================================================
93 # Conditional build stuff.
95 # Check if symbol is defined.
96 # Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
97 %defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
98 %undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
100 # Shorthand for %{defined with_...}
101 %with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
102 %without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
104 # Handle conditional builds. %bcond_with is for case when feature is
105 # default off and needs to be activated with --with ... command line
106 # switch. %bcond_without is for the dual case.
108 # %bcond_with foo defines symbol with_foo if --with foo was specified on
110 # %bcond_without foo defines symbol with_foo if --without foo was *not*
111 # specified on command line.
113 # For example (spec file):
116 # %bcond_with extra_fonts
117 # %bcond_without static
119 # %if %{with extra_fonts}
124 # %if ! %{with static}
127 # %ifdef %{with static}
130 # %{?with_static: ... }
131 # %{!?with_static: ... }
132 # %{?with_extra_fonts: ... }
133 # %{!?with_extra_fonts: ... }
136 # The bottom line: never use without_foo, _with_foo nor _without_foo, only
137 # with_foo. This way changing default set of bconds for given spec is just
138 # a matter of changing single line in it and syntax is more readable.
139 %bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
140 %bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
142 #==============================================================================
143 # ---- Required rpmrc macros.
144 # Macros that used to be initialized as a side effect of rpmrc parsing.
145 # These are the default values that can be overridden by other
146 # (e.g. per-platform, per-system, per-packager, per-package) macros.
148 # The directory where rpm's configuration and scripts live
149 %_rpmconfigdir %{getconfdir}
151 # The directory where sources/patches will be unpacked and built.
152 %_builddir %{_topdir}/BUILD
154 # The interpreter used for build scriptlets.
157 # The path to the bzip2 executable (legacy, use %{__bzip2} instead).
158 %_bzip2bin %{__bzip2}
160 # The location of the rpm database file(s).
161 %_dbpath %{_var}/lib/rpm
163 # The location of the rpm database file(s) after "rpm --rebuilddb".
164 %_dbpath_rebuild %{_dbpath}
166 %_keyringpath %{_dbpath}/pubkeys/
169 # Path to script that creates debug symbols in a /usr/lib/debug
172 # A spec file can %%define _find_debuginfo_opts to pass options to
173 # the script. See the script for details.
175 %__debug_install_post \
176 %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
179 # Template for debug information sub-package.
182 %global __debug_package 1\
184 Summary: Debug information for package %{name}\
185 Group: Development/Debug\
188 This package provides debug information for package %{name}.\
189 Debug information is useful when developing applications that use this\
190 package or when debugging this package.\
191 %files debug -f debugfiles.list\
192 %defattr(-,root,root)\
196 %_defaultdocdir %{_datadir}/doc
198 # The path to the gzip executable (legacy, use %{__gzip} instead).
201 # The Unix time of the latest kept changelog entry in binary packages.
202 # Any older entry is not packaged in binary packages.
203 %_changelog_trimtime 0
205 # The directory where newly built binary packages will be written.
206 %_rpmdir %{_topdir}/RPMS
208 # A template used to generate the output binary package file name
210 %_rpmfilename %{_build_name_fmt}
212 # The default signature type.
215 # The directory where sources/patches from a source package will be
216 # installed. This is also where sources/patches are found when building.
217 %_sourcedir %{_topdir}/SOURCES
219 # The directory where the spec file from a source package will be
221 %_specdir %{_topdir}/SPECS
223 # The directory where newly built source packages will be written.
224 %_srcrpmdir %{_topdir}/SRPMS
226 # The directory where buildroots will be created.
227 %_buildrootdir %{_topdir}/BUILDROOT
229 # Build root path, where %install installs the package during build.
230 %buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
232 # Directory where temporaray files can be created.
233 %_tmppath %{_var}/tmp
235 # Path to top of build area.
236 %_topdir %{getenv:HOME}/rpmbuild
238 # The path to the unzip executable (legacy, use %{__unzip} instead).
239 %_unzipbin %{__unzip}
241 #==============================================================================
242 # ---- Optional rpmrc macros.
243 # Macros that are initialized as a side effect of rpmrc and/or spec
246 # The sub-directory (relative to %{_builddir}) where sources are compiled.
247 # This macro is set after processing %setup, either explicitly from the
248 # value given to -n or the default name-version.
252 # Configurable distribution information, same as Distribution: tag in a
257 # Configurable distribution URL, same as DistURL: tag in a specfile.
258 # The URL will be used to supply reliable information to tools like
261 # Note: You should not configure with disturl (or build packages with
262 # the DistURL: tag) unless you are willing to supply content in a
263 # yet-to-be-determined format at the URL specified.
267 # Configurable bug URL, same as BugURL: tag in a specfile.
268 # The URL will be used to supply reliable information to where
273 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
274 # marked as %doc should be installed.
277 # The port and machine name of a FTP proxy host running TIS firewall.
282 # The signature to use and the location of configuration files for
283 # signing packages with GNU gpg.
288 # The port and machine name of an HTTP proxy host.
293 # The PATH put into the environment before running %pre/%post et al.
295 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
297 # A colon separated list of desired locales to be installed;
298 # "all" means install all locale specific files.
302 # The value of CLASSPATH in build scriptlets (iff configured).
306 # Import packaging conventions from jpackage.org (prefixed with _
307 # to avoid name collisions).
309 %_javadir %{_datadir}/java
310 %_javadocdir %{_datadir}/javadoc
312 # A colon separated list of paths where files should *not* be installed.
313 # Usually, these are network file system mount points.
318 # The type of pattern match used on rpmdb iterator selectors:
319 # "default" simple glob-like regex, periods will be escaped,
320 # splats will have period prepended, full "^...$" match
321 # required. Also, file path tags will use glob(7).
322 # "strcmp" compare strings
323 # "regex" regex(7) patterns using regcomp(3)/regexec(3)
324 # "glob" glob(7) patterns using fnmatch(3)
326 %_query_selector_match default
328 # Configurable packager information, same as Packager: in a specfile.
332 # Compression type and level for source/binary package payloads.
333 # "w9.gzdio" gzip level 9 (default).
334 # "w9.bzdio" bzip2 level 9.
335 # "w7.xzdio" xz level 7, xz's default.
336 # "w7.lzdio" lzma-alone level 7, lzma's default
338 #%_source_payload w9.gzdio
339 #%_binary_payload w9.gzdio
341 # Algorithm to use for generating file checksum digests on build.
342 # If not specified or 0, MD5 is used.
343 # WARNING: non-MD5 is backwards incompatible, don't enable lightly!
344 # The supported algorithms may depend on NSS version, as of NSS
345 # 3.11.99.5 the following are supported:
352 #%_source_filedigest_algorithm 1
353 #%_binary_filedigest_algorithm 1
355 # Configurable vendor information, same as Vendor: in a specfile.
359 # Default fuzz level for %patch in spec file.
360 %_default_patch_fuzz 0
362 # Default patch flags
363 %_default_patch_flags -s
365 #==============================================================================
366 # ---- Build configuration macros.
368 # Script gets packaged file list on input and buildroot as first parameter.
369 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
371 # Note: Disable (by commenting out) for legacy compatibility.
372 %__check_files %{_rpmconfigdir}/check-files %{buildroot}
375 # Should unpackaged files in a build root terminate a build?
377 # Note: The default value should be 0 for legacy compatibility.
378 %_unpackaged_files_terminate_build 1
381 # Should missing %doc files in the build directory terminate a build?
383 # Note: The default value should be 0 for legacy compatibility.
384 %_missing_doc_files_terminate_build 1
387 # Should binaries in noarch packages terminate a build?
388 %_binaries_in_noarch_packages_terminate_build 1
391 # Program to call for each successfully built and written binary package.
392 # The package name is passed to the program as a command-line argument.
394 #%_build_pkgcheck %{_bindir}/rpmlint
397 # Program to call for the whole binary package set after build.
398 # The package set is passed to the program via command-line arguments.
400 #%_build_pkgcheck_set %{_bindir}/rpmlint
403 # Program to call for successfully built and written SRPM.
404 # The package name is passed to the program as a command-line argument.
406 #%_build_pkgcheck_srpm %{_bindir}/rpmlint
409 # Should the build of packages fail if package checker (if defined) returns
410 # non-zero exit status?
412 #%_nonzero_exit_pkgcheck_terminate_build 1
415 # Should an ELF file processed by find-debuginfo.sh having no build ID
416 # terminate a build? This is left undefined to disable it and defined to
419 #%_missing_build_ids_terminate_build 1
422 # Use internal dependency generator rather than external helpers?
423 %_use_internal_dependency_generator 1
426 # Filter GLIBC_PRIVATE Provides: and Requires:
427 %_filter_GLIBC_PRIVATE 0
429 # Desired selinux policy tree
430 %__policy_tree %{expand:%%global __policy_tree %{lua:\
432 f = io.open("/etc/selinux/config")\
434 for l in f:lines() do\
435 if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
442 # Path to selinux file context patterns.
443 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
445 # Directories whose contents should be considered as documentation.
446 %__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
449 # Path to selinux file context patterns used to add
450 # RPMTAG_FILECONTEXTS to packages when building.
452 # Undefined, missing or %{nil} will disable.
453 %_build_file_context_path %{nil}
456 # Path to selinux file context patterns used to set
457 # (or override package content) file contexts when installing.
459 # Undefined, missing or %{nil} will use package content (if available).
460 %_install_file_context_path %{__file_context_path}
463 # Path to selinux file context patterns used to verify
464 # file contexts on file system.
466 # Undefined, missing or %{nil} will use package content (if available).
467 %_verify_file_context_path %{__file_context_path}
470 # Path to scripts to autogenerate package dependencies,
472 # Note: Used iff _use_internal_dependency_generator is zero.
473 #%__find_provides %{_rpmconfigdir}/rpmdeps --provides
474 #%__find_requires %{_rpmconfigdir}/rpmdeps --requires
475 %__find_provides %{_rpmconfigdir}/find-provides
476 %__find_requires %{_rpmconfigdir}/find-requires
477 #%__find_conflicts ???
478 #%__find_obsoletes ???
481 # Path to file attribute classifications for automatic dependency
482 # extraction, used when _use_internal_dependency_generator
483 # is used (on by default). Files can have any number of attributes
484 # attached to them, and dependencies are separately extracted for
487 # To define a new file attribute called "myattr", add a file named
488 # "myattr" to this directory, defining the requires and/or provides
489 # finder script(s) + magic and/or path pattern regex(es).
490 # provides finder and
491 # %__myattr_requires path + args to requires finder script for <myattr>
492 # %__myattr_provides path + args to provides finder script for <myattr>
493 # %__myattr_magic libmagic classification match regex
494 # %__myattr_pattern path based classification match regex
495 # %__myattr_exeonly require file to be executable to classify
497 %_fileattrsdir %{_rpmconfigdir}/fileattrs
499 #==============================================================================
500 # ---- Database configuration macros.
501 # Macros used to configure Berkley db parameters.
503 # rpmdb macro configuration values are a colon (or white space) separated
504 # list of tokens, with an optional '!' negation to explicitly disable bit
505 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
506 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
507 # (e.g. %_dbi_config). The configuration is also conditioned on the
508 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
509 # the configuration while rebuilding an rpmdb database.
511 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
512 # see that for the latest gory details. Note carefully that, unless you
513 # are writing an rpm installer, you shouldn't have to touch *any* of these
516 # Here's a short list of the tokens, with a guess of whether the option is
518 # (nothing) currently used in rpm, known to work.
519 # "+++" under development, will be supported in rpm eventually.
520 # "???" I have no clue, you're mostly on your own.
522 # If you do find yourself inclined to fiddle, here's what I see (shrug):
523 # 1) Only the value of mp_size has any serious impact on overall performance,
524 # and you will need ~256Kb to handle a typical machine install.
525 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
526 # will ever need tuning. Diddle the pagesize if you're interested, although
527 # I believe that you will find pagesize=512 "best".
528 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
529 # and/or mp_size instead.
530 # 4) btree is faster than hash, but would require some painful rpm release
531 # engineering to convert everbody's databases to btree, not gonna happen
534 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
537 # token works? Berkeley db flag or value
538 #==================================================
539 #---------------------- DBENV->open parameters and tunable values:
540 # mmapsize=16Mb DBENV->set_mp_mmapsize
541 # cachesize=1Mb DBENV->set_cachesize, DB->set_cachesize
542 #---------------------- DBENV->open bits:
543 # cdb +++ DB_INIT_CDB
544 # txn ??? DB_INIT_TXN
545 # log ??? DB_INIT_LOG
546 # lock ??? DB_INIT_LOCK
547 # recover ??? DB_RECOVER
548 # recover_fatal ??? DB_RECOVER_FATAL
549 # private +++ DB_PRIVATE
550 # lockdown ??? DB_LOCKDOWN
551 #---------------------- DB->open parameters and tunable values:
552 # pagesize=512 +++ DB->set_pagesize
553 #---------------------- DB->open bits:
554 # nommap ??? DB_NOMMAP
555 #---------------------- DB->open types:
558 # unknown +++ DB_UNKNOWN
559 #---------------------- DB->set_flags bits:
560 # bt_dup +++ (btree only) DB_DUP
561 # bt_dupsort +++ (btree only) DB_DUPSORT
562 # ht_dup +++ (hash only) DB_DUP
563 # ht_dupsort +++ (hash only) DB_DUPSORT
564 #----------------------- rpmdb specific configuration:
565 # verify (db3 only) Verify Packages db after RW close?
566 # lockdbfd (always on for Packages) Use fcntl(2) locking ?
567 # nofsync Disable fsync(2) call performed after db3 writes?
570 # XXX Use transactions and logs for rpmdb durability (no clue yet):
571 #%__dbi_other txn log \
572 # mp_mmapsize=8Mb mp_size=512Kb
574 # Use a CDB database model for concurrent access.
575 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
576 %__dbi_cdb cdb mp_mmapsize=16Mb mp_size=1Mb
578 %__dbi_other %{?__dbi_cdb}
580 # Note: adding nofsync here speeds up --rebuilddb a lot.
581 %__dbi_rebuild nofsync !log !txn !cdb
584 #--- Hash database configuration
590 %__dbi_htconfig_current %{__dbi_htconfig}
591 %__dbi_htconfig_rebuild %{__dbi_htconfig} %{__dbi_rebuild}
594 %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
595 %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
599 #--- Btree database configuration
605 %__dbi_btconfig_current %{__dbi_btconfig}
606 %__dbi_btconfig_rebuild %{__dbi_btconfig} %{__dbi_rebuild}
609 %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
610 %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
613 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
614 %_dbi_config_Packages %{_dbi_htconfig} lockdbfd
616 %_dbi_config_Dirnames %{_dbi_btconfig}
617 %_dbi_config_Requireversion %{_dbi_btconfig}
618 %_dbi_config_Provideversion %{_dbi_btconfig}
619 %_dbi_config_Installtid %{_dbi_btconfig}
620 %_dbi_config_Removetid %{_dbi_btconfig}
622 %_dbi_config %{_dbi_htconfig}
624 # XXX legacy configuration.
625 # Choose db interface:
626 # 3 native db3 interface.
628 # There are two macros so that --rebuilddb can convert db1 -> db3.
633 #==============================================================================
634 # ---- GPG/PGP/PGP5 signature macros.
635 # Macro(s) to hold the arguments passed to GPG/PGP for package
636 # signing and verification.
638 %__gpg_check_password_cmd %{__gpg} \
639 gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
641 %__gpg_sign_cmd %{__gpg} \
642 gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
643 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
645 # XXX rpm >= 4.1 verifies signatures internally
646 #%__gpg_verify_cmd %{__gpg} \
647 # gpg --batch --no-verbose --verify --no-secmem-warning \
648 # %{__signature_filename} %{__plaintext_filename}
650 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
651 # Normally this macro is defined in /etc/rpm/macros.prelink, installed
652 # with the prelink package. If the macro is undefined, then prelinked
653 # shared libraries contents are MD5 digest verified (as usual), rather
654 # than MD5 verifying the output of the prelink undo helper.
656 # Note: The 2nd token is used as argv[0] and "library" is a
657 # placeholder that will be deleted and replaced with the appropriate
659 #%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
661 # Horowitz Key Protocol server configuration
663 %_hkp_keyserver http://pgp.mit.edu
664 %_hkp_keyserver_query %{_hkp_keyserver}:11371/pks/lookup?op=get&search=0x
666 #==============================================================================
667 # ---- Transaction macros.
668 # Macro(s) used to parameterize transactions.
670 # The output binary package file name template used when building
673 # XXX Note: escaped %% for use in headerSprintf()
674 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
676 # The default transaction color. This value is a set of bits to
677 # determine file and dependency affinity for this arch.
678 # 0 uncolored (i.e. use only arch as install hint)
681 %_transaction_color @RPMCANONCOLOR@
683 # Verify digest/signature flags for various rpm modes:
684 # 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
685 # 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
686 # 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
687 # 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
689 # For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
690 # digest/signature checking, disables signature checking, but attempts
691 # digest checking, also when retrieving headers from the database.
694 # >>> hex(rpm._RPMVSF_NOSIGNATURES)
697 # >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
699 # at the python prompt for example, after "import rpm".
701 # The checking overhead is ~11ms per header for digests/signatures;
702 # each header from the database is checked only when first encountered
703 # for each database open.
705 # Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
709 %_vsflags_build %{__vsflags}
710 %_vsflags_erase %{__vsflags}
711 %_vsflags_install %{__vsflags}
712 %_vsflags_query %{__vsflags}
713 %_vsflags_rebuilddb %{__vsflags}
714 %_vsflags_verify %{__vsflags}
716 # Relations between package names that cause dependency loops
717 # with legacy packages that cannot be fixed. Relations are
720 # where package p has a Requires: on something that package q Provides:
722 # XXX Note: that there cannot be any whitespace within the string "p>q",
723 # and that both p and q are package names (i.e. no version/release).
726 %_dependency_whiteout \
730 # Default output format string for rpm -qa
732 # XXX Note: escaped %% for use in headerFormat()
733 %_query_all_fmt %%{nvra}
736 # Default path to the file used for transaction fcntl lock.
737 %_rpmlock_path %{_dbpath}/.rpm.lock
739 #==============================================================================
740 # ---- per-platform macros.
741 # Macros that are specific to an individual platform. The values here
742 # will be used if the per-platform macro file does not exist..
744 %_arch @RPMCANONARCH@
745 %_build_arch @RPMCANONARCH@
746 %_vendor @RPMCANONVENDOR@
749 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
752 # Define a generic value for optflags. Normally overridden by per-target macros.
756 # ISA dependency marker, none for noarch and name-bitness for others
757 %_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
760 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
761 %__arch_install_post %{nil}
762 %__os_install_post %{___build_post}
764 #==============================================================================
765 # ---- Scriptlet template templates.
766 # Global defaults used for building scriptlet templates.
769 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
771 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
773 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
774 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
775 RPM_OPT_FLAGS=\"%{optflags}\"\
776 RPM_ARCH=\"%{_arch}\"\
778 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
779 RPM_DOC_DIR=\"%{_docdir}\"\
781 RPM_PACKAGE_NAME=\"%{name}\"\
782 RPM_PACKAGE_VERSION=\"%{version}\"\
783 RPM_PACKAGE_RELEASE=\"%{release}\"\
784 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
787 unset CDPATH DISPLAY ||:\
788 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
789 export RPM_BUILD_ROOT}\
790 %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
793 %{verbose:set -x}%{!verbose:exec > /dev/null}\
795 cd \"%{u2p:%{_builddir}}\"\
798 #%___build_body %{nil}
799 %___build_post exit 0
801 %___build_template #!%{___build_shell}\
809 #==============================================================================
810 # ---- Scriptlet templates.
811 # Macro(s) that expand to a command and script that is executed.
812 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
814 %__spec_prep_shell %{___build_shell}
815 %__spec_prep_args %{___build_args}
816 %__spec_prep_cmd %{___build_cmd}
817 %__spec_prep_pre %{___build_pre}
818 %__spec_prep_body %{___build_body}
819 %__spec_prep_post %{___build_post}
820 %__spec_prep_template #!%{__spec_prep_shell}\
824 #%{__spec_prep_body}\
825 #%{__spec_prep_post}\
828 %__spec_build_shell %{___build_shell}
829 %__spec_build_args %{___build_args}
830 %__spec_build_cmd %{___build_cmd}
831 %__spec_build_pre %{___build_pre}
832 %__spec_build_body %{___build_body}
833 %__spec_build_post %{___build_post}
834 %__spec_build_template #!%{__spec_build_shell}\
838 #%{__spec_build_body}\
839 #%{__spec_build_post}\
842 %__spec_install_shell %{___build_shell}
843 %__spec_install_args %{___build_args}
844 %__spec_install_cmd %{___build_cmd}
845 %__spec_install_pre %{___build_pre}
846 %__spec_install_body %{___build_body}
847 %__spec_install_post\
848 %{?__debug_package:%{__debug_install_post}}\
849 %{__arch_install_post}\
850 %{__os_install_post}\
852 %__spec_install_template #!%{__spec_install_shell}\
853 %{__spec_install_pre}\
856 #%{__spec_install_body}\
857 #%{__spec_install_post}\
860 %__spec_check_shell %{___build_shell}
861 %__spec_check_args %{___build_args}
862 %__spec_check_cmd %{___build_cmd}
863 %__spec_check_pre %{___build_pre}
864 %__spec_check_body %{___build_body}
865 %__spec_check_post %{___build_post}
866 %__spec_check_template #!%{__spec_check_shell}\
870 #%{__spec_check_body}\
871 #%{__spec_check_post}\
874 #%__spec_autodep_shell %{___build_shell}
875 #%__spec_autodep_args %{___build_args}
876 #%__spec_autodep_cmd %{___build_cmd}
877 #%__spec_autodep_pre %{___build_pre}
878 #%__spec_autodep_body %{___build_body}
879 #%__spec_autodep_post %{___build_post}
880 #%__spec_autodep_template #!%{__spec_autodep_shell}\
881 #%{__spec_autodep_pre}\
884 #%{__spec_autodep_body}\
885 #%{__spec_autodep_post}\
888 %__spec_clean_shell %{___build_shell}
889 %__spec_clean_args %{___build_args}
890 %__spec_clean_cmd %{___build_cmd}
891 %__spec_clean_pre %{___build_pre}
892 %__spec_clean_body %{___build_body}
893 %__spec_clean_post %{___build_post}
894 %__spec_clean_template #!%{__spec_clean_shell}\
898 #%{__spec_clean_body}\
899 #%{__spec_clean_post}\
902 %__spec_rmbuild_shell %{___build_shell}
903 %__spec_rmbuild_args %{___build_args}
904 %__spec_rmbuild_cmd %{___build_cmd}
905 %__spec_rmbuild_pre %{___build_pre}
906 %__spec_rmbuild_body %{___build_body}
907 %__spec_rmbuild_post %{___build_post}
908 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
909 %{__spec_rmbuild_pre}\
912 #%{__spec_rmbuild_body}\
913 #%{__spec_rmbuild_post}\
916 # XXX We don't expand pre/post install scriptlets (yet).
917 #%__spec_pre_pre %{nil}
918 #%__spec_pre_post %{nil}
919 #%__spec_post_pre %{nil}
920 #%__spec_post_post %{nil}
921 #%__spec_preun_pre %{nil}
922 #%__spec_preun_post %{nil}
923 #%__spec_postun_pre %{nil}
924 #%__spec_postun_post %{nil}
925 #%__spec_triggerpostun_pre %{nil}
926 #%__spec_triggerpostun_post %{nil}
927 #%__spec_triggerun_pre %{nil}
928 #%__spec_triggerun_post %{nil}
929 #%__spec_triggerin_pre %{nil}
930 #%__spec_triggerin_post %{nil}
932 #==============================================================================
933 # ---- configure macros.
934 # Macro(s) slavishly copied from autoconf's config.status.
937 %_exec_prefix %{_prefix}
938 %_bindir %{_exec_prefix}/bin
939 %_sbindir %{_exec_prefix}/sbin
940 %_libexecdir %{_exec_prefix}/libexec
941 %_datadir %{_prefix}/share
943 %_sharedstatedir %{_prefix}/com
944 %_localstatedir %{_prefix}/var
946 %_libdir %{_exec_prefix}/%{_lib}
947 %_includedir %{_prefix}/include
948 %_infodir %{_datadir}/info
949 %_mandir %{_datadir}/man
951 #==============================================================================
952 # ---- config.guess platform macros.
953 # Macro(s) similar to the tokens used by configure.
956 %_build_alias %{_host_alias}
957 %_build_cpu %{_host_cpu}
958 %_build_vendor %{_host_vendor}
959 %_build_os %{_host_os}
961 %_host_alias @host_alias@%{nil}
962 %_host_cpu @host_cpu@
963 %_host_vendor @host_vendor@
966 %_target_alias %{_host_alias}
967 %_target_cpu %{_host_cpu}
968 %_target_vendor %{_host_vendor}
969 %_target_os %{_host_os}
971 #==============================================================================
972 # ---- specfile macros.
973 # Macro(s) here can be used reliably for reproducible builds.
974 # (Note: Above is the goal, below are the macros under development)
976 # The configure macro runs autoconf configure script with platform specific
977 # directory structure (--prefix, --libdir etc) and compiler flags
980 # The configure macro should be invoked as %configure (rather than %{configure})
981 # because the rest of the arguments will be expanded using %*.
983 %_configure ./configure
985 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
986 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
987 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
988 %{_configure} --host=%{_host} --build=%{_build} \\\
989 --program-prefix=%{?_program_prefix} \\\
990 --prefix=%{_prefix} \\\
991 --exec-prefix=%{_exec_prefix} \\\
992 --bindir=%{_bindir} \\\
993 --sbindir=%{_sbindir} \\\
994 --sysconfdir=%{_sysconfdir} \\\
995 --datadir=%{_datadir} \\\
996 --includedir=%{_includedir} \\\
997 --libdir=%{_libdir} \\\
998 --libexecdir=%{_libexecdir} \\\
999 --localstatedir=%{_localstatedir} \\\
1000 --sharedstatedir=%{_sharedstatedir} \\\
1001 --mandir=%{_mandir} \\\
1002 --infodir=%{_infodir}
1004 #------------------------------------------------------------------------------
1005 # The make install analogue of %configure for modern autotools:
1006 %make_install %{__make} install DESTDIR=%{?buildroot}
1008 #------------------------------------------------------------------------------
1009 # Former make install analogue, kept for compatibility and for old/broken
1010 # packages that don't support DESTDIR properly.
1013 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1014 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1015 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1016 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1017 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1018 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1019 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1020 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1021 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1022 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1023 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1024 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1025 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1028 #------------------------------------------------------------------------------
1029 # The GNUconfigure macro does the following:
1030 # update config.guess and config.sub.
1031 # regenerate all autoconf/automake files
1032 # optionally change to a directory (make the directory if requested).
1033 # run configure with correct prefix, platform, and CFLAGS.
1034 # optionally restore current directory.
1036 # Based on autogen.sh from GNOME and orginal GNUconfigure
1038 %GNUconfigure(MCs:) \
1039 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1040 LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1041 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1042 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1043 for coin in `echo ${dirs}` \
1045 dr=`dirname ${coin}`; \
1046 if test -f ${dr}/NO-AUTO-GEN; then \
1049 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1051 aclocalinclude="${ACLOCAL_FLAGS}"; \
1052 for k in ${macrodirs}; do \
1053 if test -d ${k}; then \
1054 aclocalinclude="${aclocalinclude} -I ${k}"; \
1056 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1059 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1060 if grep "sed.*POTFILES" configure.in >/dev/null; then \
1061 : do nothing -- we still have an old unmodified configure.in \
1063 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1064 echo "no" | gettextize --force --copy; \
1065 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1068 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1069 %{__libtoolize} --force --copy; \
1071 aclocal ${aclocalinclude}; \
1072 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1075 echo "Running automake --gnu ${am_opt} ..."; \
1076 %{__automake} --add-missing --gnu ${am_opt}; \
1081 %{-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} %* ; \
1082 %{-C:cd ${_mydir}; unset _mydir}
1084 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1085 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1087 #------------------------------------------------------------------------------
1088 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1090 # For example, these can be used as (from ImageMagick.spec from PLD site)
1095 # Summary: libraries and modules for access to ImageMagick from perl
1096 # Group: Development/Languages/Perl
1097 # Requires: %{name} = %{version}
1101 # rm -fr $RPM_BUILD_ROOT
1102 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1105 # %defattr(644,root,root,755)
1106 # %{perl_sitearch}/Image
1107 # %dir %{perl_sitearch}/auto/Image
1109 %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")
1110 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1111 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1112 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1113 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1114 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1115 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1117 #------------------------------------------------------------------------------
1118 # Useful python macros for determining python version and paths
1120 %python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())")
1121 %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
1122 %python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")
1124 #------------------------------------------------------------------------------
1125 # arch macro for all Intel i?86 compatibile processors
1126 # (Note: This macro (and it's analogues) will probably be obsoleted when
1127 # rpm can use regular expressions against target platforms in macro
1130 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
1132 #------------------------------------------------------------------------------
1133 # arch macro for all supported ARM processors
1134 %arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
1136 #------------------------------------------------------------------------------
1137 # arch macro for all supported Sparc processors
1138 %sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1140 #------------------------------------------------------------------------------
1141 # arch macro for all supported Alpha processors
1142 %alpha alpha alphaev56 alphaev6 alphaev67
1144 #------------------------------------------------------------------------
1145 # Use in %install to generate locale specific file lists. For example,
1149 # %find_lang %{name}
1151 # %files -f %{name}.lang
1153 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
1155 # Commands + opts to use for retrieving remote files
1156 # Proxy opts can be set through --httpproxy/--httpport popt aliases,
1157 # for any special local needs use %__urlhelper_localopts in system-wide
1158 # or per-user macro configuration.
1159 %__urlhelpercmd @__CURL@
1160 %__urlhelperopts --silent --show-error --fail --location -o
1161 %__urlhelper_proxyopts %{?_httpproxy:--proxy %{_httpproxy}%{?_httpport::%{_httpport}}}%{!?_httpproxy:%{nil}}
1162 %_urlhelper %{__urlhelpercmd} %{?__urlhelper_localopts} %{?__urlhelper_proxyopts} %{__urlhelperopts}
1164 #------------------------------------------------------------------------------
1165 # Collection specific macros
1166 %__plugindir %{_rpmconfigdir}/plugins
1167 %__collection_font %{__plugindir}/exec.so /usr/bin/fc-cache
1168 %__collection_java %{__plugindir}/exec.so /usr/bin/rebuild-gcj-db
1169 %__collection_sepolicy %{__plugindir}/sepolicy.so