1 # $Id: macros.in,v 1.18 1999/03/27 21:40:56 jbj Exp $
2 #==============================================================================
3 # Macro naming conventions (preliminary):
5 # Macros that begin with an underscore are "local" in the sense that
6 # they (if used) will not be exported in rpm headers. Some macros
7 # that don't start with an underscore (but look like they should)
8 # are compatible with macros generated by rpm-2.5.x and will be made
9 # more consistent in a future release.
12 #==============================================================================
13 # ---- filesystem macros.
19 #==============================================================================
22 %__bzip2 %(which bzip2)
24 %__chgrp %(which chgrp)
25 %__chmod %(which chmod)
26 %__chown %(which chown)
28 %__install %(which install)
29 %__libtoolize %(which libtoolize)
31 %__mkdir %(which mkdir)
32 %__patch %(which patch)
33 %__ranlib %(which ranlib)
35 %__strip %(which strip)
38 #==============================================================================
39 # ---- Required rpmrc macros.
40 # Macros that used to be initialized as a side effect of rpmrc parsing.
41 # These are the default values that can be overridden by other
42 # (e.g. per-platform, per-system, per-packager) macro files.
44 %_builddir %{_topdir}/BUILD
47 %_dbpath %{_var}/lib/rpm
48 %_defaultdocdir %{_usr}/doc
50 # XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
51 #%_fixowner chown -R root
52 #%_fixgroup chgrp -R @ROOT_GROUP@
53 %_fixperms chmod -R @FIXPERMS@
58 %_rpmdir %{_topdir}/RPMS
60 # XXX Note escaped %% for use in headerSprintf
61 %_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
63 %_sourcedir %{_topdir}/SOURCES
64 %_specdir %{_topdir}/SPECS
65 %_srcrpmdir %{_topdir}/SRPMS
67 %_topdir %{_usrsrc}/redhat
69 #==============================================================================
70 # ---- Optional rpmrc macros.
71 # Macros that used to be initialized as a side effect of rpmrc and/or
72 # spec file parsing but were not set in the distributed configuration
73 # /usr/lib/rpm/rpmrc file.
93 #==============================================================================
94 # ---- per-platform macros.
95 # Macros that are specific to an individual platform. The values here
96 # will be used if the per-platform macro file does not exist..
99 %_vendor @RPMCANONVENDOR@
101 %_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
103 # XXX use the rpmrc instantiated macro for now
106 #==============================================================================
107 # ---- script environment macros.
108 # Macro(s) that establish the environment for running a script.
110 %_preScriptEnvironment \
111 RPM_SOURCE_DIR=\"%{_sourcedir}\"\
112 RPM_BUILD_DIR=\"%{_builddir}\"\
113 RPM_OPT_FLAGS=\"%{optflags}\"\
114 RPM_ARCH=\"%{_target_cpu}\"\
115 RPM_OS=\"%{_target_os}\"\
116 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
117 RPM_DOC_DIR=\"%{_docdir}\"\
119 RPM_PACKAGE_NAME=\"%{name}\"\
120 RPM_PACKAGE_VERSION=\"%{version}\"\
121 RPM_PACKAGE_RELEASE=\"%{release}\"\
122 export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
123 %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
124 export RPM_BUILD_ROOT\
127 #==============================================================================
128 # ---- configure macros.
129 # Macro(s) similar to those used by configure.
133 %_build_alias %{_host_alias}
134 %_build_cpu %{_host_cpu}
135 %_build_vendor %{_host_vendor}
136 %_build_os %{_host_os}
138 %_host_alias @host_alias@
139 %_host_cpu @host_cpu@
140 %_host_vendor @host_vendor@
143 %_target_alias %{_host_alias}
144 %_target_cpu %{_host_cpu}
145 %_target_vendor %{_host_vendor}
146 %_target_os %{_host_os}
148 #==============================================================================
149 # ---- specfile macros.
150 # Macro(s) here can be used reliably for reproducible builds.
151 # (Note: Above is the goal, below are the macros under development)
153 # The configure macro does the following:
154 # optionally change to a subdirectory (not implemented).
155 # attempt to update config.guess and config.sub.
156 # run configure with correct prefix, platform, and CFLAGS.
157 # optionally restore current directory (not implemented).
158 # The configure macro should be invoked as %configure (rather than %{configure})
159 # because the rest of the arguments will be expanded using %*. Another
160 # gotcha is that arguments, if present, should be on the same line as the
164 %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
165 CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}