1
# $Id: macros.in,v 1.15 1999/09/29 23:29:58 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.
15
%_usr @testdir@@prefix@
17
%_var @testdir@@varprefix@
19
#==============================================================================
21
# XXX The use of which here is overly simple.
23
%__bzip2 %(which bzip2)
25
%__chgrp %(which chgrp)
26
%__chmod %(which chmod)
27
%__chown %(which chown)
30
%__install %(which install)
32
%__mkdir %(which mkdir)
33
%__patch %(which patch)
34
%__ranlib %(which ranlib)
36
%__strip %(which strip)
39
# XXX avoid weird failures from which if tools are not installed
40
%__libtoolize libtoolize
42
%__autoheader autoheader
46
#==============================================================================
47
# ---- Required rpmrc macros.
48
# Macros that used to be initialized as a side effect of rpmrc parsing.
49
# These are the default values that can be overridden by other
50
# (e.g. per-platform, per-system, per-packager) macro files.
52
%_builddir %{_topdir}/BUILD
55
%_dbpath %{_var}/lib/rpm
56
%_defaultdocdir %{_usr}/doc
58
# XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
59
%_fixowner [ `id -u` = '0' ] && chown -R root
60
%_fixgroup [ `id -u` = '0' ] && chgrp -R @ROOT_GROUP@
61
%_fixperms chmod -R @FIXPERMS@
66
%_rpmdir %{_topdir}/RPMS
68
# XXX Note escaped %% for use in headerSprintf
69
%_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
71
%_sourcedir %{_topdir}/SOURCES
72
%_specdir %{_topdir}/SPECS
73
%_srcrpmdir %{_topdir}/SRPMS
75
%_topdir %{_usrsrc}/redhat
77
#==============================================================================
78
# ---- Optional rpmrc macros.
79
# Macros that used to be initialized as a side effect of rpmrc and/or
80
# spec file parsing but were not set in the distributed configuration
81
# /usr/lib/rpm/rpmrc file.
101
#==============================================================================
102
# ---- per-platform macros.
103
# Macros that are specific to an individual platform. The values here
104
# will be used if the per-platform macro file does not exist..
106
%_arch @RPMCANONARCH@
107
%_vendor @RPMCANONVENDOR@
109
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
111
# XXX use the rpmrc instantiated macro for now
114
#==============================================================================
115
# ---- script environment macros.
116
# Macro(s) that establish the environment for running a script.
118
%_preScriptEnvironment \
119
RPM_SOURCE_DIR=\"%{_sourcedir}\"\
120
RPM_BUILD_DIR=\"%{_builddir}\"\
121
RPM_OPT_FLAGS=\"%{optflags}\"\
122
RPM_ARCH=\"%{_arch}\"\
124
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
125
RPM_DOC_DIR=\"%{_docdir}\"\
127
RPM_PACKAGE_NAME=\"%{name}\"\
128
RPM_PACKAGE_VERSION=\"%{version}\"\
129
RPM_PACKAGE_RELEASE=\"%{release}\"\
130
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
131
%{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
132
export RPM_BUILD_ROOT\
135
#==============================================================================
136
# ---- configure macros.
137
# Macro(s) similar to those used by configure.
141
%_build_alias %{_host_alias}
142
%_build_cpu %{_host_cpu}
143
%_build_vendor %{_host_vendor}
144
%_build_os %{_host_os}
146
%_host_alias @host_alias@
147
%_host_cpu @host_cpu@
148
%_host_vendor @host_vendor@
151
%_target_alias %{_host_alias}
152
%_target_cpu %{_host_cpu}
153
%_target_vendor %{_host_vendor}
154
%_target_os %{_host_os}
156
#==============================================================================
157
# ---- specfile macros.
158
# Macro(s) here can be used reliably for reproducible builds.
159
# (Note: Above is the goal, below are the macros under development)
161
# The configure macro does the following:
162
# optionally change to a subdirectory (not implemented).
163
# attempt to update config.guess and config.sub.
164
# run configure with correct prefix, platform, and CFLAGS.
165
# optionally restore current directory (not implemented).
166
# The configure macro should be invoked as %configure (rather than %{configure})
167
# because the rest of the arguments will be expanded using %*. Another
168
# gotcha is that arguments, if present, should be on the same line as the
172
%{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
173
CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
175
#------------------------------------------------------------------------------
176
# The GNUconfigure macro does the following:
177
# update config.guess and config.sub.
178
# regenerate all autoconf/automake files
179
# run configure with correct prefix, platform, and CFLAGS.
182
%{__libtoolize} --copy --force \
187
CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}