Typo.
[tools/librpm-tizen.git] / macros.in
1 # $Id: macros.in,v 1.34 1999/08/18 16:29:53 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 # ---- A macro that expands to nothing.
14 #
15 %nil    %{!?nil}
16
17 #==============================================================================
18 # ---- filesystem macros.
19 #
20 %_usr                   @prefix@
21 %_usrsrc                %{_usr}/src
22 %_var                   @varprefix@
23
24 #==============================================================================
25 # ---- path macros
26 #       XXX The use of which here is overly simple (read: dumb).
27 #
28 %__bzip2                %{_bzip2bin}
29 %__cat                  @__CAT@
30 %__chgrp                @__CHGRP@
31 %__chmod                @__CHMOD@
32 %__chown                @__CHOWN@
33 %__cp                   @__CP@
34 %__cpio                 @__CPIO@
35 %__gzip                 %{_gzipbin}
36 %__id                   @__ID@
37 %__install              %(which install)
38 %__make                 @__MAKE@
39 %__mkdir                @__MKDIR@
40 %__mv                   @__MV@
41 %__patch                @__PATCH@
42 %__ranlib               %(which ranlib)
43 %__rm                   @__RM@
44 %__strip                %(which strip)
45 %__tar                  @__TAR@
46
47 # XXX avoid weird failures from which if tools are not installed
48 %__libtoolize           libtoolize
49 %__aclocal              aclocal
50 %__autoheader           autoheader
51 %__automake             automake
52 %__autoconf             autoconf
53
54 #==============================================================================
55 # ---- Required rpmrc macros.
56 #       Macros that used to be initialized as a side effect of rpmrc parsing.
57 #       These are the default values that can be overridden by other
58 #       (e.g. per-platform, per-system, per-packager) macro files.
59 #
60 %_builddir              %{_topdir}/BUILD
61 %_buildshell            /bin/sh
62 %_bzip2bin              @BZIP2BIN@
63 %_dbpath                %{_var}/lib/rpm
64 %_defaultdocdir         %{_usr}/doc
65 #
66 %__find_provides        @FINDPROVIDES@
67 %__find_requires        @FINDREQUIRES@
68 #%__find_prereq         ???
69 #%__find_conflicts      ???
70 #%__find_obsoletes      ???
71 #
72 # XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
73 %_fixowner              [ `%{__id} -u` = '0' ] && %{__chown} -Rhf root
74 %_fixgroup              [ `%{__id} -u` = '0' ] && %{__chgrp} -Rhf @ROOT_GROUP@
75 %_fixperms              %{__chmod} -Rf @FIXPERMS@
76 #
77 %_gzipbin               @GZIPBIN@
78 %_instchangelog         5
79 %_pgpbin                @PGPBIN@
80 %_rpmdir                %{_topdir}/RPMS
81 #
82 # XXX Note escaped %% for use in headerSprintf
83 %_rpmfilename           %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
84 %_signature             none
85 %_sourcedir             %{_topdir}/SOURCES
86 %_specdir               %{_topdir}/SPECS
87 %_srcrpmdir             %{_topdir}/SRPMS
88 %_tmppath               %{_var}/tmp
89 %_topdir                %{_usrsrc}/redhat
90 #
91 #==============================================================================
92 # ---- Optional rpmrc macros.
93 #       Macros that used to be initialized as a side effect of rpmrc and/or
94 #       spec file parsing but were not set in the distributed configuration 
95 #       /usr/lib/rpm/rpmrc file.
96 #
97 #%buildroot
98 #%distribution
99 #%_excludedocs
100 #%_ftpport
101 #%_ftpproxy
102 #%_gpg_name
103 #%_gpg_path
104 #%_httpport
105 #%_httpproxy
106 #%_langpatt
107 #%_netsharedpath
108 #%packager
109 #%_pgp_name
110 #%_pgp_path
111 #%_provides
112 #%_timecheck
113 #%vendor
114
115 #==============================================================================
116 # ---- per-platform macros.
117 #       Macros that are specific to an individual platform. The values here
118 #       will be used if the per-platform macro file does not exist..
119 #
120 %_arch                  @RPMCANONARCH@
121 %_vendor                @RPMCANONVENDOR@
122 %_os                    @RPMCANONOS@
123 %_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}
124 #
125 # XXX use the rpmrc instantiated macro for now
126 #%optflags              -O2
127
128 #==============================================================================
129 # ---- script environment macros.
130 #       Macro(s) that establish the environment for running a script.
131 #
132 %_preScriptEnvironment  \
133         RPM_SOURCE_DIR=\"%{_sourcedir}\"\
134         RPM_BUILD_DIR=\"%{_builddir}\"\
135         RPM_OPT_FLAGS=\"%{optflags}\"\
136         RPM_ARCH=\"%{_arch}\"\
137         RPM_OS=\"%{_os}\"\
138         export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
139         RPM_DOC_DIR=\"%{_docdir}\"\
140         export RPM_DOC_DIR\
141         RPM_PACKAGE_NAME=\"%{name}\"\
142         RPM_PACKAGE_VERSION=\"%{version}\"\
143         RPM_PACKAGE_RELEASE=\"%{release}\"\
144         export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
145         %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
146         export RPM_BUILD_ROOT\
147         }
148
149 #==============================================================================
150 # ---- configure macros.
151 #       Macro(s) slavishly copied from config.status.
152 #       CAVEAT: Only _prefix is currently used (read: supported). Please
153 #       don't expect or rely on these macros keeping their current values
154 #       (or even being defined) in future versions of rpm.
155 #
156 %_prefix                @prefix@
157 %_exec_prefix           %{_prefix}
158 %_bindir                %{_exec_prefix}/bin
159 %_sbindir               %{_exec_prefix}/sbin
160 %_libexecdir            %{_exec_prefix}/libexec
161 %_datadir               %{_prefix}/share
162 %_sysconfdir            %{_prefix}/etc
163 %_sharedstatedir        %{_prefix}/com
164 %_localstatedir         %{_prefix}/var
165 %_libdir                %{_exec_prefix}/lib
166 %_includedir            %{_prefix}/include
167 %_oldincludedir         /usr/include
168 %_infodir               %{_prefix}/info
169 %_mandir                %{_prefix}/man
170
171 #==============================================================================
172 # ---- config.guess platform macros.
173 #       Macro(s) similar to the tokens used by configure.
174 #
175 %_build                 %{_host}
176 %_build_alias           %{_host_alias}
177 %_build_cpu             %{_host_cpu}
178 %_build_vendor          %{_host_vendor}
179 %_build_os              %{_host_os}
180 %_host                  @host@
181 %_host_alias            @host_alias@
182 %_host_cpu              @host_cpu@
183 %_host_vendor           @host_vendor@
184 %_host_os               @host_os@
185 %_target                %{_host}
186 %_target_alias          %{_host_alias}
187 %_target_cpu            %{_host_cpu}
188 %_target_vendor         %{_host_vendor}
189 %_target_os             %{_host_os}
190
191 #==============================================================================
192 # ---- specfile macros.
193 #       Macro(s) here can be used reliably for reproducible builds.
194 #       (Note: Above is the goal, below are the macros under development)
195 #
196 # The configure macro does the following:
197 #       optionally change to a subdirectory (not implemented).
198 #       attempt to update config.guess and config.sub.
199 #       run configure with correct prefix, platform, and CFLAGS.
200 #       optionally restore current directory (not implemented).
201 # The configure macro should be invoked as %configure (rather than %{configure})
202 # because the rest of the arguments will be expanded using %*. Another
203 # gotcha is that arguments, if present, should be on the same line as the
204 # %configure.
205 #
206 %configure      \
207   %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
208   CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
209
210 #------------------------------------------------------------------------------
211 # The GNUconfigure macro does the following:
212 #       update config.guess and config.sub.
213 #       regenerate all autoconf/automake files
214 #       optionally change to a directory (make the directory if requested).
215 #       run configure with correct prefix, platform, and CFLAGS.
216 #       optionally restore current directory.
217 #
218 %GNUconfigure(MC:)      \
219   %{__libtoolize} --copy --force \
220   %{__aclocal} \
221   %{__autoheader} \
222   %{__automake} \
223   %{__autoconf} \
224   %{-C:_mydir="`pwd`"; %{-M:%{__mkdir} -p %{-C*};} cd %{-C*};} \
225   CFLAGS="%{optflags}" %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} %* \
226   %{-C:cd ${_mydir}; unset _mydir}
227
228 #------------------------------------------------------------------------------
229 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
230 #
231 # For example, these can be used as (from ImageMagick.spec from PLD site)
232 #       [...]
233 #       BuildPrereq: perl
234 #       [...]
235 #       %package perl
236 #       Summary: libraries and modules for access to ImageMagick from perl
237 #       Group: Development/Languages/Perl
238 #       Requires: %{name} = %{version}
239 #       %requires_eq    perl
240 #       [...]
241 #       %install
242 #       rm -fr $RPM_BUILD_ROOT
243 #       install -d $RPM_BUILD_ROOT/%{perl_sitearch}
244 #       [...]
245 #       %files perl
246 #       %defattr(644,root,root,755)
247 #       %{perl_sitearch}/Image
248 #       %dir %{perl_sitearch}/auto/Image
249 #
250 %requires_eq()  %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}' %1| grep -v "is not")
251 %perl_sitearch  %(eval "`perl -V:installsitearch`"; echo $installsitearch)
252 %perl_archlib   %(eval "`perl -V:installarchlib`"; echo $installarchlib)