1 #/*! \page config_macros Default configuration: /usr/lib/rpm/macros
4 # $Id: macros.in,v 1.74 2001/04/10 12:36:45 jbj Exp $
6 # This is a global RPM configuration file. All changes made here will
7 # be lost when the rpm package is upgraded. Any per-system configuration
8 # should be added to /etc/rpm/macros, while per-user configuration should
9 # be added to ~/.rpmmacros.
11 #==============================================================================
12 # Macro naming conventions (preliminary):
14 # Macros that begin with an underscore are "local" in the sense that
15 # they (if used) will not be exported in rpm headers. Some macros
16 # that don't start with an underscore (but look like they should)
17 # are compatible with macros generated by rpm-2.5.x and will be made
18 # more consistent in a future release.
21 #==============================================================================
22 # ---- A macro that expands to nothing.
26 #==============================================================================
27 # ---- filesystem macros.
33 #==============================================================================
34 # ---- Generally useful path macros.
47 %__install @__INSTALL@
64 #==============================================================================
65 # ---- Build system path macros.
72 %__objcopy @__OBJCOPY@
73 %__objdump @__OBJDUMP@
78 # XXX avoid failures if tools are not installed when rpm is built.
79 %__libtoolize libtoolize
81 %__autoheader autoheader
85 #==============================================================================
86 # ---- Required rpmrc macros.
87 # Macros that used to be initialized as a side effect of rpmrc parsing.
88 # These are the default values that can be overridden by other
89 # (e.g. per-platform, per-system, per-packager, per-package) macros.
92 # The directory where sources/patches will be unpacked and built.
93 %_builddir %{_topdir}/BUILD
95 # The interpreter used for build scriptlets.
98 # The path to the bzip2 executable (legacy).
101 # The location of the rpm database file(s).
102 %_dbpath %{_var}/lib/rpm
104 # The location of the rpm database file(s) after "rpm --rebuilddb".
105 %_dbpath_rebuild %{_dbpath}
107 %_defaultdocdir %{_usr}/doc
110 %__find_provides @FINDPROVIDES@
111 %__find_requires @FINDREQUIRES@
113 #%__find_conflicts ???
114 #%__find_obsoletes ???
116 # XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
118 %__chown_Rhf @__CHOWN_RHF@
119 %__chgrp_Rhf @__CHGRP_RHF@
120 %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
121 %_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
122 %_fixperms %{__chmod} -Rf @FIXPERMS@
125 # The path to the gzip executable (legacy).
128 # The number of changelog entries kept when installing (legacy, unused in
129 # rpm-4.0.1 and later).
132 # The path to the pgp executable (legacy).
135 # The directory where newly built binary packages will be written.
136 %_rpmdir %{_topdir}/RPMS
138 # A template used to generate the output binary package file name
140 %_rpmfilename %{_build_name_fmt}
142 # The default signature type.
145 # The directory where sources/patches from a source package will be
146 # installed. This is also where sources/patches are found when building.
147 %_sourcedir %{_topdir}/SOURCES
149 # The directory where the spec file from a source package will be
151 %_specdir %{_topdir}/SPECS
153 # The directory where newly built source packages will be written.
154 %_srcrpmdir %{_topdir}/SRPMS
156 # Directory where temporaray files can be created.
157 %_tmppath %{_var}/tmp
159 # Path to top of build area.
160 %_topdir %{_usrsrc}/redhat
162 # The path to the unzip executable (legacy).
163 %_unzipbin %{__unzip}
165 #==============================================================================
166 # ---- Optional rpmrc macros.
167 # Macros that are initialized as a side effect of rpmrc and/or spec
170 # Configurable build root path, same as BuildRoot: in a specfile.
171 # (Note: the configured macro value will override the spec file value).
175 # The sub-directory (relative to %{_builddir}) where sources are compiled.
176 # This macro is set after processing %setup, either explicitly from the
177 # value given to -n or the default name-version.
181 # Configurable distribution information, same as Distribution: tag in a
186 # Configurable distribution URL, same as DistURL: tag in a specfile.
187 # The URL will be used to supply reliable information to tools like
190 # Note: You should not configure with disturl (or build packages with
191 # the DistURL: tag) unless you are willing to supply content in a
192 # yet-to-be-determined format at the URL specified.
196 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
197 # marked as %doc should be installed.
200 # The port and machine name of a FTP proxy host running TIS firewall.
205 # The signature to use and the location of configuration files for
206 # signing packages with GNU gpg.
211 # The port and machine name of an HTTP proxy host.
216 # The PATH put into the environment before running %pre/%post et al.
218 %_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
220 # A colon separated list of desired locales to be installed;
221 # "all" means install all locale specific files.
230 # A colon separated list of paths where files should *not* be installed.
231 # Usually, these are network file system mount points.
235 # Configurable packager information, same as Packager: in a specfile.
239 # Compression type and level for source/binary package payloads.
240 # "w9.gzdio" gzip level 9 (default).
241 # "w9.bzdio" bzip2 level 9.
243 #%_source_payload w9.gzdio
244 #%_binary_payload w9.gzdio
246 # The signature to use and the location of configuration files for
247 # signing packages with PGP.
252 # Configurable virtual provides (unimplemented, use Provides: ...
261 # Configurable vendor information, same as Vendor: in a specfile.
265 #==============================================================================
266 # ---- Database configuration macros.
267 # Macros used to configure Berkley db parameters.
269 # Choose db interface:
271 # 1 native db1 interface (e.g. linux glibc libdb1 routines).
272 # 2 native db2 interface (not currently implemented, may never be).
273 # 3 native db3 interface.
274 # -1 db3 -> db2 -> db1 (as available).
276 # There are two macros so that --rebuilddb can convert db1 -> db3.
282 # token Berkeley db flag or value
283 # =================================================
286 # See http://www.sleepycat.com for Berkeley db-3.0.55 documentation.
288 # Additional rpm specific configuration:
289 # usecursors Should DB3 cursors be used in get/put/del ?
290 # lockdbfd Should the file be locked using fcntl shared/exclusive locks?
293 %__dbi_other usecursors
294 %__dbi_perms perms=0644
296 # This is a colon (or white space) separated list of tokens for Berkeley
304 # The list of tags for which indices will be built.
305 %_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Removetid:Depends
307 # "Packages" needs fcntl shared/exclusive lock.
308 %_dbi_config_Packages %{_dbi_config}:lockdbfd
310 # "Depends" is a per-transaction cache of known dependency resolutions.
311 %_dbi_config_Depends %{_dbi_config}:temporary
313 %_dbi_config_Dirnames btree bt_dup bt_dupsort usecursors perms=0644
314 %_dbi_config_Requireversion btree bt_dup bt_dupsort usecursors perms=0644
315 %_dbi_config_Provideversion btree bt_dup bt_dupsort usecursors perms=0644
316 %_dbi_config_Installtid btree bt_dup bt_dupsort usecursors perms=0644
317 %_dbi_config_Removetid btree bt_dup bt_dupsort usecursors perms=0644
319 #==============================================================================
320 # ---- transaction macros.
321 # Macro(s) used to parameterize
323 # The output binary package file name template used when building
325 # XXX Note escaped %% for use in headerSprintf
326 %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
328 # The output binary package file name template used when repackaging
330 # XXX Note escaped %% for use in headerSprintf
331 %_repackage_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
333 # The directory in which erased packages will be saved when using
334 # the --repackage option.
335 %_repackage_dir /var/tmp
336 %_repackage_root %{nil}
338 #==============================================================================
339 # ---- per-platform macros.
340 # Macros that are specific to an individual platform. The values here
341 # will be used if the per-platform macro file does not exist..
343 %_arch @RPMCANONARCH@
344 %_vendor @RPMCANONVENDOR@
346 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
349 # Define a generic value for optflags. Normally overridden by per-target macros.
353 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
354 %__arch_install_post %{nil}
355 %__os_install_post %{___build_post}
357 #==============================================================================
358 # ---- Scriptlet template templates.
359 # Global defaults used for building scriptlet templates.
361 # XXX legacy configuration, use ___build_pre et al instead.
362 #%_preScriptEnvironment \
363 #RPM_SOURCE_DIR=\"%{_sourcedir}\"\
364 #RPM_BUILD_DIR=\"%{_builddir}\"\
365 #RPM_OPT_FLAGS=\"%{optflags}\"\
366 #RPM_ARCH=\"%{_arch}\"\
368 #export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
369 #RPM_DOC_DIR=\"%{_docdir}\"\
371 #RPM_PACKAGE_NAME=\"%{name}\"\
372 #RPM_PACKAGE_VERSION=\"%{version}\"\
373 #RPM_PACKAGE_RELEASE=\"%{release}\"\
374 #export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
375 #%{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
376 #export RPM_BUILD_ROOT}
378 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
380 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
382 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
383 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
384 RPM_OPT_FLAGS=\"%{optflags}\"\
385 RPM_ARCH=\"%{_arch}\"\
387 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
388 RPM_DOC_DIR=\"%{_docdir}\"\
390 RPM_PACKAGE_NAME=\"%{name}\"\
391 RPM_PACKAGE_VERSION=\"%{version}\"\
392 RPM_PACKAGE_RELEASE=\"%{release}\"\
393 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
394 %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
395 export RPM_BUILD_ROOT}\
397 %{verbose:set -x}%{!verbose:exec > /dev/null}\
399 cd %{u2p:%{_builddir}}\
402 #%___build_body %{nil}
403 %___build_post exit 0
405 %___build_template #!%{___build_shell}\
413 #==============================================================================
414 # ---- Scriptlet templates.
415 # Macro(s) that expand to a command and script that is executed.
416 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
418 %__spec_prep_shell %{___build_shell}
419 %__spec_prep_args %{___build_args}
420 %__spec_prep_cmd %{___build_cmd}
421 %__spec_prep_pre %{___build_pre}
422 %__spec_prep_body %{___build_body}
423 %__spec_prep_post %{___build_post}
424 %__spec_prep_template #!%{__spec_prep_shell}\
428 #%{__spec_prep_body}\
429 #%{__spec_prep_post}\
432 %__spec_build_shell %{___build_shell}
433 %__spec_build_args %{___build_args}
434 %__spec_build_cmd %{___build_cmd}
435 %__spec_build_pre %{___build_pre}
436 %__spec_build_body %{___build_body}
437 %__spec_build_post %{___build_post}
438 %__spec_build_template #!%{__spec_build_shell}\
442 #%{__spec_build_body}\
443 #%{__spec_build_post}\
446 %__spec_install_shell %{___build_shell}
447 %__spec_install_args %{___build_args}
448 %__spec_install_cmd %{___build_cmd}
449 %__spec_install_pre %{___build_pre}
450 %__spec_install_body %{___build_body}
451 %__spec_install_post\
452 %{__arch_install_post}\
453 %{__os_install_post}\
455 %__spec_install_template #!%{__spec_install_shell}\
456 %{__spec_install_pre}\
459 #%{__spec_install_body}\
460 #%{__spec_install_post}\
463 #%__spec_autodep_shell %{___build_shell}
464 #%__spec_autodep_args %{___build_args}
465 #%__spec_autodep_cmd %{___build_cmd}
466 #%__spec_autodep_pre %{___build_pre}
467 #%__spec_autodep_body %{___build_body}
468 #%__spec_autodep_post %{___build_post}
469 #%__spec_autodep_template #!%{__spec_autodep_shell}\
470 #%{__spec_autodep_pre}\
473 #%{__spec_autodep_body}\
474 #%{__spec_autodep_post}\
477 %__spec_clean_shell %{___build_shell}
478 %__spec_clean_args %{___build_args}
479 %__spec_clean_cmd %{___build_cmd}
480 %__spec_clean_pre %{___build_pre}
481 %__spec_clean_body %{___build_body}
482 %__spec_clean_post %{___build_post}
483 %__spec_clean_template #!%{__spec_clean_shell}\
487 #%{__spec_clean_body}\
488 #%{__spec_clean_post}\
491 %__spec_rmbuild_shell %{___build_shell}
492 %__spec_rmbuild_args %{___build_args}
493 %__spec_rmbuild_cmd %{___build_cmd}
494 %__spec_rmbuild_pre %{___build_pre}
495 %__spec_rmbuild_body %{___build_body}
496 %__spec_rmbuild_post %{___build_post}
497 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
498 %{__spec_rmbuild_pre}\
501 #%{__spec_rmbuild_body}\
502 #%{__spec_rmbuild_post}\
505 # XXX We don't expand pre/post install scriptlets (yet).
506 #%__spec_pre_pre %{nil}
507 #%__spec_pre_post %{nil}
508 #%__spec_post_pre %{nil}
509 #%__spec_post_post %{nil}
510 #%__spec_preun_pre %{nil}
511 #%__spec_preun_post %{nil}
512 #%__spec_postun_pre %{nil}
513 #%__spec_postun_post %{nil}
514 #%__spec_triggerpostun_pre %{nil}
515 #%__spec_triggerpostun_post %{nil}
516 #%__spec_triggerun_pre %{nil}
517 #%__spec_triggerun_post %{nil}
518 #%__spec_triggerin_pre %{nil}
519 #%__spec_triggerin_post %{nil}
521 #==============================================================================
522 # ---- configure macros.
523 # Macro(s) slavishly copied from autoconf's config.status.
526 %_exec_prefix %{_prefix}
527 %_bindir %{_exec_prefix}/bin
528 %_sbindir %{_exec_prefix}/sbin
529 %_libexecdir %{_exec_prefix}/libexec
530 %_datadir %{_prefix}/share
531 %_sysconfdir %{_prefix}/etc
532 %_sharedstatedir %{_prefix}/com
533 %_localstatedir %{_prefix}/var
535 %_libdir %{_exec_prefix}/%{_lib}
536 %_includedir %{_prefix}/include
537 %_oldincludedir /usr/include
538 %_infodir %{_prefix}/info
539 %_mandir %{_prefix}/man
541 #==============================================================================
542 # ---- config.guess platform macros.
543 # Macro(s) similar to the tokens used by configure.
546 %_build_alias %{_host_alias}
547 %_build_cpu %{_host_cpu}
548 %_build_vendor %{_host_vendor}
549 %_build_os %{_host_os}
551 %_host_alias @host_alias@
552 %_host_cpu @host_cpu@
553 %_host_vendor @host_vendor@
556 %_target_alias %{_host_alias}
557 %_target_cpu %{_host_cpu}
558 %_target_vendor %{_host_vendor}
559 %_target_os %{_host_os}
561 #==============================================================================
562 # ---- specfile macros.
563 # Macro(s) here can be used reliably for reproducible builds.
564 # (Note: Above is the goal, below are the macros under development)
566 # The configure macro does the following:
567 # optionally change to a subdirectory (not implemented).
568 # attempt to update config.guess and config.sub.
569 # run configure with correct prefix, platform, and CFLAGS.
570 # optionally restore current directory (not implemented).
571 # The configure macro should be invoked as %configure (rather than %{configure})
572 # because the rest of the arguments will be expanded using %*.
574 # This is the version of %configure used through rpm-3.0.4.
576 # %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
577 # CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
579 #------------------------------------------------------------------------------
580 # This is an improved version of %configure (from PLD team).
582 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
583 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
584 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
585 %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} ; \
586 ./configure %{_target_platform} \\\
587 --prefix=%{_prefix} \\\
588 --exec-prefix=%{_exec_prefix} \\\
589 --bindir=%{_bindir} \\\
590 --sbindir=%{_sbindir} \\\
591 --sysconfdir=%{_sysconfdir} \\\
592 --datadir=%{_datadir} \\\
593 --includedir=%{_includedir} \\\
594 --libdir=%{_libdir} \\\
595 --libexecdir=%{_libexecdir} \\\
596 --localstatedir=%{_localstatedir} \\\
597 --sharedstatedir=%{_sharedstatedir} \\\
598 --mandir=%{_mandir} \\\
599 --infodir=%{_infodir}
600 #------------------------------------------------------------------------------
601 # The make install analogue of %configure:
604 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
605 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
606 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
607 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
608 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
609 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
610 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
611 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
612 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
613 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
614 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
615 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
616 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
619 #------------------------------------------------------------------------------
620 # The GNUconfigure macro does the following:
621 # update config.guess and config.sub.
622 # regenerate all autoconf/automake files
623 # optionally change to a directory (make the directory if requested).
624 # run configure with correct prefix, platform, and CFLAGS.
625 # optionally restore current directory.
627 # Based on autogen.sh from GNOME and orginal GNUconfigure
629 %GNUconfigure(MCs:) \
630 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
631 LDFLAGS="${LDFLAGS:-'%{-s:-s}'}" ; export LDFLAGS; \
632 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
633 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
634 for coin in `echo ${dirs}` \
636 dr=`dirname ${coin}`; \
637 if test -f ${dr}/NO-AUTO-GEN; then \
640 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
642 aclocalinclude="${ACLOCAL_FLAGS}"; \
643 for k in ${macrodirs}; do \
644 if test -d ${k}; then \
645 aclocalinclude="${aclocalinclude} -I ${k}"; \
647 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
650 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
651 if grep "sed.*POTFILES" configure.in >/dev/null; then \
652 : do nothing -- we still have an old unmodified configure.in \
654 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
655 echo "no" | gettextize --force --copy; \
656 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
659 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
660 %{__libtoolize} --force --copy; \
662 aclocal ${aclocalinclude}; \
663 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
666 echo "Running automake --gnu ${am_opt} ..."; \
667 %{__automake} --add-missing --gnu ${am_opt}; \
672 %{-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} %* ; \
673 %{-C:cd ${_mydir}; unset _mydir}
675 #------------------------------------------------------------------------------
676 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
678 # For example, these can be used as (from ImageMagick.spec from PLD site)
683 # Summary: libraries and modules for access to ImageMagick from perl
684 # Group: Development/Languages/Perl
685 # Requires: %{name} = %{version}
689 # rm -fr $RPM_BUILD_ROOT
690 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
693 # %defattr(644,root,root,755)
694 # %{perl_sitearch}/Image
695 # %dir %{perl_sitearch}/auto/Image
697 %requires_eq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}' %1| grep -v "is not")
698 %perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch)
699 %perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib)
701 #------------------------------------------------------------------------------
702 # arch macro for all Intel i?86 compatibile processors
703 # (Note: This macro (and it's analogues) will probably be obsoleted when
704 # rpm can use regular expressions against target platforms in macro
707 %ix86 i386 i486 i586 i686 i786 i886 i986
709 #------------------------------------------------------------------------
710 # Use in %install to generate locale specific file lists. For example,
716 # %files -f %{name}.lang
718 %find_lang @RPMCONFIGDIR@/find-lang.sh %{buildroot}