b6b786ea680586cc8e05688466756126e2d97e0a
[tools/librpm-tizen.git] / macros.in
1 #/*! \page mconfig Current default macro definitions
2 # \verbatim
3 #
4 # $Id: macros.in,v 1.73 2001/03/17 19:55:09 jbj Exp $
5 #
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.
10 #
11 #==============================================================================
12 # Macro naming conventions (preliminary):
13 #
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.
19 #
20
21 #==============================================================================
22 # ---- A macro that expands to nothing.
23 #
24 %nil                    %{!?nil}
25
26 #==============================================================================
27 # ---- filesystem macros.
28 #
29 %_usr                   @prefix@
30 %_usrsrc                %{_usr}/src
31 %_var                   @varprefix@
32
33 #==============================================================================
34 # ---- Generally useful path macros.
35 #
36 %__awk                  @AWK@
37 %__bzip2                @BZIP2BIN@
38 %__cat                  @__CAT@
39 %__chgrp                @__CHGRP@
40 %__chmod                @__CHMOD@
41 %__chown                @__CHOWN@
42 %__cp                   @__CP@
43 %__cpio                 @__CPIO@
44 %__grep                 @__GREP@
45 %__gzip                 @GZIPBIN@
46 %__id                   @__ID@
47 %__install              @__INSTALL@
48 %__ln_s                 @LN_S@
49 %__make                 @__MAKE@
50 %__mkdir                @__MKDIR@
51 %__mkdir_p              @MKDIR_P@
52 %__mv                   @__MV@
53 %__patch                @__PATCH@
54 %__perl                 @__PERL@
55 %__pgp                  @PGPBIN@
56 %__python               @__PYTHON@
57 %__rm                   @__RM@
58 %__rsh                  @__RSH@
59 %__sed                  @__SED@
60 %__ssh                  @__SSH@
61 %__tar                  @__TAR@
62 %__unzip                @UNZIPBIN@
63
64 #==============================================================================
65 # ---- Build system path macros.
66 #
67 %__ar                   @AR@
68 %__cc                   @CC@
69 %__cpp                  @CPP@
70 %__ld                   @__LD@
71 %__nm                   @__NM@
72 %__objcopy              @__OBJCOPY@
73 %__objdump              @__OBJDUMP@
74 %__ranlib               @RANLIB@
75 %__remsh                %{__rsh}
76 %__strip                @__STRIP@
77
78 # XXX avoid failures if tools are not installed when rpm is built.
79 %__libtoolize           libtoolize
80 %__aclocal              aclocal
81 %__autoheader           autoheader
82 %__automake             automake
83 %__autoconf             autoconf
84
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.
90 #
91 #
92 #       The directory where sources/patches will be unpacked and built.
93 %_builddir              %{_topdir}/BUILD
94
95 #       The interpreter used for build scriptlets.
96 %_buildshell            /bin/sh
97
98 #       The path to the bzip2 executable (legacy).
99 %_bzip2bin              %{__bzip2}
100
101 #       The location of the rpm database file(s).
102 %_dbpath                %{_var}/lib/rpm
103
104 #       The location of the rpm database file(s) after "rpm --rebuilddb".
105 %_dbpath_rebuild        %{_dbpath}
106
107 %_defaultdocdir         %{_usr}/doc
108
109 #
110 %__find_provides        @FINDPROVIDES@
111 %__find_requires        @FINDREQUIRES@
112 #%__find_prereq         ???
113 #%__find_conflicts      ???
114 #%__find_obsoletes      ???
115 #
116 # XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
117 %__id_u                 @__ID_U@
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@
123 #
124
125 #       The path to the gzip executable (legacy).
126 %_gzipbin               %{__gzip}
127
128 #       The number of changelog entries kept when installing (legacy, unused in
129 #       rpm-4.0.1 and later).
130 %_instchangelog         5
131
132 #       The path to the pgp executable (legacy).
133 %_pgpbin                %{__pgp}
134
135 #       The directory where newly built binary packages will be written.
136 %_rpmdir                %{_topdir}/RPMS
137
138 #       A template used to generate the output binary package file name
139 #       (legacy).
140 %_rpmfilename           %{_build_name_fmt}
141
142 #       The default signature type.
143 %_signature             none
144
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
148
149 #       The directory where the spec file from a source package will be
150 #       installed.
151 %_specdir               %{_topdir}/SPECS
152
153 #       The directory where newly built source packages will be written.
154 %_srcrpmdir             %{_topdir}/SRPMS
155
156 #       Directory where temporaray files can be created.
157 %_tmppath               %{_var}/tmp
158
159 #       Path to top of build area.
160 %_topdir                %{_usrsrc}/redhat
161
162 #       The path to the unzip executable (legacy).
163 %_unzipbin              %{__unzip}
164
165 #==============================================================================
166 # ---- Optional rpmrc macros.
167 #       Macros that are initialized as a side effect of rpmrc and/or spec
168 #       file parsing.
169 #
170 #       Configurable build root path, same as BuildRoot: in a specfile.
171 #       (Note: the configured macro value will override the spec file value).
172 #
173 #%buildroot
174
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.
178 #
179 #%buildsubdir
180
181 #       Configurable distribution information, same as Distribution: tag in a
182 #       specfile.
183 #
184 #%distribution
185
186 #       Configurable distribution URL, same as DistURL: tag in a specfile.
187 #       The URL will be used to supply reliable information to tools like
188 #       rpmfind.
189 #
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.
193 #
194 #%disturl
195
196 #       Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
197 #       marked as %doc should be installed.
198 #%_excludedocs
199
200 #       The port and machine name of a FTP proxy host running TIS firewall.
201 #
202 #%_ftpport
203 #%_ftpproxy
204
205 #       The signature to use and the location of configuration files for
206 #       signing packages with GNU gpg.
207 #
208 #%_gpg_name
209 #%_gpg_path
210
211 #       The port and machine name of an HTTP proxy host.
212 #
213 #%_httpport
214 #%_httpproxy
215
216 #       The PATH put into the environment before running %pre/%post et al.
217 #
218 %_install_script_path   /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
219
220 #       A colon separated list of desired locales to be installed;
221 #       "all" means install all locale specific files.
222 #       
223 %_install_langs all
224
225 #
226 #       Deprecated.
227 #
228 #%_langpatt
229
230 #       A colon separated list of paths where files should *not* be installed.
231 #       Usually, these are network file system mount points.
232 #
233 #%_netsharedpath
234
235 #       Configurable packager information, same as Packager: in a specfile.
236 #
237 #%packager
238
239 #       Compression type and level for source/binary package payloads.
240 #               "w9.gzdio"      gzip level 9 (default).
241 #               "w9.bzdio"      bzip2 level 9.
242 #
243 #%_source_payload       w9.gzdio
244 #%_binary_payload       w9.gzdio
245
246 #       The signature to use and the location of configuration files for
247 #       signing packages with PGP.
248 #
249 #%_pgp_name
250 #%_pgp_path
251
252 #       Configurable virtual provides (unimplemented, use Provides: ...
253 #       in an rpmrc file).
254 #
255 #%_provides
256
257 #       Deprecated.
258 #
259 #%_timecheck
260
261 #       Configurable vendor information, same as Vendor: in a specfile.
262 #
263 #%vendor
264
265 #==============================================================================
266 # ---- Database configuration macros.
267 #       Macros used to configure Berkley db parameters.
268 #
269 # Choose db interface:
270 #       0       same as 1
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).
275 #
276 # There are two macros so that --rebuilddb can convert db1 -> db3.
277 #
278 %_dbapi                 3
279 %_dbapi_rebuild         3
280
281 #
282 #   token               Berkeley db flag or value
283 # =================================================
284 #   hash                DB_HASH
285 #
286 # See http://www.sleepycat.com for Berkeley db-3.0.55 documentation.
287 #
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?
291 #
292 %__dbi_type             hash
293 %__dbi_other            usecursors
294 %__dbi_perms            perms=0644
295
296 # This is a colon (or white space) separated list of tokens for Berkeley
297 # dbi configuration.
298 %_dbi_config    \
299   %{__dbi_type}\
300   %{__dbi_other}\
301   %{__dbi_perms}\
302 %{nil}
303
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
306
307 # "Packages" needs fcntl shared/exclusive lock.
308 %_dbi_config_Packages   %{_dbi_config}:lockdbfd
309
310 # "Depends" is a per-transaction cache of known dependency resolutions.
311 %_dbi_config_Depends    %{_dbi_config}:temporary
312
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
318
319 #==============================================================================
320 # ---- transaction macros.
321 #       Macro(s) used to parameterize 
322 #
323 #       The output binary package file name template used when building
324 #       binary packages.
325 # XXX Note escaped %% for use in headerSprintf
326 %_build_name_fmt        %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
327
328 #       The output binary package file name template used when repackaging
329 #       erased packages.
330 # XXX Note escaped %% for use in headerSprintf
331 %_repackage_name_fmt    %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
332
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}
337
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..
342 #
343 %_arch                  @RPMCANONARCH@
344 %_vendor                @RPMCANONVENDOR@
345 %_os                    @RPMCANONOS@
346 %_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}
347
348 #
349 # Define a generic value for optflags. Normally overridden by per-target macros.
350 %optflags               -O2
351
352 #
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}
356
357 #==============================================================================
358 # ---- Scriptlet template templates.
359 #       Global defaults used for building scriptlet templates.
360 #
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}\"\
367 #RPM_OS=\"%{_os}\"\
368 #export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
369 #RPM_DOC_DIR=\"%{_docdir}\"\
370 #export RPM_DOC_DIR\
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}
377
378 %___build_shell         %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
379 %___build_args          -e
380 %___build_cmd           %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
381 %___build_pre   \
382 RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
383 RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
384 RPM_OPT_FLAGS=\"%{optflags}\"\
385 RPM_ARCH=\"%{_arch}\"\
386 RPM_OS=\"%{_os}\"\
387 export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
388 RPM_DOC_DIR=\"%{_docdir}\"\
389 export RPM_DOC_DIR\
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}\
396 \
397 %{verbose:set -x}%{!verbose:exec > /dev/null}\
398 umask 022\
399 cd %{u2p:%{_builddir}}\
400
401
402 #%___build_body         %{nil}
403 %___build_post          exit 0
404
405 %___build_template      #!%{___build_shell}\
406 %{___build_pre}\
407 %{nil}
408
409 #%{___build_body}\
410 #%{___build_post}\
411 #%{nil}
412
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.
417 #
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}\
425 %{__spec_prep_pre}\
426 %{nil}
427
428 #%{__spec_prep_body}\
429 #%{__spec_prep_post}\
430 #%{nil}
431
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}\
439 %{__spec_build_pre}\
440 %{nil}
441
442 #%{__spec_build_body}\
443 #%{__spec_build_post}\
444 #%{nil}
445
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}\
454 %{nil}
455 %__spec_install_template        #!%{__spec_install_shell}\
456 %{__spec_install_pre}\
457 %{nil}
458
459 #%{__spec_install_body}\
460 #%{__spec_install_post}\
461 #%{nil}
462
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}\
471 #%{nil}
472
473 #%{__spec_autodep_body}\
474 #%{__spec_autodep_post}\
475 #%{nil}
476
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}\
484 %{__spec_clean_pre}\
485 %{nil}
486
487 #%{__spec_clean_body}\
488 #%{__spec_clean_post}\
489 #%{nil}
490
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}\
499 %{nil}
500
501 #%{__spec_rmbuild_body}\
502 #%{__spec_rmbuild_post}\
503 #%{nil}
504
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}
520
521 #==============================================================================
522 # ---- configure macros.
523 #       Macro(s) slavishly copied from autoconf's config.status.
524 #
525 %_prefix                @prefix@
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
534 %_lib                   lib
535 %_libdir                %{_exec_prefix}/%{_lib}
536 %_includedir            %{_prefix}/include
537 %_oldincludedir         /usr/include
538 %_infodir               %{_prefix}/info
539 %_mandir                %{_prefix}/man
540
541 #==============================================================================
542 # ---- config.guess platform macros.
543 #       Macro(s) similar to the tokens used by configure.
544 #
545 %_build                 %{_host}
546 %_build_alias           %{_host_alias}
547 %_build_cpu             %{_host_cpu}
548 %_build_vendor          %{_host_vendor}
549 %_build_os              %{_host_os}
550 %_host                  @host@
551 %_host_alias            @host_alias@
552 %_host_cpu              @host_cpu@
553 %_host_vendor           @host_vendor@
554 %_host_os               @host_os@
555 %_target                %{_host}
556 %_target_alias          %{_host_alias}
557 %_target_cpu            %{_host_cpu}
558 %_target_vendor         %{_host_vendor}
559 %_target_os             %{_host_os}
560
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)
565 #
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 %*.
573 #
574 # This is the version of %configure used through rpm-3.0.4.
575 #%configure     \
576 #  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
577 #  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
578 #
579 #------------------------------------------------------------------------------
580 # This is an improved version of %configure (from PLD team).
581 %configure \
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:
602 %makeinstall \
603    make \\\
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} \\\
617    install
618
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.
626 #
627 # Based on autogen.sh from GNOME and orginal GNUconfigure
628 #
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}` \
635 do \
636   dr=`dirname ${coin}`; \
637 if test -f ${dr}/NO-AUTO-GEN; then \
638  : \
639 else \
640      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
641     ( cd ${dr}; \
642       aclocalinclude="${ACLOCAL_FLAGS}"; \
643       for k in ${macrodirs}; do \
644         if test -d ${k}; then \
645           aclocalinclude="${aclocalinclude} -I ${k}"; \
646         ##else \
647         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
648         fi \
649       done \
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 \
653         else \
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; \
657         fi \
658       fi \
659       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
660         %{__libtoolize} --force --copy; \
661       fi \
662       aclocal ${aclocalinclude}; \
663       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
664         %{__autoheader}; \
665       fi \
666       echo "Running automake --gnu ${am_opt} ..."; \
667       %{__automake} --add-missing --gnu ${am_opt}; \
668       %{__autoconf}; \
669     ); \
670   fi \
671 done \
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}
674
675 #------------------------------------------------------------------------------
676 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
677 #
678 # For example, these can be used as (from ImageMagick.spec from PLD site)
679 #       [...]
680 #       BuildPrereq: perl
681 #       [...]
682 #       %package perl
683 #       Summary: libraries and modules for access to ImageMagick from perl
684 #       Group: Development/Languages/Perl
685 #       Requires: %{name} = %{version}
686 #       %requires_eq    perl
687 #       [...]
688 #       %install
689 #       rm -fr $RPM_BUILD_ROOT
690 #       install -d $RPM_BUILD_ROOT/%{perl_sitearch}
691 #       [...]
692 #       %files perl
693 #       %defattr(644,root,root,755)
694 #       %{perl_sitearch}/Image
695 #       %dir %{perl_sitearch}/auto/Image
696 #
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)
700
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
705 #   conditionals.
706 #
707 %ix86   i386 i486 i586 i686 i786 i886 i986
708
709 #------------------------------------------------------------------------
710 # Use in %install to generate locale specific file lists. For example,
711 #
712 # %install
713 # ...
714 # %find_lang %{name}
715 # ...
716 # %files -f %{name}.lang
717 #
718 %find_lang      @RPMCONFIGDIR@/find-lang.sh %{buildroot}
719
720 # \endverbatim
721 #*/