Check all header strings to resize buffer CVE-2006-5466 (#212833).
[platform/upstream/rpm.git] / macros.in
1 #/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
2 # \verbatim
3 #
4 # $Id: macros.in,v 1.154.2.6 2005/07/21 01:45:44 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 %__file                 @__FILE@
45 %__gpg                  @__GPG@
46 %__grep                 @__GREP@
47 %__gzip                 @GZIPBIN@
48 %__id                   @__ID@
49 %__install              @__INSTALL@
50 %__ln_s                 @LN_S@
51 %__make                 @__MAKE@
52 %__mkdir                @__MKDIR@
53 %__mkdir_p              @MKDIR_P@
54 %__mv                   @__MV@
55 %__patch                @__PATCH@
56 %__perl                 @__PERL@
57 %__pgp                  @PGPBIN@
58 %__python               @__PYTHON@
59 %__rm                   @__RM@
60 %__rsh                  @__RSH@
61 %__sed                  @__SED@
62 %__ssh                  @__SSH@
63 %__tar                  @__TAR@
64 %__unzip                @UNZIPBIN@
65
66 #==============================================================================
67 # ---- Build system path macros.
68 #
69 %__ar                   @AR@
70 %__as                   @AS@
71 %__cc                   @CC@
72 %__cpp                  @CPP@
73 %__cxx                  @CXX@
74 %__ld                   @__LD@
75 %__nm                   @__NM@
76 %__objcopy              @__OBJCOPY@
77 %__objdump              @__OBJDUMP@
78 %__ranlib               @RANLIB@
79 %__remsh                %{__rsh}
80 %__strip                @__STRIP@
81
82 # XXX avoid failures if tools are not installed when rpm is built.
83 %__libtoolize           libtoolize
84 %__aclocal              aclocal
85 %__autoheader           autoheader
86 %__automake             automake
87 %__autoconf             autoconf
88
89 #==============================================================================
90 # Conditional build stuff.
91
92 # Check if symbol is defined.
93 # Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
94 %defined()      %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
95 %undefined()    %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
96
97 # Shorthand for %{defined with_...}
98 %with()         %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
99 %without()      %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
100
101 # Handle conditional builds. %bcond_with is for case when feature is
102 # default off and needs to be activated with --with ... command line
103 # switch. %bcond_without is for the dual case.
104 #
105 # %bcond_with foo defines symbol with_foo if --with foo was specified on
106 # command line.
107 # %bcond_without foo defines symbol with_foo if --without foo was *not*
108 # specified on command line.
109 #
110 # For example (spec file):
111 #
112 # (at the beginning)
113 # %bcond_with extra_fonts
114 # %bcond_without static
115 # (and later)
116 # %if %{with extra_fonts}
117 # ...
118 # %else
119 # ...
120 # %endif
121 # %if ! %{with static}
122 # ...
123 # %endif
124 # %ifdef %{with static}
125 # ...
126 # %endif
127 # %{?with_static: ... }
128 # %{!?with_static: ... }
129 # %{?with_extra_fonts: ... }
130 # %{!?with_extra_fonts: ... }
131
132 #
133 # The bottom line: never use without_foo, _with_foo nor _without_foo, only
134 # with_foo. This way changing default set of bconds for given spec is just
135 # a matter of changing single line in it and syntax is more readable.
136 %bcond_with()           %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
137 %bcond_without()        %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
138 #
139 #==============================================================================
140 # ---- Required rpmrc macros.
141 #       Macros that used to be initialized as a side effect of rpmrc parsing.
142 #       These are the default values that can be overridden by other
143 #       (e.g. per-platform, per-system, per-packager, per-package) macros.
144 #
145 #       The directory where sources/patches will be unpacked and built.
146 %_builddir              %{_topdir}/BUILD
147
148 #       The interpreter used for build scriptlets.
149 %_buildshell            /bin/sh
150
151 #       The path to the bzip2 executable (legacy, use %{__bzip2} instead).
152 %_bzip2bin              %{__bzip2}
153
154 #       The location of the rpm database file(s).
155 %_dbpath                %{_var}/lib/rpm
156
157 #       The location of the rpm database file(s) after "rpm --rebuilddb".
158 %_dbpath_rebuild        %{_dbpath}
159
160 #
161 #       Path to script that creates debug symbols in a /usr/lib/debug
162 #       shadow tree.
163 %__debug_install_post   \
164    @RPMCONFIGDIR@/find-debuginfo.sh %{_builddir}/%{?buildsubdir}\
165 %{nil}
166
167 #       Template for debug information sub-package.
168 %debug_package \
169 %ifnarch noarch\
170 %global __debug_package 1\
171 %package debug\
172 Summary: Debug information for package %{name}\
173 Group: Development/Debug\
174 AutoReqProv: 0\
175 %description debug\
176 This package provides debug information for package %{name}.\
177 Debug information is useful when developing applications that use this\
178 package or when debugging this package.\
179 %files debug -f debugfiles.list\
180 %defattr(-,root,root)\
181 %endif\
182 %{nil}
183
184 %_defaultdocdir         %{_usr}/doc
185
186 #       The path to the gzip executable (legacy, use %{__gzip} instead).
187 %_gzipbin               %{__gzip}
188
189 #       The number of changelog entries kept when installing (legacy, unused in
190 #       rpm-4.0.1 and later).
191 %_instchangelog         5
192
193 #       The path to the pgp executable (legacy, use %{__pgp} instead).
194 %_pgpbin                %{__pgp}
195
196 #       The directory where newly built binary packages will be written.
197 %_rpmdir                %{_topdir}/RPMS
198
199 #       A template used to generate the output binary package file name
200 #       (legacy).
201 %_rpmfilename           %{_build_name_fmt}
202
203 #       The default signature type.
204 %_signature             none
205
206 #       The directory where sources/patches from a source package will be
207 #       installed. This is also where sources/patches are found when building.
208 %_sourcedir             %{_topdir}/SOURCES
209
210 #       The directory where the spec file from a source package will be
211 #       installed.
212 %_specdir               %{_topdir}/SPECS
213
214 #       The directory where newly built source packages will be written.
215 %_srcrpmdir             %{_topdir}/SRPMS
216
217 #       Directory where temporaray files can be created.
218 %_tmppath               %{_var}/tmp
219
220 #       Path to top of build area.
221 %_topdir                %{_usrsrc}/redhat
222
223 #       The path to the unzip executable (legacy, use %{__unzip} instead).
224 %_unzipbin              %{__unzip}
225
226 #==============================================================================
227 # ---- Optional rpmrc macros.
228 #       Macros that are initialized as a side effect of rpmrc and/or spec
229 #       file parsing.
230 #
231 #       Configurable build root path, same as BuildRoot: in a specfile.
232 #       (Note: the configured macro value will override the spec file value).
233 #
234 #%buildroot
235
236 #       The sub-directory (relative to %{_builddir}) where sources are compiled.
237 #       This macro is set after processing %setup, either explicitly from the
238 #       value given to -n or the default name-version.
239 #
240 #%buildsubdir
241
242 #       Configurable distribution information, same as Distribution: tag in a
243 #       specfile.
244 #
245 #%distribution
246
247 #       Configurable distribution URL, same as DistURL: tag in a specfile.
248 #       The URL will be used to supply reliable information to tools like
249 #       rpmfind.
250 #
251 # Note: You should not configure with disturl (or build packages with
252 # the DistURL: tag) unless you are willing to supply content in a
253 # yet-to-be-determined format at the URL specified.
254 #
255 #%disturl
256
257 #       Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
258 #       marked as %doc should be installed.
259 #%_excludedocs
260
261 #       The port and machine name of a FTP proxy host running TIS firewall.
262 #
263 #%_ftpport
264 #%_ftpproxy
265
266 #       The signature to use and the location of configuration files for
267 #       signing packages with GNU gpg.
268 #
269 #%_gpg_name
270 #%_gpg_path
271
272 #       The port and machine name of an HTTP proxy host.
273 #
274 #%_httpport
275 #%_httpproxy
276
277 #       The PATH put into the environment before running %pre/%post et al.
278 #
279 %_install_script_path   /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
280
281 #       A colon separated list of desired locales to be installed;
282 #       "all" means install all locale specific files.
283 #       
284 %_install_langs all
285
286 #       The value of CLASSPATH in build scriptlets (iff configured).
287 #       
288 #%_javaclasspath        all
289
290 #       Import packaging conventions from jpackage.org (prefixed with _
291 #       to avoid name collisions).
292 #       
293 %_javadir      %{_datadir}/java
294 %_javadocdir   %{_datadir}/javadoc
295
296 #
297 #       Deprecated.
298 #
299 #%_langpatt
300
301 #       A colon separated list of paths where files should *not* be installed.
302 #       Usually, these are network file system mount points.
303 #
304 #%_netsharedpath
305
306 #       (experimental)
307 #       The type of pattern match used on rpmdb iterator selectors:
308 #       "default"       simple glob-like regex, periods will be escaped,
309 #                       splats will have period prepended, full "^...$" match
310 #                       required. Also, file path tags will use glob(7).
311 #       "strcmp"        compare strings
312 #       "regex"         regex(7) patterns using regcomp(3)/regexec(3)
313 #       "glob"          glob(7) patterns using fnmatch(3)
314 #
315 %_query_selector_match  default
316
317 #       Configurable packager information, same as Packager: in a specfile.
318 #
319 #%packager
320
321 #       Compression type and level for source/binary package payloads.
322 #               "w9.gzdio"      gzip level 9 (default).
323 #               "w9.bzdio"      bzip2 level 9.
324 #
325 #%_source_payload       w9.gzdio
326 #%_binary_payload       w9.gzdio
327
328 #       The signature to use and the location of configuration files for
329 #       signing packages with PGP.
330 #
331 #%_pgp_name
332 #%_pgp_path
333
334 #       Configurable vendor information, same as Vendor: in a specfile.
335 #
336 #%vendor
337
338 #==============================================================================
339 # ---- Build configuration macros.
340 #
341 # Package version macro.
342 #       The type of package to produce, for compatibility with legacy
343 #       versions of rpm.
344 #
345 # This is an rpm version, e.g. 30005 means to produce packaging compatible
346 # with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
347 # version before rpm-3.0.5) are not supported. The only incompatible change
348 # in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
349 # rpmlead, so there's little need to use any value greater than 30005.
350 #
351 %_package_version       30005
352
353 #
354 # Script gets packaged file list on input and buildroot as first parameter.
355 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
356 #
357 # Note: Disable (by commenting out) for legacy compatibility.
358 %__check_files         @RPMCONFIGDIR@/check-files %{buildroot}
359
360 #
361 # Should unpackaged files in a build root terminate a build?
362 #
363 # Note: The default value should be 0 for legacy compatibility.
364 %_unpackaged_files_terminate_build      1
365
366 #
367 # Should missing %doc files in the build directory terminate a build?
368 #
369 # Note: The default value should be 0 for legacy compatibility.
370 %_missing_doc_files_terminate_build     1
371
372 #
373 # Use internal dependency generator rather than external helpers?
374 %_use_internal_dependency_generator     1
375
376 #
377 # Filter GLIBC_PRIVATE Provides: and Requires:
378 %_filter_GLIBC_PRIVATE                  0
379
380 # Desired selinux policy tree
381 %__policy_tree  %{expand:%%global __policy_tree %{lua:\
382 t="targeted"\
383 f = io.open("/etc/selinux/config")\
384 if f then\
385   for l in f:lines() do\
386     if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
387   end\
388   f:close()\
389 end\
390 print (t)\
391 }}%{__policy_tree}
392
393 # Path to selinux file context patterns.
394 %__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
395
396 #
397 # Path to selinux file context patterns used to add
398 # RPMTAG_FILECONTEXTS to packages when building.
399 #
400 # Undefined, missing or %{nil} will disable.
401 %_build_file_context_path       %{nil}
402
403 #
404 # Path to selinux file context patterns used to set
405 # (or override package content) file contexts when installing.
406 #
407 # Undefined, missing or %{nil} will use package content (if available).
408 %_install_file_context_path     %{__file_context_path}
409
410 #
411 # Path to selinux file context patterns used to verify
412 # file contexts on file system.
413 #
414 # Undefined, missing or %{nil} will use package content (if available).
415 %_verify_file_context_path      %{__file_context_path}
416
417 #
418 # Path to scripts to autogenerate package dependencies,
419 #
420 # Note: Used iff _use_internal_dependency_generator is zero.
421 #%__find_provides       @RPMCONFIGDIR@/rpmdeps --provides
422 #%__find_requires       @RPMCONFIGDIR@/rpmdeps --requires
423 %__find_provides        @RPMCONFIGDIR@/find-provides
424 %__find_requires        @RPMCONFIGDIR@/find-requires
425 #%__find_conflicts      ???
426 #%__find_obsoletes      ???
427
428 #
429 # Path to scripts to autogenerate per-interpreter package dependencies,
430 #
431 # Note: Used iff _use_internal_dependency_generator is non-zero. The
432 # helpers are also used by @RPMCONFIGDIR@/rpmdeps {--provides|--requires}.
433 #%__perl_provides       @RPMCONFIGDIR@/perldeps.pl --provides
434 #%__perl_requires       @RPMCONFIGDIR@/perldeps.pl --requires
435 %__perl_provides        @RPMCONFIGDIR@/perl.prov
436 %__perl_requires        @RPMCONFIGDIR@/perl.req
437
438 %__python_provides      @RPMCONFIGDIR@/pythondeps.sh --provides
439 %__python_requires      @RPMCONFIGDIR@/pythondeps.sh --requires
440
441 %__mono_provides        @RPMCONFIGDIR@/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
442 %__mono_requires        @RPMCONFIGDIR@/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
443
444 #
445 # fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
446 # These macros are necessary only for legacy compatibility, and have moved
447 # to per-platform macro configuration (i.e. @RPMCONFIGDIR@/<arch>-<os>/macros)
448 #
449 # Note: These are no longer enabled by default.
450 #%__id_u                @__ID_U@
451 #%__chown_Rhf           @__CHOWN_RHF@
452 #%__chgrp_Rhf           @__CHGRP_RHF@
453 #%_fixowner             [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
454 #%_fixgroup             [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
455 #%_fixperms             %{__chmod} -Rf @FIXPERMS@
456 #
457
458 #==============================================================================
459 # ---- Database configuration macros.
460 #       Macros used to configure Berkley db parameters.
461 #
462 # rpmdb macro configuration values are a colon (or white space) separated
463 # list of tokens, with an optional '!' negation to explicitly disable bit
464 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
465 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
466 # (e.g. %_dbi_config). The configuration is also conditioned on the
467 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
468 # the configuration while rebuilding an rpmdb database.
469 #
470 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
471 # see that for the latest gory details. Note carefully that, unless you
472 # are writing an rpm installer, you shouldn't have to touch *any* of these
473 # parameters.
474 #
475 # Here's a short list of the tokens, with a guess of whether the option is
476 # useful:
477 #       (nothing)       currently used in rpm, known to work.
478 #       "+++"           under development, will be supported in rpm eventually.
479 #       "???"           I have no clue, you're mostly on your own.
480 #
481 # If you do find yourself inclined to fiddle, here's what I see (shrug):
482 # 1) Only the value of mp_size has any serious impact on overall performance,
483 #    and you will need ~256Kb to handle a typical machine install.
484 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
485 #    will ever need tuning. Diddle the pagesize if you're interested, although
486 #    I believe that you will find pagesize=512 "best".
487 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
488 #    and/or mp_size instead.
489 # 4) btree is faster than hash, but would require some painful rpm release
490 #    engineering to convert everbody's databases to btree, not gonna happen
491 #    soon.
492 #
493 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
494 # documentation.
495 #
496 #   token       works?  Berkeley db flag or value
497 #==================================================
498 #---------------------- DBENV->open parameters and tunable values:
499 #   mmapsize=16Mb       DBENV->set_mp_mmapsize
500 #   cachesize=1Mb       DBENV->set_cachesize, DB->set_cachesize
501 #---------------------- DBENV->open and DB->open common bits:
502 #   create              DB_CREATE
503 #   thread      ???     DB_THREAD       (useless w/o posix mutexes on linux)
504 #---------------------- DBENV->open bits:
505 #   joinenv             DB_JOIN_ENV
506 #   mpool               DB_INIT_MPOOL
507 #   cdb         +++     DB_INIT_CDB
508 #   txn         ???     DB_INIT_TXN
509 #   log         ???     DB_INIT_LOG
510 #   lock        ???     DB_INIT_LOCK
511 #   recover     ???     DB_RECOVER
512 #   recover_fatal ???   DB_RECOVER_FATAL
513 #   use_environ ???     DB_USE_ENVIRON
514 #   use_environ_root ??? DB_USE_ENVIRON_ROOT
515 #   private     +++     DB_PRIVATE
516 #   lockdown    ???     DB_LOCKDOWN
517 #   shared      +++     DB_SYSTEM_MEM
518 #---------------------- DB->open parameters and tunable values:
519 #   pagesize=512 +++    DB->set_pagesize
520 #---------------------- DB->open bits:
521 #   excl        ???     DB_EXCL
522 #   nommap      ???     DB_NOMMAP
523 #   rdonly              DB_RDONLY
524 #---------------------- DB->open types:
525 #   btree               DB_BTREE
526 #   hash                DB_HASH
527 #   recno       ???     DB_RECNO
528 #   queue       ???     DB_QUEUE
529 #   unknown     +++     DB_UNKNOWN
530 #---------------------- DB->set_flags bits:
531 #   bt_dup      +++     (btree only) DB_DUP
532 #   bt_dupsort  +++     (btree only) DB_DUPSORT
533 #   ht_dup      +++     (hash only) DB_DUP
534 #   ht_dupsort  +++     (hash only) DB_DUPSORT
535 #----------------------- rpmdb specific configuration:
536 #   usedbenv            (always on) Use db3 environment?
537 #   verify              (db3 only) Verify Packages db after RW close?
538 #   lockdbfd            (always on for Packages) Use fcntl(2) locking ?
539 #   nofsync             Disable fsync(2) call performed after db3 writes?
540 #   temporary           Unlink file when closing.
541 #
542
543 # XXX Use transactions and logs for rpmdb durability (no clue yet):
544 #%__dbi_other                   create joinenv mpool txn log \
545 #                               mp_mmapsize=8Mb mp_size=512Kb
546
547 # Use a CDB database model for concurrent access.
548 # XXX Add "private" here for legacy interoperation transiting to glibc+nptl.
549 %__dbi_cdb                      create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
550
551 %__dbi_other                    %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
552
553 # Note: adding nofsync here speeds up --rebuilddb a lot.
554 %__dbi_rebuild                  nofsync !log !txn !cdb
555 %__dbi_transient                %{__dbi_rebuild} temporary private
556 %__dbi_perms                    perms=0644
557
558 #
559 #--- Hash database configuration
560 %__dbi_htconfig \
561   hash          \
562   %{__dbi_other}\
563   %{__dbi_perms}\
564 %{nil}
565
566 %__dbi_htconfig_current         %{__dbi_htconfig}
567 %__dbi_htconfig_rebuild         %{__dbi_htconfig} %{__dbi_rebuild}
568
569 %_dbi_htconfig          \
570   %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
571   %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
572 %{nil}
573
574 #
575 #--- Btree database configuration
576 %__dbi_btconfig \
577   btree         \
578   %{__dbi_other}\
579   %{__dbi_perms}\
580 %{nil}
581
582 %__dbi_btconfig_current         %{__dbi_btconfig}
583 %__dbi_btconfig_rebuild         %{__dbi_btconfig} %{__dbi_rebuild}
584
585 %_dbi_btconfig          \
586   %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
587   %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
588 %{nil}
589
590 # The list of tags for which indices will be built.
591 %_dbi_tags      Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys
592
593 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
594 %_dbi_config_Packages           %{_dbi_htconfig} lockdbfd
595
596 # "Depends" is a per-transaction cache of known dependency resolutions.
597 %_dbi_config_Depends            %{_dbi_htconfig} temporary private
598
599 %_dbi_config_Dirnames           %{_dbi_btconfig}
600 %_dbi_config_Requireversion     %{_dbi_btconfig}
601 %_dbi_config_Provideversion     %{_dbi_btconfig}
602 %_dbi_config_Installtid         %{_dbi_btconfig}
603 %_dbi_config_Removetid          %{_dbi_btconfig}
604
605 %_dbi_config    %{_dbi_htconfig}
606
607 # XXX legacy configuration.
608 # Choose db interface:
609 #       3       native db3 interface.
610 #
611 # There are two macros so that --rebuilddb can convert db1 -> db3.
612 #
613 %_dbapi                 3
614 %_dbapi_rebuild         3
615
616 #==============================================================================
617 # ---- GPG/PGP/PGP5 signature macros.
618 #       Macro(s) to hold the arguments passed to GPG/PGP for package
619 #       signing and verification.
620 #
621 %__gpg_check_password_cmd       %{__gpg} \
622         gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
623 %__pgp_check_password_cmd       %{__pgp} \
624         pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
625 %__pgp5_check_password_cmd      %{__pgp} \
626         pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f
627
628 %__gpg_sign_cmd                 %{__gpg} \
629         gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
630         -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
631 %__pgp_sign_cmd                 %{__pgp} \
632         pgp +batchmode=on +verbose=0 +armor=off \
633         "+myname=%{_pgp_name}" -sb %{__plaintext_filename} %{__signature_filename}
634 %__pgp5_sign_cmd                %{__pgp} \
635         pgps +batchmode=on +verbose=0 +armor=off \
636         "+myname=%{_pgp_name}" -b %{__plaintext_filename} -o %{__signature_filename}
637
638 # XXX rpm-4.1 verifies signatures using beecrypt.
639 #%__gpg_verify_cmd              %{__gpg} \
640 #       gpg --batch --no-verbose --verify --no-secmem-warning \
641 #       %{__signature_filename} %{__plaintext_filename}
642 #%__pgp_verify_cmd              %{__pgp} \
643 #       pgp +batchmode=on +verbose=0 \
644 #       %{__signature_filename} %{__plaintext_filename}
645 #%__pgp5_verify_cmd             %{__pgp} \
646 #       pgpv +batchmode=on +verbose=0 \
647 #       +OutputInformationFD=1 +OutputWarningFD=1 \
648 #       -o %{__signature_filename} %{__plaintext_filename}
649
650 #
651 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
652 #       Normally this macro is defined in /etc/rpm/macros.prelink, installed
653 #       with the prelink package. If the macro is undefined, then prelinked
654 #       shared libraries contents are MD5 digest verified (as usual), rather
655 #       than MD5 verifying the output of the prelink undo helper.
656 #
657 #       Note: The 2nd token is used as argv[0] and "library" is a
658 #       placeholder that will be deleted and replaced with the appropriate
659 #       library file path.
660 #%__prelink_undo_cmd     /usr/sbin/prelink prelink -y library
661
662 # Horowitz Key Protocol server configuration
663 #
664 #_hkp_keyserver         hkp://pgp.mit.edu
665 #_hkp_keyserver_query   %{_hkp_keyserver}/pks/lookup?op=get&search=0x
666
667 #==============================================================================
668 # ---- Transaction macros.
669 #       Macro(s) used to parameterize transactions.
670 #
671 #       The output binary package file name template used when building
672 #       binary packages.
673 #
674 # XXX   Note: escaped %% for use in headerSprintf()
675 %_build_name_fmt        %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
676
677 #       The default transaction color. This value is a set of bits to
678 #       determine file and dependency affinity for this arch.
679 #               0       uncolored (i.e. use only arch as install hint)
680 #               1       Elf32 permitted
681 #               2       Elf64 permitted
682 %_transaction_color     @RPMCANONCOLOR@
683
684 #       A default autorelocation path prefixed to file paths of packages
685 #       that have an incompatible arch. This is used on ia64 to prefix
686 #       /emul/ia32 to i386 file paths, and nowhere else (yet).
687 #
688 # XXX   Note: escaped %% for use in headerSprintf()
689 %_autorelocate_path     @autorelocate_path@
690
691 #       A default directory color to choose when directories are
692 #       auto-relocated.
693 %_autorelocate_dcolor @autorelocate_dcolor@
694
695 #       The path to the dependency universe database. The default value
696 #       is the rpmdb-redhat location. The macro is usually defined in
697 #       /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
698 #%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat
699
700 #       The path to the dependency universe packages. This should
701 #       be a path to the packages contained in the solve database.
702 #%_solve_pkgsdir        /mnt/redhat/test/latest-i386/RedHat/RPMS/
703
704 #       The output binary package file name template used when suggesting
705 #       binary packages that solve a dependency. The macro is usually defined
706 #       in /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
707 #
708 # XXX   Note: escaped %% for use in headerSprintf()
709 #%_solve_name_fmt       %{?_solve_pkgsdir}%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
710
711 #       The output binary package file name template used when repackaging
712 #       erased packages.
713 #
714 # XXX   Note: escaped %% for use in headerSprintf()
715 %_repackage_name_fmt    %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
716
717 #       The directory in which erased packages will be saved when using
718 #       the --repackage option.
719 %_repackage_dir         /var/spool/repackage
720
721 #       A path (i.e. URL) prefix that is pre-pended to %{_repackage_dir}.
722 %_repackage_root        %{nil}
723
724 #       If non-zero, all erasures will be automagically repackaged.
725 %_repackage_all_erasures        0
726
727 # If non-zero, a failed transaction will be automagically rolled 
728 # back (sans, the failing transaction element).
729 %_rollback_transaction_on_failure       0
730
731 #       Verify digest/signature flags for various rpm modes:
732 #       0x30300 (_RPMVSF_NODIGESTS)    --nohdrchk      if set, don't check digest(s)
733 #       0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature   if set, don't check signature(s)
734 #       0xf0000 (_RPMVSF_NOPAYLOAD)    --nolegacy      if set, check header+payload (if possible)
735 #       0x00f00 (_RPMVSF_NOHEADER)     --nohdrchk      if set, don't check rpmdb headers
736 #
737 #       For example, the value 0xf0c00 (=0xf0000+0xc0c00) disables legacy
738 #       digest/signature checking, disables signature checking, but attempts
739 #       digest checking, also when retrieving headers from the database.
740 #
741 #       You also can do:
742 #        >>> hex(rpm._RPMVSF_NOSIGNATURES)
743 #        '0xc0c00'
744 #       or:
745 #        >>> hex(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NOPAYLOAD)
746 #        '0xf0c00'
747 #       at the python prompt for example, after "import rpm".
748 #
749 #       The checking overhead is ~11ms per header for digests/signatures;
750 #       each header from the database is checked only when first encountered
751 #       for each database open.
752 #
753 #       Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
754 #       well as --erase.
755 #
756 %__vsflags              0xf0000
757 %_vsflags_build         %{__vsflags}
758 %_vsflags_erase         %{__vsflags}
759 %_vsflags_install       %{__vsflags}
760 %_vsflags_query         %{__vsflags}
761 %_vsflags_rebuilddb     %{__vsflags}
762 %_vsflags_up2date       %{__vsflags}
763 %_vsflags_verify        %{__vsflags}
764
765 #       Relations between package names that cause dependency loops
766 #       with legacy packages that cannot be fixed. Relations are
767 #       specified as
768 #               p>q
769 #       where package p has a Requires: on something that package q Provides:
770 #
771 # XXX   Note: that there cannot be any whitespace within the string "p>q",
772 #       and that both p and q are package names (i.e. no version/release).
773 #
774 #%_dependency_whiteout_5_2              \
775 #       pam>pamconfig
776 #%_dependency_whiteout_6_1              \
777 #       pilot-link-devel>pilot-link
778 #%_dependency_whiteout_6_2              \
779 #       egcs-c++>libstdc++
780 %_dependency_whiteout_7_0               \
781         pango-gtkbeta-devel>pango-gtkbeta\
782         XFree86>Mesa                    \
783         compat-glibc>db2                \
784         compat-glibc>db1                \
785         pam>initscripts                 \
786         initscripts>sysklogd
787 %_dependency_whiteout_7_1               \
788         arts>kdelibs-sound
789 %_dependency_whiteout_7_2               \
790         libgnomeprint15>gnome-print     \
791         nautilus>nautilus-mozilla       \
792         tcl>postgresql-tcl
793 #%_dependency_whiteout_8_0              \
794 #       perl>perl-Parse-RecDescent      \
795 #       XFree86-libs>XFree86-Mesa-libGL \
796 #       perl>perl-Filter                \
797 #       perl>mrtg                       \
798 #       perl>mod_perl                   \
799 #       mysql>perl-DBD-MySQL            \
800 #       ghostscript>gimp-print          \
801 #       arts>kde2-compat                \
802 #       perl-Date-Calc>perl-Bit-Vector  \
803 #       glibc-debug>glibc-devel
804
805 %_dependency_whiteout_8_0               \
806         mysql>perl-DBD-MySQL            \
807         perl>perl-Filter                \
808         perl>mrtg                       \
809         perl>mod_perl                   \
810         perl-Date-Calc>perl-Bit-Vector  \
811
812 %_dependency_whiteout_fc3               \
813         coreutils>pam                   \
814         nautilus>nautilus-cd-burner     \
815         aspell>aspell-en                \
816         kernel>initscripts              \
817         kernel-smp>initscripts          \
818         xorg-x11-libs>xorg-x11-Mesa-libGL \
819         openldap>cyrus-sasl-md5         \
820         openldap>cyrus-sasl             \
821         openjade>docbook-dtds           \
822         gtk+>gdk-pixbuf                 \
823         xorg-x11>xinitrc                \
824         gnome-python2>gnome-python2-bonobo \
825         httpd-suexec>httpd              \
826         xemacs-sumo>apel-xemacs         \
827         php>php-pear                    \
828         openoffice.org-libs>openoffice.org
829
830 %_dependency_whiteout                   \
831         libtermcap>bash                 \
832         modutils>vixie-cron             \
833         ypbind>yp-tools                 \
834         ghostscript-fonts>ghostscript   \
835         %{?_dependency_whiteout_fc3}    \
836         %{?_dependency_whiteout_fc2}    \
837         %{?_dependency_whiteout_fc1}    \
838         %{?_dependency_whiteout_9}      \
839         %{?_dependency_whiteout_8_0}    \
840         %{?_dependency_whiteout_7_2}    \
841         %{?_dependency_whiteout_7_1}    \
842         %{?_dependency_whiteout_7_0}    \
843         %{?_dependency_whiteout_6_2}    \
844         %{?_dependency_whiteout_6_1}    \
845         %{?_dependency_whiteout_5_2}    \
846         %{nil}
847
848 #
849 # Default headerSprintf() output format string for rpm -qa
850 #
851 # XXX   Note: escaped %% for use in headerSprintf()
852 %_query_all_fmt         %%{name}-%%{version}-%%{release}
853
854 #
855 # Default path to the file used for transaction fcmtl lock.
856 #
857 # The previous, FHS clompliant, name was /var/lock/run/transaction,
858 # but the transaction lock needs to be per-database, not global, for
859 # some rpmdb operations.
860 #
861 # XXX Note: the file name is chosesn as __db.000 to expedite
862 # support issues, many users are doing "rm -f /var/lib/rpm/__db*"
863 # these days.
864 %_rpmlock_path  %{_dbpath}/__db.000
865
866 #==============================================================================
867 # ---- Cache configuration macros.
868 #       Macro(s) used to configure the universe of headers used to
869 #       solve dependencies using rpmcache(8).
870 #
871 #       Note: These values are specific to my machine, and most certainly
872 #       are incorrect for any non-redhat.com machine. The macros are
873 #       included here only to document the macro names and usage.
874 %_bhpath        file://localhost/mnt/dist
875 %_bhcoll        @(7.3|7.2|7.1|7.1sbe|7.1k|7.0|7.01j|7.0j|7.0sbe|7.0tc|6.2|6.2ha|6.2ee|6.1|6.0|5.2|5.1|5.0)
876 %_bhN           @(SRPMS|i386|alpha|sparc|s390|ia64)
877 %_bhVR          RedHat
878 %_bhA           RPMS
879
880 #       The cache database directory.
881 %_cache_dbpath          /var/spool/up2date/cache
882
883 #==============================================================================
884 # ---- per-platform macros.
885 #       Macros that are specific to an individual platform. The values here
886 #       will be used if the per-platform macro file does not exist..
887 #
888 %_arch                  @RPMCANONARCH@
889 %_build_arch            @RPMCANONARCH@
890 %_vendor                @RPMCANONVENDOR@
891 %_os                    @RPMCANONOS@
892 %_gnu                   -gnu
893 %_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
894
895 #
896 # Define a generic value for optflags. Normally overridden by per-target macros.
897 %optflags               -O2
898
899 #
900 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
901 %__arch_install_post    %{nil}
902 %__os_install_post      %{___build_post}
903
904 #==============================================================================
905 # ---- Scriptlet template templates.
906 #       Global defaults used for building scriptlet templates.
907 #
908
909 %___build_shell         %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
910 %___build_args          -e
911 %___build_cmd           %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
912 %___build_pre   \
913   RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
914   RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
915   RPM_OPT_FLAGS=\"%{optflags}\"\
916   RPM_ARCH=\"%{_arch}\"\
917   RPM_OS=\"%{_os}\"\
918   export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
919   RPM_DOC_DIR=\"%{_docdir}\"\
920   export RPM_DOC_DIR\
921   RPM_PACKAGE_NAME=\"%{name}\"\
922   RPM_PACKAGE_VERSION=\"%{version}\"\
923   RPM_PACKAGE_RELEASE=\"%{release}\"\
924   export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
925   %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
926   export RPM_BUILD_ROOT}\
927   %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
928   export CLASSPATH}\
929   \
930   %{verbose:set -x}%{!verbose:exec > /dev/null}\
931   umask 022\
932   cd %{u2p:%{_builddir}}\
933
934
935 #%___build_body         %{nil}
936 %___build_post          exit 0
937
938 %___build_template      #!%{___build_shell}\
939 %{___build_pre}\
940 %{nil}
941
942 #%{___build_body}\
943 #%{___build_post}\
944 #%{nil}
945
946 #==============================================================================
947 # ---- Scriptlet templates.
948 #       Macro(s) that expand to a command and script that is executed.
949 #       CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
950 #
951 %__spec_prep_shell      %{___build_shell}
952 %__spec_prep_args       %{___build_args}
953 %__spec_prep_cmd        %{___build_cmd}
954 %__spec_prep_pre        %{___build_pre}
955 %__spec_prep_body       %{___build_body}
956 %__spec_prep_post       %{___build_post}
957 %__spec_prep_template   #!%{__spec_prep_shell}\
958 %{__spec_prep_pre}\
959 %{nil}
960
961 #%{__spec_prep_body}\
962 #%{__spec_prep_post}\
963 #%{nil}
964
965 %__spec_build_shell     %{___build_shell}
966 %__spec_build_args      %{___build_args}
967 %__spec_build_cmd       %{___build_cmd}
968 %__spec_build_pre       %{___build_pre}
969 %__spec_build_body      %{___build_body}
970 %__spec_build_post      %{___build_post}
971 %__spec_build_template  #!%{__spec_build_shell}\
972 %{__spec_build_pre}\
973 %{nil}
974
975 #%{__spec_build_body}\
976 #%{__spec_build_post}\
977 #%{nil}
978
979 %__spec_install_shell   %{___build_shell}
980 %__spec_install_args    %{___build_args}
981 %__spec_install_cmd     %{___build_cmd}
982 %__spec_install_pre     %{___build_pre}
983 %__spec_install_body    %{___build_body}
984 %__spec_install_post\
985 %{?__debug_package:%{__debug_install_post}}\
986 %{__arch_install_post}\
987 %{__os_install_post}\
988 %{nil}
989 %__spec_install_template        #!%{__spec_install_shell}\
990 %{__spec_install_pre}\
991 %{nil}
992
993 #%{__spec_install_body}\
994 #%{__spec_install_post}\
995 #%{nil}
996
997 %__spec_check_shell     %{___build_shell}
998 %__spec_check_args      %{___build_args}
999 %__spec_check_cmd       %{___build_cmd}
1000 %__spec_check_pre       %{___build_pre}
1001 %__spec_check_body      %{___build_body}
1002 %__spec_check_post      %{___build_post}
1003 %__spec_check_template  #!%{__spec_check_shell}\
1004 %{__spec_check_pre}\
1005 %{nil}
1006
1007 #%{__spec_check_body}\
1008 #%{__spec_check_post}\
1009 #%{nil}
1010
1011 #%__spec_autodep_shell  %{___build_shell}
1012 #%__spec_autodep_args   %{___build_args}
1013 #%__spec_autodep_cmd    %{___build_cmd}
1014 #%__spec_autodep_pre    %{___build_pre}
1015 #%__spec_autodep_body   %{___build_body}
1016 #%__spec_autodep_post   %{___build_post}
1017 #%__spec_autodep_template       #!%{__spec_autodep_shell}\
1018 #%{__spec_autodep_pre}\
1019 #%{nil}
1020
1021 #%{__spec_autodep_body}\
1022 #%{__spec_autodep_post}\
1023 #%{nil}
1024
1025 %__spec_clean_shell     %{___build_shell}
1026 %__spec_clean_args      %{___build_args}
1027 %__spec_clean_cmd       %{___build_cmd}
1028 %__spec_clean_pre       %{___build_pre}
1029 %__spec_clean_body      %{___build_body}
1030 %__spec_clean_post      %{___build_post}
1031 %__spec_clean_template  #!%{__spec_clean_shell}\
1032 %{__spec_clean_pre}\
1033 %{nil}
1034
1035 #%{__spec_clean_body}\
1036 #%{__spec_clean_post}\
1037 #%{nil}
1038
1039 %__spec_rmbuild_shell   %{___build_shell}
1040 %__spec_rmbuild_args    %{___build_args}
1041 %__spec_rmbuild_cmd     %{___build_cmd}
1042 %__spec_rmbuild_pre     %{___build_pre}
1043 %__spec_rmbuild_body    %{___build_body}
1044 %__spec_rmbuild_post    %{___build_post}
1045 %__spec_rmbuild_template        #!%{__spec_rmbuild_shell}\
1046 %{__spec_rmbuild_pre}\
1047 %{nil}
1048
1049 #%{__spec_rmbuild_body}\
1050 #%{__spec_rmbuild_post}\
1051 #%{nil}
1052
1053 # XXX We don't expand pre/post install scriptlets (yet).
1054 #%__spec_pre_pre                %{nil}
1055 #%__spec_pre_post               %{nil}
1056 #%__spec_post_pre               %{nil}
1057 #%__spec_post_post              %{nil}
1058 #%__spec_preun_pre              %{nil}
1059 #%__spec_preun_post             %{nil}
1060 #%__spec_postun_pre             %{nil}
1061 #%__spec_postun_post            %{nil}
1062 #%__spec_triggerpostun_pre      %{nil}
1063 #%__spec_triggerpostun_post     %{nil}
1064 #%__spec_triggerun_pre          %{nil}
1065 #%__spec_triggerun_post         %{nil}
1066 #%__spec_triggerin_pre          %{nil}
1067 #%__spec_triggerin_post         %{nil}
1068
1069 #==============================================================================
1070 # ---- configure macros.
1071 #       Macro(s) slavishly copied from autoconf's config.status.
1072 #
1073 %_prefix                @prefix@
1074 %_exec_prefix           %{_prefix}
1075 %_bindir                %{_exec_prefix}/bin
1076 %_sbindir               %{_exec_prefix}/sbin
1077 %_libexecdir            %{_exec_prefix}/libexec
1078 %_datadir               %{_prefix}/share
1079 %_sysconfdir            %{_prefix}/etc
1080 %_sharedstatedir        %{_prefix}/com
1081 %_localstatedir         %{_prefix}/var
1082 %_lib                   lib
1083 %_libdir                %{_exec_prefix}/%{_lib}
1084 %_includedir            %{_prefix}/include
1085 %_oldincludedir         /usr/include
1086 %_infodir               %{_prefix}/info
1087 %_mandir                %{_prefix}/man
1088
1089 #==============================================================================
1090 # ---- config.guess platform macros.
1091 #       Macro(s) similar to the tokens used by configure.
1092 #
1093 %_build                 %{_host}
1094 %_build_alias           %{_host_alias}
1095 %_build_cpu             %{_host_cpu}
1096 %_build_vendor          %{_host_vendor}
1097 %_build_os              %{_host_os}
1098 %_host                  @host@
1099 %_host_alias            @host_alias@%{nil}
1100 %_host_cpu              @host_cpu@
1101 %_host_vendor           @host_vendor@
1102 %_host_os               @host_os@
1103 %_target                %{_host}
1104 %_target_alias          %{_host_alias}
1105 %_target_cpu            %{_host_cpu}
1106 %_target_vendor         %{_host_vendor}
1107 %_target_os             %{_host_os}
1108
1109 #==============================================================================
1110 # ---- specfile macros.
1111 #       Macro(s) here can be used reliably for reproducible builds.
1112 #       (Note: Above is the goal, below are the macros under development)
1113 #
1114 # The configure macro does the following:
1115 #       optionally change to a subdirectory (not implemented).
1116 #       attempt to update config.guess and config.sub.
1117 #       run configure with correct prefix, platform, and CFLAGS.
1118 #       optionally restore current directory (not implemented).
1119 # The configure macro should be invoked as %configure (rather than %{configure})
1120 # because the rest of the arguments will be expanded using %*.
1121 #
1122 # This is the version of %configure used through rpm-3.0.4.
1123 #%configure     \
1124 #  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
1125 #  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
1126 #
1127 #------------------------------------------------------------------------------
1128 # This is an improved version of %configure (from PLD team).
1129 %configure \
1130   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1131   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1132   FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1133   ./configure --host=%{_host} --build=%{_build} \\\
1134         --target=%{_target_platform} \\\
1135         --program-prefix=%{?_program_prefix} \\\
1136         --prefix=%{_prefix} \\\
1137         --exec-prefix=%{_exec_prefix} \\\
1138         --bindir=%{_bindir} \\\
1139         --sbindir=%{_sbindir} \\\
1140         --sysconfdir=%{_sysconfdir} \\\
1141         --datadir=%{_datadir} \\\
1142         --includedir=%{_includedir} \\\
1143         --libdir=%{_libdir} \\\
1144         --libexecdir=%{_libexecdir} \\\
1145         --localstatedir=%{_localstatedir} \\\
1146         --sharedstatedir=%{_sharedstatedir} \\\
1147         --mandir=%{_mandir} \\\
1148         --infodir=%{_infodir}
1149
1150 #------------------------------------------------------------------------------
1151 # The make install analogue of %configure:
1152 %makeinstall \
1153   make \\\
1154         prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1155         exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1156         bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1157         sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1158         sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1159         datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1160         includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1161         libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1162         libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1163         localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1164         sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1165         mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1166         infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1167   install
1168
1169 #------------------------------------------------------------------------------
1170 # The GNUconfigure macro does the following:
1171 #       update config.guess and config.sub.
1172 #       regenerate all autoconf/automake files
1173 #       optionally change to a directory (make the directory if requested).
1174 #       run configure with correct prefix, platform, and CFLAGS.
1175 #       optionally restore current directory.
1176 #
1177 # Based on autogen.sh from GNOME and orginal GNUconfigure
1178 #
1179 %GNUconfigure(MCs:)      \
1180   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1181   LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
1182   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
1183   dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
1184     for coin in `echo ${dirs}` \
1185 do \
1186   dr=`dirname ${coin}`; \
1187 if test -f ${dr}/NO-AUTO-GEN; then \
1188  : \
1189 else \
1190      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1191     ( cd ${dr}; \
1192       aclocalinclude="${ACLOCAL_FLAGS}"; \
1193       for k in ${macrodirs}; do \
1194         if test -d ${k}; then \
1195           aclocalinclude="${aclocalinclude} -I ${k}"; \
1196         ##else \
1197         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
1198         fi \
1199       done \
1200       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
1201         if grep "sed.*POTFILES" configure.in >/dev/null; then \
1202           : do nothing -- we still have an old unmodified configure.in \
1203         else \
1204           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1205           echo "no" | gettextize --force --copy; \
1206           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1207         fi \
1208       fi \
1209       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
1210         %{__libtoolize} --force --copy; \
1211       fi \
1212       aclocal ${aclocalinclude}; \
1213       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
1214         %{__autoheader}; \
1215       fi \
1216       echo "Running automake --gnu ${am_opt} ..."; \
1217       %{__automake} --add-missing --gnu ${am_opt}; \
1218       %{__autoconf}; \
1219     ); \
1220   fi \
1221 done \
1222   %{-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} %* ; \
1223   %{-C:cd ${_mydir}; unset _mydir}
1224
1225 #------------------------------------------------------------------------------
1226 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1227 #
1228 # For example, these can be used as (from ImageMagick.spec from PLD site)
1229 #       [...]
1230 #       BuildPrereq: perl
1231 #       [...]
1232 #       %package perl
1233 #       Summary: libraries and modules for access to ImageMagick from perl
1234 #       Group: Development/Languages/Perl
1235 #       Requires: %{name} = %{version}
1236 #       %requires_eq    perl
1237 #       [...]
1238 #       %install
1239 #       rm -fr $RPM_BUILD_ROOT
1240 #       install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1241 #       [...]
1242 #       %files perl
1243 #       %defattr(644,root,root,755)
1244 #       %{perl_sitearch}/Image
1245 #       %dir %{perl_sitearch}/auto/Image
1246 #
1247 %requires_eq()  %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
1248 %perl_sitearch  %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1249 %perl_sitelib   %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1250 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1251 %perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1252 %perl_archlib   %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1253 %perl_privlib   %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1254
1255 #------------------------------------------------------------------------------
1256 # arch macro for all Intel i?86 compatibile processors
1257 #  (Note: This macro (and it's analogues) will probably be obsoleted when
1258 #   rpm can use regular expressions against target platforms in macro
1259 #   conditionals.
1260 #
1261 %ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
1262
1263 #------------------------------------------------------------------------
1264 # Use in %install to generate locale specific file lists. For example,
1265 #
1266 # %install
1267 # ...
1268 # %find_lang %{name}
1269 # ...
1270 # %files -f %{name}.lang
1271 #
1272 %find_lang      @RPMCONFIGDIR@/find-lang.sh %{buildroot}
1273
1274 # \endverbatim
1275 #*/