bbdd733e900e095a01db5a81264fadd2aa5fc105
[platform/upstream/rpm.git] / macros.in
1 #/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
2 # \verbatim
3 #
4 # $Id: macros.in,v 1.126 2002/11/09 19:25:14 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 # ---- Required rpmrc macros.
91 #       Macros that used to be initialized as a side effect of rpmrc parsing.
92 #       These are the default values that can be overridden by other
93 #       (e.g. per-platform, per-system, per-packager, per-package) macros.
94 #
95 #       The directory where sources/patches will be unpacked and built.
96 %_builddir              %{_topdir}/BUILD
97
98 #       The interpreter used for build scriptlets.
99 %_buildshell            /bin/sh
100
101 #       The path to the bzip2 executable (legacy, use %{__bzip2} instead).
102 %_bzip2bin              %{__bzip2}
103
104 #       The location of the rpm database file(s).
105 %_dbpath                %{_var}/lib/rpm
106
107 #       The location of the rpm database file(s) after "rpm --rebuilddb".
108 %_dbpath_rebuild        %{_dbpath}
109
110 #       Path to script that creates debug symbols in a /usr/lib/debug
111 #       shadow tree.
112 %__debug_install_post   \
113    @RPMCONFIGDIR@/find-debuginfo.sh \
114 %{nil}
115
116 #       Template for debug information sub-package.
117 %debug_package \
118 %global __debug_package 1\
119 %package debug \
120 Summary: Debug information for package %{name} \
121 Group: Development/Debug \
122 %description debug \
123 This package provides debug information for package %{name}. \
124 Debug information is useful when developing applications that use this \
125 package or when debugging this package. \
126 %files debug -f debugfiles.list \
127 %defattr(-,root,root)  \
128 %{nil}
129
130 %_defaultdocdir         %{_usr}/doc
131
132 #       Path to scripts to autogenerate package dependencies.
133 %__find_provides        @FINDPROVIDES@
134 %__find_requires        @FINDREQUIRES@
135 #%__find_prereq         ???
136 #%__find_conflicts      ???
137 #%__find_obsoletes      ???
138
139 %__file_z_n             %{__file} -z -n -m @RPMCONFIGDIR@/magic
140 %__perl_provides        @RPMCONFIGDIR@/perl.prov
141 %__perl_requires        @RPMCONFIGDIR@/perl.req
142
143 #
144 # fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
145 # These macros are necessary only for legacy compatibility, and have moved
146 # to per-platform macro configuration (i.e. @RPMCONFIGDIR@/<arch>-<os>/macros)
147 #%__id_u                @__ID_U@
148 #%__chown_Rhf           @__CHOWN_RHF@
149 #%__chgrp_Rhf           @__CHGRP_RHF@
150 #%_fixowner             [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
151 #%_fixgroup             [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
152 #%_fixperms             %{__chmod} -Rf @FIXPERMS@
153 #
154
155 #       The path to the gzip executable (legacy, use %{__gzip} instead).
156 %_gzipbin               %{__gzip}
157
158 #       The number of changelog entries kept when installing (legacy, unused in
159 #       rpm-4.0.1 and later).
160 %_instchangelog         5
161
162 #       The path to the pgp executable (legacy, use %{__pgp} instead).
163 %_pgpbin                %{__pgp}
164
165 #       The directory where newly built binary packages will be written.
166 %_rpmdir                %{_topdir}/RPMS
167
168 #       A template used to generate the output binary package file name
169 #       (legacy).
170 %_rpmfilename           %{_build_name_fmt}
171
172 #       The default signature type.
173 %_signature             none
174
175 #       The directory where sources/patches from a source package will be
176 #       installed. This is also where sources/patches are found when building.
177 %_sourcedir             %{_topdir}/SOURCES
178
179 #       The directory where the spec file from a source package will be
180 #       installed.
181 %_specdir               %{_topdir}/SPECS
182
183 #       The directory where newly built source packages will be written.
184 %_srcrpmdir             %{_topdir}/SRPMS
185
186 #       Directory where temporaray files can be created.
187 %_tmppath               %{_var}/tmp
188
189 #       Path to top of build area.
190 %_topdir                %{_usrsrc}/redhat
191
192 #       The path to the unzip executable (legacy, use %{__unzip} instead).
193 %_unzipbin              %{__unzip}
194
195 #==============================================================================
196 # ---- Optional rpmrc macros.
197 #       Macros that are initialized as a side effect of rpmrc and/or spec
198 #       file parsing.
199 #
200 #       Configurable build root path, same as BuildRoot: in a specfile.
201 #       (Note: the configured macro value will override the spec file value).
202 #
203 #%buildroot
204
205 #       The sub-directory (relative to %{_builddir}) where sources are compiled.
206 #       This macro is set after processing %setup, either explicitly from the
207 #       value given to -n or the default name-version.
208 #
209 #%buildsubdir
210
211 #       Configurable distribution information, same as Distribution: tag in a
212 #       specfile.
213 #
214 #%distribution
215
216 #       Configurable distribution URL, same as DistURL: tag in a specfile.
217 #       The URL will be used to supply reliable information to tools like
218 #       rpmfind.
219 #
220 # Note: You should not configure with disturl (or build packages with
221 # the DistURL: tag) unless you are willing to supply content in a
222 # yet-to-be-determined format at the URL specified.
223 #
224 #%disturl
225
226 #       Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
227 #       marked as %doc should be installed.
228 #%_excludedocs
229
230 #       The port and machine name of a FTP proxy host running TIS firewall.
231 #
232 #%_ftpport
233 #%_ftpproxy
234
235 #       The signature to use and the location of configuration files for
236 #       signing packages with GNU gpg.
237 #
238 #%_gpg_name
239 #%_gpg_path
240
241 #       The port and machine name of an HTTP proxy host.
242 #
243 #%_httpport
244 #%_httpproxy
245
246 #       The PATH put into the environment before running %pre/%post et al.
247 #
248 %_install_script_path   /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
249
250 #       A colon separated list of desired locales to be installed;
251 #       "all" means install all locale specific files.
252 #       
253 %_install_langs all
254
255 #       The value of CLASSPATH in build scriptlets (iff configured).
256 #       
257 #%_javaclasspath        all
258
259 #       Import packaging conventions from jpackage.org (prefixed with _
260 #       to avoid name collisions).
261 #       
262 %_javadir      %{_datadir}/java
263 %_javadocdir   %{_datadir}/javadoc
264
265 #
266 #       Deprecated.
267 #
268 #%_langpatt
269
270 #       A colon separated list of paths where files should *not* be installed.
271 #       Usually, these are network file system mount points.
272 #
273 #%_netsharedpath
274
275 #       (experimental)
276 #       The type of pattern match used on rpmdb iterator selectors:
277 #       "default"       simple glob-like regex, periods will be escaped,
278 #                       splats will have period prepended, full "^...$" match
279 #                       required. Also, file path tags will use glob(7).
280 #       "strcmp"        compare strings
281 #       "regex"         regex(7) patterns using regcomp(3)/regexec(3)
282 #       "glob"          glob(7) patterns using fnmatch(3)
283 #
284 %_query_selector_match  default
285
286 #       Configurable packager information, same as Packager: in a specfile.
287 #
288 #%packager
289
290 #       Compression type and level for source/binary package payloads.
291 #               "w9.gzdio"      gzip level 9 (default).
292 #               "w9.bzdio"      bzip2 level 9.
293 #
294 #%_source_payload       w9.gzdio
295 #%_binary_payload       w9.gzdio
296
297 #       The signature to use and the location of configuration files for
298 #       signing packages with PGP.
299 #
300 #%_pgp_name
301 #%_pgp_path
302
303 #       Configurable vendor information, same as Vendor: in a specfile.
304 #
305 #%vendor
306
307 #==============================================================================
308 # ---- Build configuration macros.
309 #
310 # Package version macro.
311 #       The type of package to produce, for compatibility with legacy
312 #       versions of rpm.
313 #
314 # This is an rpm version, e.g. 30005 means to produce packaging compatible
315 # with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
316 # version before rpm-3.0.5) are not supported. The only incompatible change
317 # in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
318 # rpmlead, so there's little need to use any value greater than 30005.
319 #
320 %_package_version       30005
321
322 #
323 # Script gets packaged file list on input and buildroot as first parameter.
324 # Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not packaged.
325 #
326 # Note: Disable (by commenting out) for legacy compatibility.
327 %__check_files         @RPMCONFIGDIR@/check-files %{buildroot}
328
329 #
330 # Should unpackaged files in a build root terminate a build?
331 #
332 # Note: The default value should be 0 for legacy compatibility.
333 %_unpackaged_files_terminate_build      1
334
335 #
336 # Should missing %doc files in the build directory terminate a build?
337 #
338 # Note: The default value should be 0 for legacy compatibility.
339 %_missing_doc_files_terminate_build     1
340
341 #==============================================================================
342 # ---- Database configuration macros.
343 #       Macros used to configure Berkley db parameters.
344 #
345 # rpmdb macro configuration values are a colon (or white space) separated
346 # list of tokens, with an optional '!' negation to explicitly disable bit
347 # values, or a "=value" if a parameter. A per-tag value is used (e.g.
348 # %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
349 # (e.g. %_dbi_config). The configuration is also conditioned on the
350 # existence of an internal %{_rpmdb_rebuild} switch to permit changing
351 # the configuration while rebuilding an rpmdb database.
352 #
353 # The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
354 # see that for the latest gory details. Note carefully that, unless you
355 # are writing an rpm installer, you shouldn't have to touch *any* of these
356 # parameters.
357 #
358 # Here's a short list of the tokens, with a guess of whether the option is
359 # useful:
360 #       (nothing)       currently used in rpm, known to work.
361 #       "+++"           under development, will be supported in rpm eventually.
362 #       "???"           I have no clue, you're mostly on your own.
363 #
364 # If you do find yourself inclined to fiddle, here's what I see (shrug):
365 # 1) Only the value of mp_size has any serious impact on overall performance,
366 #    and you will need ~256Kb to handle a typical machine install.
367 # 2) Only the Packages hash, because of the size of the values (i.e. headers),
368 #    will ever need tuning. Diddle the pagesize if you're interested, although
369 #    I believe that you will find pagesize=512 "best".
370 # 3) Adding nofsync increases speed, but risks total data loss. Fiddle shared
371 #    and/or mp_size instead.
372 # 4) btree is faster than hash, but would require some painful rpm release
373 #    engineering to convert everbody's databases to btree, not gonna happen
374 #    soon.
375 #
376 # See the db3-devel package, or http://www.sleepycat.com for Berkeley db-3.x
377 # documentation.
378 #
379 #   token       works?  Berkeley db flag or value
380 #==================================================
381 #---------------------- DBENV->open parameters and tunable values:
382 #   mmapsize=16Mb       DBENV->set_mp_mmapsize
383 #   cachesize=1Mb       DBENV->set_cachesize, DB->set_cachesize
384 #---------------------- DBENV->open and DB->open common bits:
385 #   create              DB_CREATE
386 #   thread      ???     DB_THREAD       (useless w/o posix mutexes on linux)
387 #---------------------- DBENV->open bits:
388 #   joinenv             DB_JOIN_ENV
389 #   mpool               DB_INIT_MPOOL
390 #   cdb         +++     DB_INIT_CDB
391 #   txn         ???     DB_INIT_TXN
392 #   log         ???     DB_INIT_LOG
393 #   lock        ???     DB_INIT_LOCK
394 #   recover     ???     DB_RECOVER
395 #   recover_fatal ???   DB_RECOVER_FATAL
396 #   use_environ ???     DB_USE_ENVIRON
397 #   use_environ_root ??? DB_USE_ENVIRON_ROOT
398 #   private     +++     DB_PRIVATE
399 #   lockdown    ???     DB_LOCKDOWN
400 #   shared      +++     DB_SYSTEM_MEM
401 #---------------------- DB->open parameters and tunable values:
402 #   pagesize=512 +++    DB->set_pagesize
403 #---------------------- DB->open bits:
404 #   excl        ???     DB_EXCL
405 #   nommap      ???     DB_NOMMAP
406 #   rdonly              DB_RDONLY
407 #---------------------- DB->open types:
408 #   btree               DB_BTREE
409 #   hash                DB_HASH
410 #   recno       ???     DB_RECNO
411 #   queue       ???     DB_QUEUE
412 #   unknown     +++     DB_UNKNOWN
413 #---------------------- DB->set_flags bits:
414 #   bt_dup      +++     (btree only) DB_DUP
415 #   bt_dupsort  +++     (btree only) DB_DUPSORT
416 #   ht_dup      +++     (hash only) DB_DUP
417 #   ht_dupsort  +++     (hash only) DB_DUPSORT
418 #----------------------- rpmdb specific configuration:
419 #   usedbenv            (always on) Use db3 environment?
420 #   verify              (db3 only) Verify Packages db after RW close?
421 #   lockdbfd            (always on for Packages) Use fcntl(2) locking ?
422 #   nofsync             Disable fsync(2) call performed after db3 writes?
423 #   temporary           Unlink file when closing.
424 #
425
426 # XXX Use transactions and logs for rpmdb durability (no clue yet):
427 #%__dbi_other                   create joinenv mpool txn log \
428 #                               mp_mmapsize=8Mb mp_size=512Kb
429
430 # Use a CDB database model for concurrent access.
431 %__dbi_cdb                      create cdb mpool mp_mmapsize=16Mb mp_size=1Mb
432
433 %__dbi_other                    %{?_tmppath:tmpdir=%{_tmppath}} %{?__dbi_cdb}
434
435 # Note: adding nofsync here speeds up --rebuilddb a lot.
436 %__dbi_rebuild                  nofsync !log !txn !cdb
437 %__dbi_transient                %{__dbi_rebuild} temporary private
438 %__dbi_perms                    perms=0644
439
440 #
441 #--- Hash database configuration
442 %__dbi_htconfig \
443   hash          \
444   %{__dbi_other}\
445   %{__dbi_perms}\
446 %{nil}
447
448 %__dbi_htconfig_current         %{__dbi_htconfig}
449 %__dbi_htconfig_rebuild         %{__dbi_htconfig} %{__dbi_rebuild}
450
451 %_dbi_htconfig          \
452   %{?_rpmdb_rebuild:%{__dbi_htconfig_rebuild}}\
453   %{!?_rpmdb_rebuild:%{__dbi_htconfig_current}}\
454 %{nil}
455
456 #
457 #--- Btree database configuration
458 %__dbi_btconfig \
459   btree         \
460   %{__dbi_other}\
461   %{__dbi_perms}\
462 %{nil}
463
464 %__dbi_btconfig_current         %{__dbi_btconfig}
465 %__dbi_btconfig_rebuild         %{__dbi_btconfig} %{__dbi_rebuild}
466
467 %_dbi_btconfig          \
468   %{?_rpmdb_rebuild:%{__dbi_btconfig_rebuild}}\
469   %{!?_rpmdb_rebuild:%{__dbi_btconfig_current}}\
470 %{nil}
471
472 # The list of tags for which indices will be built.
473 %_dbi_tags      Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys
474
475 # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
476 %_dbi_config_Packages           %{_dbi_htconfig} lockdbfd
477
478 # "Depends" is a per-transaction cache of known dependency resolutions.
479 %_dbi_config_Depends            %{_dbi_htconfig} temporary private
480
481 %_dbi_config_Dirnames           %{_dbi_btconfig}
482 %_dbi_config_Requireversion     %{_dbi_btconfig}
483 %_dbi_config_Provideversion     %{_dbi_btconfig}
484 %_dbi_config_Installtid         %{_dbi_btconfig}
485 %_dbi_config_Removetid          %{_dbi_btconfig}
486
487 # XXX legacy configuration.
488 # Choose db interface:
489 #       3       native db3 interface.
490 #
491 # There are two macros so that --rebuilddb can convert db1 -> db3.
492 #
493 %_dbapi                 3
494 %_dbapi_rebuild         3
495
496 %_dbi_config    %{_dbi_htconfig}
497
498 #==============================================================================
499 # ---- GPG/PGP/PGP5 signature macros.
500 #       Macro(s) to hold the arguments passed to GPG/PGP for package
501 #       signing and verification.
502 #
503 %__gpg_check_password_cmd       %{__gpg} \
504         gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
505 %__pgp_check_password_cmd       %{__pgp} \
506         pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
507 %__pgp5_check_password_cmd      %{__pgp} \
508         pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f
509
510 %__gpg_sign_cmd                 %{__gpg} \
511         gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
512         -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
513 %__pgp_sign_cmd                 %{__pgp} \
514         pgp +batchmode=on +verbose=0 +armor=off \
515         "+myname=%{_pgp_name}" -sb %{__plaintext_filename} %{__signature_filename}
516 %__pgp5_sign_cmd                %{__pgp} \
517         pgps +batchmode=on +verbose=0 +armor=off \
518         "+myname=%{_pgp_name}" -b %{__plaintext_filename} -o %{__signature_filename}
519
520 # XXX rpm-4.1 verifies signatures using beecrypt.
521 #%__gpg_verify_cmd              %{__gpg} \
522 #       gpg --batch --no-verbose --verify --no-secmem-warning \
523 #       %{__signature_filename} %{__plaintext_filename}
524 #%__pgp_verify_cmd              %{__pgp} \
525 #       pgp +batchmode=on +verbose=0 \
526 #       %{__signature_filename} %{__plaintext_filename}
527 #%__pgp5_verify_cmd             %{__pgp} \
528 #       pgpv +batchmode=on +verbose=0 \
529 #       +OutputInformationFD=1 +OutputWarningFD=1 \
530 #       -o %{__signature_filename} %{__plaintext_filename}
531
532 #
533 # XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
534 #       Normally this macro is defined in /etc/rpm/macros.prelink, installed
535 #       with the prelink package. If the macro is undefined, then prelinked
536 #       shared libraries contents are MD5 digest verified (as usual), rather
537 #       than MD5 verifying the output of the prelink undo helper.
538 #
539 #       Note: The 2nd token is used as argv[0] and "library" is a
540 #       placeholder that will be deleted and replaced with the appropriate
541 #       library file path.
542 #%__prelink_undo_cmd     /usr/sbin/prelink prelink -y library
543
544 #==============================================================================
545 # ---- Transaction macros.
546 #       Macro(s) used to parameterize transactions.
547 #
548 #       The output binary package file name template used when building
549 #       binary packages.
550 #
551 # XXX   Note: escaped %% for use in headerSprintf()
552 %_build_name_fmt        %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
553
554 #       The path to the dependency universe database. The default value
555 #       is the rpmdb-redhat location. The macro is usually defined in
556 #       /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
557 #%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat
558
559 #       The path to the dependency universe packages. This should
560 #       be a path to the packages contained in the solve database.
561 #%_solve_pkgsdir        /mnt/redhat/test/latest-i386/RedHat/RPMS/
562
563 #       The output binary package file name template used when suggesting
564 #       binary packages that solve a dependency. The macro is usually defined
565 #       in /etc/rpm/macros.solve, installed with the rpmdb-redhat package.
566 #
567 # XXX   Note: escaped %% for use in headerSprintf()
568 #%_solve_name_fmt       %{?_solve_pkgsdir}%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
569
570 #       The output binary package file name template used when repackaging
571 #       erased packages.
572 #
573 # XXX   Note: escaped %% for use in headerSprintf()
574 %_repackage_name_fmt    %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
575
576 #       The directory in which erased packages will be saved when using
577 #       the --repackage option.
578 %_repackage_dir         /var/spool/repackage
579
580 #       A path (i.e. URL) prefix that is pre-pended to %{_repackage_dir}.
581 %_repackage_root        %{nil}
582
583 #       If non-zero, all erasures will be automagically repackaged.
584 %_repackage_all_erasures        0
585
586 #       Verify digest/signature flags for various rpm modes:
587 #            1  --nohdrchk      if set, don't check rpmdb headers
588 #
589 #       The checking overhead is ~11ms per header for digests/signatures;
590 #       each header from the database is checked only when first encountered
591 #       for each database open.
592 #
593 #       Note: the %_vsflags_erase applies to --upgrade/--freshen modes as
594 #       well as --erase.
595 #
596 %__vsflags              0
597 %_vsflags_build         %{__vsflags}
598 %_vsflags_erase         %{__vsflags}
599 %_vsflags_install       %{__vsflags}
600 %_vsflags_query         %{__vsflags}
601 %_vsflags_rebuilddb     %{__vsflags}
602 %_vsflags_up2date       %{__vsflags}
603 %_vsflags_verify        %{__vsflags}
604
605 #       Relations between package names that cause dependency loops
606 #       with legacy packages that cannot be fixed. Relations are
607 #       specified as
608 #               p>q
609 #       where package p has a Requires: on something that package q Provides:
610 #
611 # XXX   Note: that there cannot be any whitespace within the string "p>q",
612 #       and that both p and q are package names (i.e. no version/release).
613 #
614 #%_dependency_whiteout_5_2              \
615 #       pam>pamconfig
616 #%_dependency_whiteout_6_1              \
617 #       pilot-link-devel>pilot-link
618 #%_dependency_whiteout_6_2              \
619 #       egcs-c++>libstdc++
620 %_dependency_whiteout_7_0               \
621         pango-gtkbeta-devel>pango-gtkbeta\
622         XFree86>Mesa                    \
623         compat-glibc>db2                \
624         compat-glibc>db1                \
625         pam>initscripts                 \
626         initscripts>sysklogd
627 %_dependency_whiteout_7_1               \
628         arts>kdelibs-sound
629 %_dependency_whiteout_7_2               \
630         libgnomeprint15>gnome-print     \
631         nautilus>nautilus-mozilla       \
632         tcl>postgresql-tcl
633 #%_dependency_whiteout_8_0              \
634 #       perl>perl-Parse-RecDescent      \
635 #       XFree86-libs>XFree86-Mesa-libGL \
636 #       perl>perl-Filter                \
637 #       perl>mrtg                       \
638 #       perl>mod_perl                   \
639 #       mysql>perl-DBD-MySQL            \
640 #       ghostscript>gimp-print          \
641 #       arts>kde2-compat                \
642 #       perl-Date-Calc>perl-Bit-Vector  \
643 #       glibc-debug>glibc-devel
644
645 %_dependency_whiteout                   \
646         libtermcap>bash                 \
647         modutils>vixie-cron             \
648         ypbind>yp-tools                 \
649         ghostscript-fonts>ghostscript   \
650         %{?_dependency_whiteout_8_0}    \
651         %{?_dependency_whiteout_7_2}    \
652         %{?_dependency_whiteout_7_1}    \
653         %{?_dependency_whiteout_7_0}    \
654         %{?_dependency_whiteout_6_2}    \
655         %{?_dependency_whiteout_6_1}    \
656         %{?_dependency_whiteout_5_2}    \
657         %{nil}
658
659
660 #==============================================================================
661 # ---- Cache configuration macros.
662 #       Macro(s) used to configure the universe of headers used to
663 #       solve dependencies using rpmcache(8).
664 #
665 #       Note: These values are specific to my machine, and most certainly
666 #       are incorrect for any non-redhat.com machine. The macros are
667 #       included here only to document the macro names and usage.
668 %_bhpath        file://localhost/mnt/dist
669 %_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)
670 %_bhN           @(SRPMS|i386|alpha|sparc|s390|ia64)
671 %_bhVR          RedHat
672 %_bhA           RPMS
673
674 #       The cache database directory.
675 %_cache_dbpath          /var/spool/up2date/cache
676
677 #==============================================================================
678 # ---- per-platform macros.
679 #       Macros that are specific to an individual platform. The values here
680 #       will be used if the per-platform macro file does not exist..
681 #
682 %_arch                  @RPMCANONARCH@
683 %_build_arch            @RPMCANONARCH@
684 %_vendor                @RPMCANONVENDOR@
685 %_os                    @RPMCANONOS@
686 %_gnu                   -gnu
687 %_target_platform       %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
688
689 #
690 # Define a generic value for optflags. Normally overridden by per-target macros.
691 %optflags               -O2
692
693 #
694 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
695 %__arch_install_post    %{nil}
696 %__os_install_post      %{___build_post}
697
698 #==============================================================================
699 # ---- Scriptlet template templates.
700 #       Global defaults used for building scriptlet templates.
701 #
702
703 %___build_shell         %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
704 %___build_args          -e
705 %___build_cmd           %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
706 %___build_pre   \
707   RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
708   RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
709   RPM_OPT_FLAGS=\"%{optflags}\"\
710   RPM_ARCH=\"%{_arch}\"\
711   RPM_OS=\"%{_os}\"\
712   export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
713   RPM_DOC_DIR=\"%{_docdir}\"\
714   export RPM_DOC_DIR\
715   RPM_PACKAGE_NAME=\"%{name}\"\
716   RPM_PACKAGE_VERSION=\"%{version}\"\
717   RPM_PACKAGE_RELEASE=\"%{release}\"\
718   export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
719   %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
720   export RPM_BUILD_ROOT}\
721   %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
722   export CLASSPATH}\
723   \
724   %{verbose:set -x}%{!verbose:exec > /dev/null}\
725   umask 022\
726   cd %{u2p:%{_builddir}}\
727
728
729 #%___build_body         %{nil}
730 %___build_post          exit 0
731
732 %___build_template      #!%{___build_shell}\
733 %{___build_pre}\
734 %{nil}
735
736 #%{___build_body}\
737 #%{___build_post}\
738 #%{nil}
739
740 #==============================================================================
741 # ---- Scriptlet templates.
742 #       Macro(s) that expand to a command and script that is executed.
743 #       CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
744 #
745 %__spec_prep_shell      %{___build_shell}
746 %__spec_prep_args       %{___build_args}
747 %__spec_prep_cmd        %{___build_cmd}
748 %__spec_prep_pre        %{___build_pre}
749 %__spec_prep_body       %{___build_body}
750 %__spec_prep_post       %{___build_post}
751 %__spec_prep_template   #!%{__spec_prep_shell}\
752 %{__spec_prep_pre}\
753 %{nil}
754
755 #%{__spec_prep_body}\
756 #%{__spec_prep_post}\
757 #%{nil}
758
759 %__spec_build_shell     %{___build_shell}
760 %__spec_build_args      %{___build_args}
761 %__spec_build_cmd       %{___build_cmd}
762 %__spec_build_pre       %{___build_pre}
763 %__spec_build_body      %{___build_body}
764 %__spec_build_post      %{___build_post}
765 %__spec_build_template  #!%{__spec_build_shell}\
766 %{__spec_build_pre}\
767 %{nil}
768
769 #%{__spec_build_body}\
770 #%{__spec_build_post}\
771 #%{nil}
772
773 %__spec_install_shell   %{___build_shell}
774 %__spec_install_args    %{___build_args}
775 %__spec_install_cmd     %{___build_cmd}
776 %__spec_install_pre     %{___build_pre}
777 %__spec_install_body    %{___build_body}
778 %__spec_install_post\
779 %{?__debug_package:%{__debug_install_post}}\
780 %{__arch_install_post}\
781 %{__os_install_post}\
782 %{nil}
783 %__spec_install_template        #!%{__spec_install_shell}\
784 %{__spec_install_pre}\
785 %{nil}
786
787 #%{__spec_install_body}\
788 #%{__spec_install_post}\
789 #%{nil}
790
791 #%__spec_autodep_shell  %{___build_shell}
792 #%__spec_autodep_args   %{___build_args}
793 #%__spec_autodep_cmd    %{___build_cmd}
794 #%__spec_autodep_pre    %{___build_pre}
795 #%__spec_autodep_body   %{___build_body}
796 #%__spec_autodep_post   %{___build_post}
797 #%__spec_autodep_template       #!%{__spec_autodep_shell}\
798 #%{__spec_autodep_pre}\
799 #%{nil}
800
801 #%{__spec_autodep_body}\
802 #%{__spec_autodep_post}\
803 #%{nil}
804
805 %__spec_clean_shell     %{___build_shell}
806 %__spec_clean_args      %{___build_args}
807 %__spec_clean_cmd       %{___build_cmd}
808 %__spec_clean_pre       %{___build_pre}
809 %__spec_clean_body      %{___build_body}
810 %__spec_clean_post      %{___build_post}
811 %__spec_clean_template  #!%{__spec_clean_shell}\
812 %{__spec_clean_pre}\
813 %{nil}
814
815 #%{__spec_clean_body}\
816 #%{__spec_clean_post}\
817 #%{nil}
818
819 %__spec_rmbuild_shell   %{___build_shell}
820 %__spec_rmbuild_args    %{___build_args}
821 %__spec_rmbuild_cmd     %{___build_cmd}
822 %__spec_rmbuild_pre     %{___build_pre}
823 %__spec_rmbuild_body    %{___build_body}
824 %__spec_rmbuild_post    %{___build_post}
825 %__spec_rmbuild_template        #!%{__spec_rmbuild_shell}\
826 %{__spec_rmbuild_pre}\
827 %{nil}
828
829 #%{__spec_rmbuild_body}\
830 #%{__spec_rmbuild_post}\
831 #%{nil}
832
833 # XXX We don't expand pre/post install scriptlets (yet).
834 #%__spec_pre_pre                %{nil}
835 #%__spec_pre_post               %{nil}
836 #%__spec_post_pre               %{nil}
837 #%__spec_post_post              %{nil}
838 #%__spec_preun_pre              %{nil}
839 #%__spec_preun_post             %{nil}
840 #%__spec_postun_pre             %{nil}
841 #%__spec_postun_post            %{nil}
842 #%__spec_triggerpostun_pre      %{nil}
843 #%__spec_triggerpostun_post     %{nil}
844 #%__spec_triggerun_pre          %{nil}
845 #%__spec_triggerun_post         %{nil}
846 #%__spec_triggerin_pre          %{nil}
847 #%__spec_triggerin_post         %{nil}
848
849 #==============================================================================
850 # ---- configure macros.
851 #       Macro(s) slavishly copied from autoconf's config.status.
852 #
853 %_prefix                @prefix@
854 %_exec_prefix           %{_prefix}
855 %_bindir                %{_exec_prefix}/bin
856 %_sbindir               %{_exec_prefix}/sbin
857 %_libexecdir            %{_exec_prefix}/libexec
858 %_datadir               %{_prefix}/share
859 %_sysconfdir            %{_prefix}/etc
860 %_sharedstatedir        %{_prefix}/com
861 %_localstatedir         %{_prefix}/var
862 %_lib                   lib
863 %_libdir                %{_exec_prefix}/%{_lib}
864 %_includedir            %{_prefix}/include
865 %_oldincludedir         /usr/include
866 %_infodir               %{_prefix}/info
867 %_mandir                %{_prefix}/man
868
869 #==============================================================================
870 # ---- config.guess platform macros.
871 #       Macro(s) similar to the tokens used by configure.
872 #
873 %_build                 %{_host}
874 %_build_alias           %{_host_alias}
875 %_build_cpu             %{_host_cpu}
876 %_build_vendor          %{_host_vendor}
877 %_build_os              %{_host_os}
878 %_host                  @host@
879 %_host_alias            @host_alias@%{nil}
880 %_host_cpu              @host_cpu@
881 %_host_vendor           @host_vendor@
882 %_host_os               @host_os@
883 %_target                %{_host}
884 %_target_alias          %{_host_alias}
885 %_target_cpu            %{_host_cpu}
886 %_target_vendor         %{_host_vendor}
887 %_target_os             %{_host_os}
888
889 #==============================================================================
890 # ---- specfile macros.
891 #       Macro(s) here can be used reliably for reproducible builds.
892 #       (Note: Above is the goal, below are the macros under development)
893 #
894 # The configure macro does the following:
895 #       optionally change to a subdirectory (not implemented).
896 #       attempt to update config.guess and config.sub.
897 #       run configure with correct prefix, platform, and CFLAGS.
898 #       optionally restore current directory (not implemented).
899 # The configure macro should be invoked as %configure (rather than %{configure})
900 # because the rest of the arguments will be expanded using %*.
901 #
902 # This is the version of %configure used through rpm-3.0.4.
903 #%configure     \
904 #  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
905 #  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
906 #
907 #------------------------------------------------------------------------------
908 # This is an improved version of %configure (from PLD team).
909 %configure \
910   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
911   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
912   FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
913   ./configure --host=%{_host} --build=%{_build} \\\
914         --target=%{_target_platform} \\\
915         --program-prefix=%{?_program_prefix} \\\
916         --prefix=%{_prefix} \\\
917         --exec-prefix=%{_exec_prefix} \\\
918         --bindir=%{_bindir} \\\
919         --sbindir=%{_sbindir} \\\
920         --sysconfdir=%{_sysconfdir} \\\
921         --datadir=%{_datadir} \\\
922         --includedir=%{_includedir} \\\
923         --libdir=%{_libdir} \\\
924         --libexecdir=%{_libexecdir} \\\
925         --localstatedir=%{_localstatedir} \\\
926         --sharedstatedir=%{_sharedstatedir} \\\
927         --mandir=%{_mandir} \\\
928         --infodir=%{_infodir}
929
930 #------------------------------------------------------------------------------
931 # The make install analogue of %configure:
932 %makeinstall \
933   make \\\
934         prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
935         exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
936         bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
937         sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
938         sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
939         datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
940         includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
941         libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
942         libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
943         localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
944         sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
945         mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
946         infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
947   install
948
949 #------------------------------------------------------------------------------
950 # The GNUconfigure macro does the following:
951 #       update config.guess and config.sub.
952 #       regenerate all autoconf/automake files
953 #       optionally change to a directory (make the directory if requested).
954 #       run configure with correct prefix, platform, and CFLAGS.
955 #       optionally restore current directory.
956 #
957 # Based on autogen.sh from GNOME and orginal GNUconfigure
958 #
959 %GNUconfigure(MCs:)      \
960   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
961   LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
962   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
963   dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
964     for coin in `echo ${dirs}` \
965 do \
966   dr=`dirname ${coin}`; \
967 if test -f ${dr}/NO-AUTO-GEN; then \
968  : \
969 else \
970      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
971     ( cd ${dr}; \
972       aclocalinclude="${ACLOCAL_FLAGS}"; \
973       for k in ${macrodirs}; do \
974         if test -d ${k}; then \
975           aclocalinclude="${aclocalinclude} -I ${k}"; \
976         ##else \
977         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
978         fi \
979       done \
980       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
981         if grep "sed.*POTFILES" configure.in >/dev/null; then \
982           : do nothing -- we still have an old unmodified configure.in \
983         else \
984           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
985           echo "no" | gettextize --force --copy; \
986           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
987         fi \
988       fi \
989       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
990         %{__libtoolize} --force --copy; \
991       fi \
992       aclocal ${aclocalinclude}; \
993       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
994         %{__autoheader}; \
995       fi \
996       echo "Running automake --gnu ${am_opt} ..."; \
997       %{__automake} --add-missing --gnu ${am_opt}; \
998       %{__autoconf}; \
999     ); \
1000   fi \
1001 done \
1002   %{-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} %* ; \
1003   %{-C:cd ${_mydir}; unset _mydir}
1004
1005 #------------------------------------------------------------------------------
1006 # Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1007 #
1008 # For example, these can be used as (from ImageMagick.spec from PLD site)
1009 #       [...]
1010 #       BuildPrereq: perl
1011 #       [...]
1012 #       %package perl
1013 #       Summary: libraries and modules for access to ImageMagick from perl
1014 #       Group: Development/Languages/Perl
1015 #       Requires: %{name} = %{version}
1016 #       %requires_eq    perl
1017 #       [...]
1018 #       %install
1019 #       rm -fr $RPM_BUILD_ROOT
1020 #       install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1021 #       [...]
1022 #       %files perl
1023 #       %defattr(644,root,root,755)
1024 #       %{perl_sitearch}/Image
1025 #       %dir %{perl_sitearch}/auto/Image
1026 #
1027 %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")
1028 %perl_sitearch  %(eval "`perl -V:installsitearch`"; echo $installsitearch)
1029 %perl_archlib   %(eval "`perl -V:installarchlib`"; echo $installarchlib)
1030
1031 #------------------------------------------------------------------------------
1032 # arch macro for all Intel i?86 compatibile processors
1033 #  (Note: This macro (and it's analogues) will probably be obsoleted when
1034 #   rpm can use regular expressions against target platforms in macro
1035 #   conditionals.
1036 #
1037 %ix86   i386 i486 i586 i686 athlon
1038
1039 #------------------------------------------------------------------------
1040 # Use in %install to generate locale specific file lists. For example,
1041 #
1042 # %install
1043 # ...
1044 # %find_lang %{name}
1045 # ...
1046 # %files -f %{name}.lang
1047 #
1048 %find_lang      @RPMCONFIGDIR@/find-lang.sh %{buildroot}
1049
1050 # \endverbatim
1051 #*/