~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to tests/macros.in

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: macros.in,v 1.15 1999/09/29 23:29:58 jbj Exp $
 
2
#==============================================================================
 
3
# Macro naming conventions (preliminary):
 
4
#
 
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.
 
10
#
 
11
 
 
12
#==============================================================================
 
13
# ---- filesystem macros.
 
14
#
 
15
%_usr                   @testdir@@prefix@
 
16
%_usrsrc                %{_usr}/src
 
17
%_var                   @testdir@@varprefix@
 
18
 
 
19
#==============================================================================
 
20
# ---- path macros
 
21
#       XXX The use of which here is overly simple.
 
22
#
 
23
%__bzip2                %(which bzip2)
 
24
%__cat                  %(which cat)
 
25
%__chgrp                %(which chgrp)
 
26
%__chmod                %(which chmod)
 
27
%__chown                %(which chown)
 
28
%__cpio                 %(which cpio)
 
29
%__gzip                 %(which gzip)
 
30
%__install              %(which install)
 
31
%__make                 %(which make)
 
32
%__mkdir                %(which mkdir)
 
33
%__patch                %(which patch)
 
34
%__ranlib               %(which ranlib)
 
35
%__rm                   %(which rm)
 
36
%__strip                %(which strip)
 
37
%__tar                  %(which tar)
 
38
 
 
39
# XXX avoid weird failures from which if tools are not installed
 
40
%__libtoolize           libtoolize
 
41
%__aclocal              aclocal
 
42
%__autoheader           autoheader
 
43
%__automake             automake
 
44
%__autoconf             autoconf
 
45
 
 
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.
 
51
#
 
52
%_builddir              %{_topdir}/BUILD
 
53
%_buildshell            /bin/sh
 
54
%_bzip2bin              @BZIP2BIN@
 
55
%_dbpath                %{_var}/lib/rpm
 
56
%_defaultdocdir         %{_usr}/doc
 
57
#
 
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@
 
62
#
 
63
%_gzipbin               @GZIPBIN@
 
64
%_instchangelog         5
 
65
%_pgpbin                @PGPBIN@
 
66
%_rpmdir                %{_topdir}/RPMS
 
67
#
 
68
# XXX Note escaped %% for use in headerSprintf
 
69
%_rpmfilename           %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
 
70
%_signature             none
 
71
%_sourcedir             %{_topdir}/SOURCES
 
72
%_specdir               %{_topdir}/SPECS
 
73
%_srcrpmdir             %{_topdir}/SRPMS
 
74
%_tmppath               %{_var}/tmp
 
75
%_topdir                %{_usrsrc}/redhat
 
76
#
 
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.
 
82
#
 
83
#%buildroot
 
84
#%distribution
 
85
#%_excludedocs
 
86
#%_ftpport
 
87
#%_ftpproxy
 
88
#%_gpg_name
 
89
#%_gpg_path
 
90
#%_httpport
 
91
#%_httpproxy
 
92
#%_langpatt
 
93
#%_netsharedpath
 
94
#%packager
 
95
#%_pgp_name
 
96
#%_pgp_path
 
97
#%_provides
 
98
#%_timecheck
 
99
#%vendor
 
100
 
 
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..
 
105
#
 
106
%_arch                  @RPMCANONARCH@
 
107
%_vendor                @RPMCANONVENDOR@
 
108
%_os                    @RPMCANONOS@
 
109
%_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}
 
110
#
 
111
# XXX use the rpmrc instantiated macro for now
 
112
#%optflags              -O2
 
113
 
 
114
#==============================================================================
 
115
# ---- script environment macros.
 
116
#       Macro(s) that establish the environment for running a script.
 
117
#
 
118
%_preScriptEnvironment  \
 
119
        RPM_SOURCE_DIR=\"%{_sourcedir}\"\
 
120
        RPM_BUILD_DIR=\"%{_builddir}\"\
 
121
        RPM_OPT_FLAGS=\"%{optflags}\"\
 
122
        RPM_ARCH=\"%{_arch}\"\
 
123
        RPM_OS=\"%{_os}\"\
 
124
        export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
 
125
        RPM_DOC_DIR=\"%{_docdir}\"\
 
126
        export RPM_DOC_DIR\
 
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\
 
133
        }
 
134
 
 
135
#==============================================================================
 
136
# ---- configure macros.
 
137
#       Macro(s) similar to those used by configure.
 
138
#
 
139
%_prefix                @prefix@
 
140
%_build                 %{_host}
 
141
%_build_alias           %{_host_alias}
 
142
%_build_cpu             %{_host_cpu}
 
143
%_build_vendor          %{_host_vendor}
 
144
%_build_os              %{_host_os}
 
145
%_host                  @host@
 
146
%_host_alias            @host_alias@
 
147
%_host_cpu              @host_cpu@
 
148
%_host_vendor           @host_vendor@
 
149
%_host_os               @host_os@
 
150
%_target                %{_host}
 
151
%_target_alias          %{_host_alias}
 
152
%_target_cpu            %{_host_cpu}
 
153
%_target_vendor         %{_host_vendor}
 
154
%_target_os             %{_host_os}
 
155
 
 
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)
 
160
#
 
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
 
169
# %configure.
 
170
#
 
171
%configure      \
 
172
  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
 
173
  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
 
174
 
 
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.
 
180
#
 
181
%GNUconfigure   \
 
182
  %{__libtoolize} --copy --force \
 
183
  %{__aclocal} \
 
184
  %{__autoheader} \
 
185
  %{__automake} \
 
186
  %{__autoconf} \
 
187
  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}