RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [email protected]
  Module: rpm                              Date:   21-Aug-2009 21:17:32
  Branch: HEAD                             Handle: 2009082119173100

  Added files:
    rpm/macros              macros.rpmbuild.in selinux.in
  Modified files:
    rpm                     CHANGES Makefile.am configure.ac
    rpm/macros              .cvsignore java.in macros.in

  Log:
    - macros: split rpmbuild macros into /usr/lib/rpm/macros.rpmbuild.

  Summary:
    Revision    Changes     Path
    1.3088      +1  -0      rpm/CHANGES
    2.243       +4  -2      rpm/Makefile.am
    2.388       +3  -2      rpm/configure.ac
    1.3         +2  -0      rpm/macros/.cvsignore
    1.2         +10 -0      rpm/macros/java.in
    1.4         +7  -684    rpm/macros/macros.in
    1.1         +662 -0     rpm/macros/macros.rpmbuild.in
    1.1         +41 -0      rpm/macros/selinux.in
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3087 -r1.3088 CHANGES
  --- rpm/CHANGES       21 Aug 2009 16:48:51 -0000      1.3087
  +++ rpm/CHANGES       21 Aug 2009 19:17:31 -0000      1.3088
  @@ -1,5 +1,6 @@
   
   5.2b1 -> 5.3a1
  +    - jbj: macros: split rpmbuild macros into /usr/lib/rpm/macros.rpmbuild.
       - jbj: macros: automagic dependency extractors are now per-interpreter.
       - jbj: macros: refactor perl/php/python peculier config into separate 
file.
       - jbj: macros: expand %{load:...} immediiately/recursively when loading.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.242 -r2.243 Makefile.am
  --- rpm/Makefile.am   21 Aug 2009 03:18:36 -0000      2.242
  +++ rpm/Makefile.am   21 Aug 2009 19:17:31 -0000      2.243
  @@ -116,13 +116,15 @@
   endif
   
   pkglibdir =          @USRLIBRPM@
  -pkglib_DATA = rpmpopt macros/macros cpuinfo.yaml
  +pkglib_DATA = rpmpopt macros/macros macros/macros.rpmbuild cpuinfo.yaml
   
   pkgbindir =  $(pkglibdir)/bin
   pkgbin_SCRIPTS = install-sh mkinstalldirs
   
   pkgcfgdir =  $(pkglibdir)/macros.d
  -pkgcfg_DATA = macros/perl macros/php macros/python
  +pkgcfg_DATA = \
  +     macros/java macros/libtool macros/mono macros/perl \
  +     macros/pkgconfig macros/php macros/python macros/selinux
   
   noinst_HEADERS = build.h debug.h system.h
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.387 -r2.388 configure.ac
  --- rpm/configure.ac  21 Aug 2009 16:48:51 -0000      2.387
  +++ rpm/configure.ac  21 Aug 2009 19:17:31 -0000      2.388
  @@ -1968,11 +1968,12 @@
   
   dnl # explicit list of files to generate
   AC_CONFIG_FILES([ po/Makefile.in
  -    Doxyfile Makefile macros/macros rpmpopt rpm.spec
  +    Doxyfile Makefile rpmpopt rpm.spec
       rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
       scripts/Makefile
  +    macros/macros macros/macros.rpmbuild
       macros/java macros/libtool macros/mono macros/perl 
  -    macros/pkgconfig macros/php macros/python
  +    macros/pkgconfig macros/php macros/python macros/selinux
       tools/Makefile misc/Makefile doc/Makefile
       doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile
       doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros/.cvsignore
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 .cvsignore
  --- rpm/macros/.cvsignore     21 Aug 2009 16:48:52 -0000      1.2
  +++ rpm/macros/.cvsignore     21 Aug 2009 19:17:31 -0000      1.3
  @@ -1,8 +1,10 @@
   java
   libtool
   macros
  +macros.rpmbuild
   mono
   perl
   php
   pkgconfig
   python
  +selinux
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros/java.in
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 java.in
  --- rpm/macros/java.in        21 Aug 2009 16:48:52 -0000      1.1
  +++ rpm/macros/java.in        21 Aug 2009 19:17:31 -0000      1.2
  @@ -8,3 +8,13 @@
   # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
   %__java_provides     %{_rpmhome}/javadeps.sh --provides
   %__java_requires     %{_rpmhome}/javadeps.sh --requires
  +
  +#    The value of CLASSPATH in build scriptlets (iff configured).
  +#    
  +#%_javaclasspath     all
  +
  +#    Import packaging conventions from jpackage.org (prefixed with _
  +#    to avoid name collisions).
  +#    
  +%_javadir      %{_datadir}/java
  +%_javadocdir   %{_datadir}/javadoc
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros/macros.in
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 macros.in
  --- rpm/macros/macros.in      21 Aug 2009 16:48:52 -0000      1.3
  +++ rpm/macros/macros.in      21 Aug 2009 19:17:31 -0000      1.4
  @@ -1,7 +1,7 @@
   #/*! \page config_macros Default configuration: @USRLIBRPM@/macros
   # \verbatim
   #
  -# $Id: macros.in,v 1.3 2009/08/21 16:48:52 jbj Exp $
  +# $Id: macros.in,v 1.4 2009/08/21 19:17:31 jbj Exp $
   #
   # This is a global RPM configuration file. All changes made here will
   # be lost when the rpm package is upgraded. Any per-system configuration
  @@ -93,79 +93,6 @@
   %__xz                        @__XZ@
   
   
#==============================================================================
  -# ---- Build system path macros.
  -#
  -%__ar                        @AR@
  -%__as                        @AS@
  -%__cc                        @CC@
  -%__cpp                       @CPP@
  -%__cxx                       @CXX@
  -%__ld                        @__LD@
  -%__nm                        @__NM@
  -%__objcopy           @__OBJCOPY@
  -%__objdump           @__OBJDUMP@
  -%__ranlib            @RANLIB@
  -%__remsh             %{__rsh}
  -%__strip             @__STRIP@
  -
  -# XXX avoid failures if tools are not installed when rpm is built.
  -%__libtoolize                @LIBTOOLIZE@
  -%__aclocal           aclocal
  -%__autoheader                autoheader
  -%__automake          automake
  -%__autoconf          autoconf
  -
  
-#==============================================================================
  -# Conditional build stuff.
  -
  -# Check if symbol is defined.
  -# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
  -%defined()   %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
  -%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
  -
  -# Shorthand for %{defined with_...}
  -%with()              %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
  -%without()   %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
  -
  -# Handle conditional builds. %bcond_with is for case when feature is
  -# default off and needs to be activated with --with ... command line
  -# switch. %bcond_without is for the dual case.
  -#
  -# %bcond_with foo defines symbol with_foo if --with foo was specified on
  -# command line.
  -# %bcond_without foo defines symbol with_foo if --without foo was *not*
  -# specified on command line.
  -#
  -# For example (spec file):
  -#
  -# (at the beginning)
  -# %bcond_with extra_fonts
  -# %bcond_without static
  -# (and later)
  -# %if %{with extra_fonts}
  -# ...
  -# %else
  -# ...
  -# %endif
  -# %if ! %{with static}
  -# ...
  -# %endif
  -# %ifdef %{with static}
  -# ...
  -# %endif
  -# %{?with_static: ... }
  -# %{!?with_static: ... }
  -# %{?with_extra_fonts: ... }
  -# %{!?with_extra_fonts: ... }
  -
  -#
  -# The bottom line: never use without_foo, _with_foo nor _without_foo, only
  -# with_foo. This way changing default set of bconds for given spec is just
  -# a matter of changing single line in it and syntax is more readable.
  -%bcond_with()                %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
  -%bcond_without()     %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
  -#
  
-#==============================================================================
   # ---- Required macros.
   #    Macros that used to be initialized as a side effect of parsing.
   #    These are the default values that can be overridden by other
  @@ -258,27 +185,7 @@
   #    Macros that are initialized as a side effect of spec
   #    file parsing.
   #
  -#    The sub-directory (relative to %{_builddir}) where sources are compiled.
  -#    This macro is set after processing %setup, either explicitly from the
  -#    value given to -n or the default name-version.
  -#
  -#%buildsubdir
  -
  -#    Truncate changelogs to no. of entries or date.
  -#    <=0     disables
  -#    <1000   truncates to no. of entries
  -#    Otherwise, a get_date string (e.g. "2 years ago") may be entered,
  -#    and changelog entries older than that date will not be added to headers.
  -%_changelog_truncate 1 year ago
  -
  -#    Configurable distribution information, same as Distribution: tag in a
  -#    specfile.
  -#
  -#%distribution
  -
  -#    Configurable distribution URL, same as DistURL: tag in a specfile.
  -#    The URL will be used to supply reliable information to tools like
  -#    rpmfind.
  +
   #
   # Note: You should not configure with disturl (or build packages with
   # the DistURL: tag) unless you are willing to supply content in a
  @@ -286,12 +193,6 @@
   #
   #%disturl
   
  -#    Configurable bug URL, same as BugURL: tag in a specfile.
  -#    The URL will be used to supply reliable information to where
  -#    to file bugs.
  -#
  -#%bugurl
  -
   #    Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
   #    marked as %doc should be installed.
   #%_excludedocs
  @@ -323,21 +224,6 @@
   #    
   %_install_langs      all
   
  -#    The value of CLASSPATH in build scriptlets (iff configured).
  -#    
  -#%_javaclasspath     all
  -
  -#    Import packaging conventions from jpackage.org (prefixed with _
  -#    to avoid name collisions).
  -#    
  -%_javadir      %{_datadir}/java
  -%_javadocdir   %{_datadir}/javadoc
  -
  -#
  -#    Deprecated.
  -#
  -#%_langpatt
  -
   #    A colon separated list of paths where files should *not* be installed.
   #    Usually, these are network file system mount points.
   #
  @@ -354,198 +240,15 @@
   #
   %_query_selector_match       default
   
  -#    Configurable packager information, same as Packager: in a specfile.
  -#
  -#%packager
  -
  -#    Compression type and level for source/binary package payloads.
  -#            "w9.gzdio"      gzip level 9 (default).
  -#            "w9.bzdio"      bzip2 level 9.
  -#            "w6.lzdio"      lzma level 6 (legacy, stable).
  -#            "w6.xzdio"      xz level 6 (obsoletes lzma, unstable).
  -#
  -#%_source_payload    w9.gzdio
  -#%_binary_payload    w9.gzdio
  -
  -#    Archive formats to use for source/binary package payloads.
  -#            "cpio"          cpio archive (default)
  -#            "ustar"         tar archive
  -#
  -#%_source_payload_format     cpio
  -#%_binary_payload_format     cpio
  -
   #    The signature to use and the location of configuration files for
   #    signing packages with PGP.
   #
   #%_pgp_name
   #%_pgp_path
   
  -#    Configurable vendor information, same as Vendor: in a specfile.
  -#
  -#%vendor
  -
  -#    Default fuzz level for %patch in spec file.
  -#%_default_patch_fuzz        -1
  -
  -#    Default patch flags
  -%_default_patch_flags        -s
  -
   
#==============================================================================
   # ---- Build configuration macros.
   #
  -# Package version macro.
  -#    The type of package to produce, for compatibility with legacy
  -#    versions of rpm.
  -#
  -# This is an rpm version, e.g. 30005 means to produce packaging compatible
  -# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
  -# version before rpm-3.0.5) are not supported. The only incompatible change
  -# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
  -# rpmlead, so there's little need to use any value greater than 30005.
  -#
  -%_package_version    30005
  -
  -#
  -# The patch macro writes 1 line of shell code to (optionally) uncompress
  -# a file and apply using patch(1).
  -#
  -
  -%patch(b:p:P:REz:F:d:) %{shrink:\
  -%define __patch_number  %{-P:%{-P*}}%{!-P:0} \
  -%define __patch_file    %{P:%{__patch_number}} \
  -%define __patch_suffix  %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \
  -%define __patch_fuzz    %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} 
-ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \
  -%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} 
%{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \
  -echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( 
%{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) 
|| exit 1\
  -}
  -
  -#
  -# Script gets packaged file list on input and buildroot as first parameter.
  -# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not 
packaged.
  -#
  -# Note: Disable (by commenting out) for legacy compatibility.
  -%__check_files         %{_rpmhome}/check-files %{buildroot}
  -
  -#
  -# Should unpackaged files in a build root terminate a build?
  -#
  -# Note: The default value should be 0 for legacy compatibility.
  -%_unpackaged_files_terminate_build   1
  -
  -#
  -# Should missing %doc files in the build directory terminate a build?
  -#
  -# Note: The default value should be 0 for legacy compatibility.
  -%_missing_doc_files_terminate_build  1
  -
  -#
  -# Should an ELF file processed by find-debuginfo.sh having no build ID
  -# terminate a build?  This is left undefined to disable it and defined to
  -# enable.
  -#
  -#%_missing_build_ids_terminate_build 1
  -
  -#
  -# Use internal dependency generator rather than external helpers?
  -# 0 - Use external generator
  -# 1 - Use internal generator if available
  -# 2 - Use __scriptlet_requires to process scriptlet dependencies
  -%_use_internal_dependency_generator  2
  -
  -#
  -# Disabler for adding /bin/sh scriptlet interpreter dependencies.
  -%_disable_shell_interpreter_deps     0
  -
  -#
  -# Filter GLIBC_PRIVATE Provides: and Requires:
  -%_filter_GLIBC_PRIVATE                       0
  -
  -# Desired selinux policy tree
  -%__policy_tree       %{expand:%%global __policy_tree %{lua:\
  -t="targeted"\
  -f = io.open("/etc/selinux/config")\
  -if f then\
  -  for l in f:lines() do\
  -    if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
  -  end\
  -  f:close()\
  -end\
  -print (t)\
  -}}%{__policy_tree}
  -
  -# Path to selinux file context patterns.
  -%__file_context_path 
/etc/selinux/%{__policy_tree}/contexts/files/file_contexts
  -
  -#
  -# Path to selinux file context patterns used to add
  -# RPMTAG_FILECONTEXTS to packages when building.
  -#
  -# Undefined, missing or %{nil} will disable.
  -%_build_file_context_path    %{nil}
  -
  -#
  -# Path to selinux file context patterns used to set
  -# (or override package content) file contexts when installing.
  -#
  -# Undefined, missing or %{nil} will use package content (if available).
  -%_install_file_context_path  %{__file_context_path}
  -
  -#
  -# Path to selinux file context patterns used to verify
  -# file contexts on file system.
  -#
  -# Undefined, missing or %{nil} will use package content (if available).
  -%_verify_file_context_path   %{__file_context_path}
  -
  -#
  -# Path to scripts to autogenerate package dependencies,
  -#
  -# Note: Used iff _use_internal_dependency_generator is zero.
  -#%__find_provides    %{_rpmhome}/rpmdeps --provides
  -#%__find_requires    %{_rpmhome}/rpmdeps --requires
  -%__find_provides     %{_rpmhome}/find-provides
  -%__find_requires     %{_rpmhome}/find-requires
  -#%__find_conflicts   ???
  -#%__find_obsoletes   ???
  -
  -#
  -# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
  -# These macros are necessary only for legacy compatibility, and have moved
  -# to per-platform macro configuration (i.e. %{_usrlibrpm}/arch>-<os>/macros)
  -#
  -# Note: These are no longer enabled by default.
  -#%__id_u             @__ID_U@
  -#%__chown_Rhf                @__CHOWN_RHF@
  -#%__chgrp_Rhf                @__CHGRP_RHF@
  -#%_fixowner          [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
  -#%_fixgroup          [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
  -#%_fixperms          %{__chmod} -Rf @FIXPERMS@
  -#
  -
  -#
  -# Choose metadata file digest algorithm:
  -#    1       MD5
  -#    2       SHA1
  -#    3       RIPEMD-160
  -#    5       MD2
  -#    6       TIGER-192
  -#    8       SHA256
  -#    9       SHA384
  -#    10      SHA512
  -#    11      SHA224
  -#    104     MD4
  -#    105     RIPEMD-128
  -#    106     CRC-32
  -#    107     ADLER-32
  -#    108     CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
  -#    109     Jenkins lookup3.c hashlittle()
  -#    111     RIPEMD-256
  -#    112     RIPEMD-320
  -#
  -# Note: choosing anything but MD5 introduces instant legacy incompatibility.
  -%_build_file_digest_algo     1
  -%_build_binary_file_digest_algo      %{_build_file_digest_algo}
  -%_build_source_file_digest_algo      %{_build_file_digest_algo}
   
   #
   # Path to magic file used for file classification.
  @@ -556,13 +259,9 @@
   %_arbitrary_tags_debian      
Priority:Essential:Depends:Predepends:Recommends:Suggests:Enhances:Breaks
   %_arbitrary_tags     
Class:Track:Trackprog:Depflags:Transflags:%{_arbitrary_tags_debian}
   
  -#
  -# Byte size of line buffer for .spec file parsing
  -%_spec_line_buffer_size 100000
  -
  -#
  -# Maximum Icon: graphic file size (undefined or < 2048 uses 2048).
  -%_build_iconsize 2048
  
+#==============================================================================
  +# ---- SELinux configuration macros.
  +%{load:%{_usrlibrpm}/macros.d/selinux}
   
   
#==============================================================================
   # ---- Database configuration macros.
  @@ -860,11 +559,6 @@
   # ---- Transaction macros.
   #    Macro(s) used to parameterize transactions.
   #
  -#    The output binary package file name template used when building
  -#    binary packages.
  -#
  -# XXX        Note: escaped %% for use in headerSprintf()
  -%_build_name_fmt     %%{ARCH}/%{___NVRA}.rpm
   
   #    The default transaction color. This value is a set of bits to
   #    determine file and dependency affinity for this arch.
  @@ -1191,212 +885,6 @@
   %_build_platform     %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
   %_target_platform    %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
   
  -#
  -# Define a generic value for optflags. Normally overridden by per-target 
macros.
  -%optflags            -O2
  -
  -#
  -# Define per-arch and per-os defaults. Normally overridden by per-target 
macros.
  -%__arch_install_post %{nil}
  -%__os_install_post   %{___build_post}
  -
  
-#==============================================================================
  -# ---- Scriptlet template templates.
  -#    Global defaults used for building scriptlet templates.
  -#
  -
  -%___build_shell              
%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
  -%___build_args               -e
  -%___build_cmd                %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} 
%{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} 
}%{___build_shell} %{___build_args}
  -%___build_pre        \
  -  RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
  -  RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
  -  RPM_OPT_FLAGS=\"%{optflags}\"\
  -  RPM_ARCH=\"%{_arch}\"\
  -  RPM_OS=\"%{_os}\"\
  -  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
  -  RPM_DOC_DIR=\"%{_docdir}\"\
  -  export RPM_DOC_DIR\
  -  RPM_PACKAGE_NAME=\"%{name}\"\
  -  RPM_PACKAGE_VERSION=\"%{version}\"\
  -  RPM_PACKAGE_RELEASE=\"%{release}\"\
  -  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
  -  %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
  -  export RPM_BUILD_ROOT}\
  -  %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
  -  export CLASSPATH}\
  -  unset PERL_MM_OPT || :\
  -  LC_ALL=C\
  -  export LC_ALL\
  -  LANG=C\
  -  export LANG\
  -  unset DISPLAY || :\
  -  unset LINGUAS || :\
  -  unset LANGUAGE || :\
  -  unset LC_MESSAGES || :\
  -  \
  -  %{verbose:set -x}%{!verbose:exec > /dev/null}\
  -  umask 022\
  -  cd "%{u2p:%{_builddir}}"\
  -
  -
  -#%___build_body              %{nil}
  -%___build_post               exit 0
  -
  -%___build_template   #!%{___build_shell}\
  -%{___build_pre}\
  -%{nil}
  -
  -#%{___build_body}\
  -#%{___build_post}\
  -#%{nil}
  -
  
-#==============================================================================
  -# ---- Scriptlet templates.
  -#    Macro(s) that expand to a command and script that is executed.
  -#    CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
  -#
  -%__spec_prep_shell   %{___build_shell}
  -%__spec_prep_args    %{___build_args}
  -%__spec_prep_cmd     %{___build_cmd}
  -%__spec_prep_pre     %{___build_pre}
  -%__spec_prep_body    %{___build_body}
  -%__spec_prep_post    %{___build_post}
  -%__spec_prep_template        #!%{__spec_prep_shell}\
  -%{__spec_prep_pre}\
  -%{nil}
  -
  -#%{__spec_prep_body}\
  -#%{__spec_prep_post}\
  -#%{nil}
  -
  -%__spec_build_shell  %{___build_shell}
  -%__spec_build_args   %{___build_args}
  -%__spec_build_cmd    %{___build_cmd}
  -%__spec_build_pre    %{___build_pre}
  -%__spec_build_body   %{___build_body}
  -%__spec_build_post   %{___build_post}
  -%__spec_build_template       #!%{__spec_build_shell}\
  -%{__spec_build_pre}\
  -%{nil}
  -
  -#%{__spec_build_body}\
  -#%{__spec_build_post}\
  -#%{nil}
  -
  -%__spec_install_shell        %{___build_shell}
  -%__spec_install_args %{___build_args}
  -%__spec_install_cmd  %{___build_cmd}
  -%__spec_install_pre  %{___build_pre}\
  -%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
  -%__spec_install_body %{___build_body}
  -%__spec_install_post\
  -%{?__debug_package:%{__debug_install_post}}\
  -%{__arch_install_post}\
  -%{__os_install_post}\
  -%{nil}
  -%__spec_install_template     #!%{__spec_install_shell}\
  -%{__spec_install_pre}\
  -%{nil}
  -
  -#%{__spec_install_body}\
  -#%{__spec_install_post}\
  -#%{nil}
  -
  -%__spec_check_shell  %{___build_shell}
  -%__spec_check_args   %{___build_args}
  -%__spec_check_cmd    %{___build_cmd}
  -%__spec_check_pre    %{___build_pre}
  -%__spec_check_body   %{___build_body}
  -%__spec_check_post   %{___build_post}
  -%__spec_check_template       #!%{__spec_check_shell}\
  -%{__spec_check_pre}\
  -%{nil}
  -
  -#%{__spec_check_body}\
  -#%{__spec_check_post}\
  -#%{nil}
  -
  -#%__spec_autodep_shell       %{___build_shell}
  -#%__spec_autodep_args        %{___build_args}
  -#%__spec_autodep_cmd %{___build_cmd}
  -#%__spec_autodep_pre %{___build_pre}
  -#%__spec_autodep_body        %{___build_body}
  -#%__spec_autodep_post        %{___build_post}
  -#%__spec_autodep_template    #!%{__spec_autodep_shell}\
  -#%{__spec_autodep_pre}\
  -#%{nil}
  -
  -#%{__spec_autodep_body}\
  -#%{__spec_autodep_post}\
  -#%{nil}
  -
  -%__spec_clean_shell  %{___build_shell}
  -%__spec_clean_args   %{___build_args}
  -%__spec_clean_cmd    %{___build_cmd}
  -%__spec_clean_pre    %{___build_pre}
  -%__spec_clean_body   %{?buildroot:%{__rm} -rf '%{buildroot}'}\
  -%{nil}
  -%__spec_clean_post   %{nil}
  -%__spec_clean_template       #!%{__spec_clean_cmd}\
  -%{__spec_clean_pre}\
  -%{nil}
  -
  -#%{__spec_clean_body}\
  -#%{__spec_clean_post}\
  -#%{nil}
  -
  -%__spec_track_shell    %{___build_shell}
  -%__spec_track_args     %{___build_args}
  -%__spec_track_cmd      %{___build_cmd}
  -%__spec_track_pre      %{__vcheck} 
%{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD
  -%__spec_track_body     %{___build_body}
  -%__spec_track_post     GO_SYSIN_DD\
  -%{nil}
  -%__spec_track_template #!%{__spec_track_shell}\
  -%{__spec_track_pre}\
  -%{nil}
  -
  -%__spec_sanitycheck_shell    %{___build_shell}
  -%__spec_sanitycheck_args     %{___build_args}
  -%__spec_sanitycheck_cmd      %{___build_cmd}
  -%__spec_sanitycheck_pre      %{___build_pre}
  -%__spec_sanitycheck_body     %{___build_body}
  -%__spec_sanitycheck_post     %{___build_post}
  -%__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\
  -%{__spec_sanitycheck_pre}\
  -%{nil}
  -
  -%__spec_rmbuild_shell        %{___build_shell}
  -%__spec_rmbuild_args %{___build_args}
  -%__spec_rmbuild_cmd  %{___build_cmd}
  -%__spec_rmbuild_pre  %{___build_pre}
  -%__spec_rmbuild_body %{___build_body}
  -%__spec_rmbuild_post %{___build_post}
  -%__spec_rmbuild_template     #!%{__spec_rmbuild_shell}\
  -%{__spec_rmbuild_pre}\
  -%{nil}
  -
  -#%{__spec_rmbuild_body}\
  -#%{__spec_rmbuild_post}\
  -#%{nil}
  -
  -# XXX We don't expand pre/post install scriptlets (yet).
  -#%__spec_pre_pre             %{nil}
  -#%__spec_pre_post            %{nil}
  -#%__spec_post_pre            %{nil}
  -#%__spec_post_post           %{nil}
  -#%__spec_preun_pre           %{nil}
  -#%__spec_preun_post          %{nil}
  -#%__spec_postun_pre          %{nil}
  -#%__spec_postun_post         %{nil}
  -#%__spec_triggerpostun_pre   %{nil}
  -#%__spec_triggerpostun_post  %{nil}
  -#%__spec_triggerun_pre               %{nil}
  -#%__spec_triggerun_post              %{nil}
  -#%__spec_triggerin_pre               %{nil}
  -#%__spec_triggerin_post              %{nil}
  -
   
#==============================================================================
   # ---- configure macros.
   #    Macro(s) slavishly copied from autoconf's config.status.
  @@ -1447,173 +935,8 @@
   %_target_os          %{_host_os}
   
   
#==============================================================================
  -# ---- specfile macros.
  -#    Macro(s) here can be used reliably for reproducible builds.
  -#    (Note: Above is the goal, below are the macros under development)
  -#
  -# The configure macro does the following:
  -#    optionally change to a subdirectory (not implemented).
  -#    attempt to update config.guess and config.sub.
  -#    run configure with correct prefix, platform, and CFLAGS.
  -#    optionally restore current directory (not implemented).
  -# The configure macro should be invoked as %configure (rather than 
%{configure})
  -# because the rest of the arguments will be expanded using %*.
  -#
  -# This is the version of %configure used through rpm-3.0.4.
  -#%configure  \
  -#  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
  -#  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
  -#
  
-#------------------------------------------------------------------------------
  -# This is an improved version of %configure (from PLD team).
  -%configure \
  -  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  -  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  -  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  -  ./configure --host=%{_host} --build=%{_build} \\\
  -     --target=%{_target_platform} \\\
  -     --program-prefix=%{?_program_prefix} \\\
  -     --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}
  -
  
-#------------------------------------------------------------------------------
  -# The make install analogue of %configure for modern autotools:
  -%make_install make install DESTDIR=%{?buildroot}
  -
  
-#------------------------------------------------------------------------------
  -# Former make install analogue, kept for compatibility and for old/broken
  -#  packages that don't support DESTDIR properly.
  -%makeinstall \
  -  make \\\
  -     prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
  -     exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
  -     bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
  -     sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
  -     sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
  -     datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
  -     includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
  -     libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
  -     libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
  -     localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
  -     sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
  -     mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
  -     infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
  -  install
  -
  
-#------------------------------------------------------------------------------
  -# The GNUconfigure macro does the following:
  -#       update config.guess and config.sub.
  -#       regenerate all autoconf/automake files
  -#       optionally change to a directory (make the directory if requested).
  -#       run configure with correct prefix, platform, and CFLAGS.
  -#       optionally restore current directory.
  -#
  -# Based on autogen.sh from GNOME and orginal GNUconfigure
  -#
  -%GNUconfigure(MCs:)      \
  -  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
  -  LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
  -  %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \
  -  dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \
  -    for coin in `echo ${dirs}` \
  -do \
  -  dr=`dirname ${coin}`; \
  -if test -f ${dr}/NO-AUTO-GEN; then \
  - : \
  -else \
  -     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
  -    ( cd "${dr}"; \
  -      aclocalinclude="${ACLOCAL_FLAGS}"; \
  -      for k in ${macrodirs}; do \
  -        if test -d ${k}; then \
  -          aclocalinclude="${aclocalinclude} -I ${k}"; \
  -        ##else \
  -        ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
  -        fi \
  -      done \
  -      if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \
  -        if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \
  -          : do nothing -- we still have an old unmodified configure.[ai][cn] 
\
  -        else \
  -          test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
  -          echo "no" | gettextize --force --copy; \
  -          test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
  -        fi \
  -      fi \
  -      if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \
  -        %{__libtoolize} --force --copy; \
  -      fi \
  -      aclocal ${aclocalinclude}; \
  -      if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \
  -        %{__autoheader}; \
  -      fi \
  -      echo "Running automake --gnu ${am_opt} ..."; \
  -      %{__automake} --add-missing --gnu ${am_opt}; \
  -      %{__autoconf}; \
  -    ); \
  -  fi \
  -done \
  -  %{-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} %* ; \
  -  %{-C:cd "${_mydir}"; unset _mydir}
  -
  -%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
  -%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
  -
  
-#------------------------------------------------------------------------------
  -# argument to pass to 'make' to run one job per cpu in parallel on smp 
systems.
  -%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
  -     && RPM_BUILD_NCPUS="`...@ncpus_command@`"; \\\
  -     [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
  -
  
-#------------------------------------------------------------------------------
  -# arch macro for all Intel i?86 compatibile processors
  -#  (Note: This macro (and it's analogues) will probably be obsoleted when
  -#   rpm can use regular expressions against target platforms in macro
  -#   conditionals.
  -#
  -%ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
  -
  -# same thing for arm
  -%arm    arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b 
armv5te armv5tel armv5teb xscale armv6 armv6l
  -
  -# same for alpha
  -%alpha  alpha alphaev56 alphaev6 alphaev67
  -
  -# and sparc
  -%sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
  -
  -# add alternative sparc architectures macro (bugzilla #455972 patch)
  -%sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
  -
  -# also for mips
  -%mips mips mips2 mips3 mips4 octeon
  -%mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel
  -
  -%mipsx %mips %mipsel mips64 mips64el
  - 
  -#------------------------------------------------------------------------
  -# Use in %install to generate locale specific file lists. For example,
  -#
  -# %install
  -# ...
  -# %find_lang %{name}
  -# ...
  -# %files -f %{name}.lang
  -#
  -%find_lang   %{_rpmhome}/find-lang.sh %{buildroot}
  -
  -%requires_eq()       %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 
'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 
0:/ /' | grep -v "is not")
  +# ---- rpmbuild macros.
  +%{load:%{_usrlibrpm}/macros.rpmbuild}
   
   #------------------------------------------------------------------------
   # lua macros
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros/macros.rpmbuild.in
  ============================================================================
  $ cvs diff -u -r0 -r1.1 macros.rpmbuild.in
  --- /dev/null 2009-08-21 21:15:30 +0200
  +++ macros.rpmbuild.in        2009-08-21 21:17:32 +0200
  @@ -0,0 +1,662 @@
  +#/*! \page build_macros Default configuration: @USRLIBRPM@/macros.rpmbuild
  +# \verbatim
  +#
  +# $Id: macros.rpmbuild.in,v 1.1 2009/08/21 19:17:31 jbj Exp $
  +#
  +# This file contains rpmbuild configuration macros.
  +#
  +
  
+#==============================================================================
  +# ---- Build system path macros.
  +#
  +%__ar                        @AR@
  +%__as                        @AS@
  +%__cc                        @CC@
  +%__cpp                       @CPP@
  +%__cxx                       @CXX@
  +%__ld                        @__LD@
  +%__nm                        @__NM@
  +%__objcopy           @__OBJCOPY@
  +%__objdump           @__OBJDUMP@
  +%__ranlib            @RANLIB@
  +%__remsh             %{__rsh}
  +%__strip             @__STRIP@
  +
  +# XXX avoid failures if tools are not installed when rpm is built.
  +%__libtoolize                @LIBTOOLIZE@
  +%__aclocal           aclocal
  +%__autoheader                autoheader
  +%__automake          automake
  +%__autoconf          autoconf
  +
  
+#==============================================================================
  +# ---- Conditional build macro templates.
  +
  +# Check if symbol is defined.
  +# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
  +%defined()   %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
  +%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
  +
  +# Shorthand for %{defined with_...}
  +%with()              %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
  +%without()   %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
  +
  +# Handle conditional builds. %bcond_with is for case when feature is
  +# default off and needs to be activated with --with ... command line
  +# switch. %bcond_without is for the dual case.
  +#
  +# %bcond_with foo defines symbol with_foo if --with foo was specified on
  +# command line.
  +# %bcond_without foo defines symbol with_foo if --without foo was *not*
  +# specified on command line.
  +#
  +# For example (spec file):
  +#
  +# (at the beginning)
  +# %bcond_with extra_fonts
  +# %bcond_without static
  +# (and later)
  +# %if %{with extra_fonts}
  +# ...
  +# %else
  +# ...
  +# %endif
  +# %if ! %{with static}
  +# ...
  +# %endif
  +# %ifdef %{with static}
  +# ...
  +# %endif
  +# %{?with_static: ... }
  +# %{!?with_static: ... }
  +# %{?with_extra_fonts: ... }
  +# %{!?with_extra_fonts: ... }
  +
  +#
  +# The bottom line: never use without_foo, _with_foo nor _without_foo, only
  +# with_foo. This way changing default set of bconds for given spec is just
  +# a matter of changing single line in it and syntax is more readable.
  +%bcond_with()                %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
  +%bcond_without()     %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
  +
  
+#==============================================================================
  +# ---- Optional macros.
  +#    Macros that are initialized as a side effect of spec
  +#    file parsing.
  +#
  +#    The sub-directory (relative to %{_builddir}) where sources are compiled.
  +#    This macro is set after processing %setup, either explicitly from the
  +#    value given to -n or the default name-version.
  +#
  +#%buildsubdir
  +
  +#    Truncate changelogs to no. of entries or date.
  +#    <=0     disables
  +#    <1000   truncates to no. of entries
  +#    Otherwise, a get_date string (e.g. "2 years ago") may be entered,
  +#    and changelog entries older than that date will not be added to headers.
  +%_changelog_truncate 1 year ago
  +
  +#    Configurable distribution information, same as Distribution: tag in a
  +#    specfile.
  +#
  +#%distribution
  +
  +#    Configurable bug URL, same as BugURL: tag in a specfile.
  +#    The URL will be used to supply reliable information to where
  +#    to file bugs.
  +#
  +#%bugurl
  +
  +#
  +#    Deprecated.
  +#
  +#%_langpatt
  +
  +#    Configurable packager information, same as Packager: in a specfile.
  +#
  +#%packager
  +
  +#    Compression type and level for source/binary package payloads.
  +#            "w9.gzdio"      gzip level 9 (default).
  +#            "w9.bzdio"      bzip2 level 9.
  +#            "w6.lzdio"      lzma level 6 (legacy, stable).
  +#            "w6.xzdio"      xz level 6 (obsoletes lzma, unstable).
  +#
  +#%_source_payload    w9.gzdio
  +#%_binary_payload    w9.gzdio
  +
  +#    Archive formats to use for source/binary package payloads.
  +#            "cpio"          cpio archive (default)
  +#            "ustar"         tar archive
  +#
  +#%_source_payload_format     cpio
  +#%_binary_payload_format     cpio
  +
  +#    Configurable vendor information, same as Vendor: in a specfile.
  +#
  +#%vendor
  +
  +#    Default fuzz level for %patch in spec file.
  +#%_default_patch_fuzz        -1
  +
  +#    Default patch flags
  +%_default_patch_flags        -s
  +
  
+#==============================================================================
  +# ---- Build configuration macros.
  +#
  +# Package version macro.
  +#    The type of package to produce, for compatibility with legacy
  +#    versions of rpm.
  +#
  +# This is an rpm version, e.g. 30005 means to produce packaging compatible
  +# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
  +# version before rpm-3.0.5) are not supported. The only incompatible change
  +# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
  +# rpmlead, so there's little need to use any value greater than 30005.
  +#
  +%_package_version    30005
  +
  +#
  +# The patch macro writes 1 line of shell code to (optionally) uncompress
  +# a file and apply using patch(1).
  +#
  +
  +%patch(b:p:P:REz:F:d:) %{shrink:\
  +%define __patch_number  %{-P:%{-P*}}%{!-P:0} \
  +%define __patch_file    %{P:%{__patch_number}} \
  +%define __patch_suffix  %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \
  +%define __patch_fuzz    %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} 
-ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \
  +%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} 
%{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \
  +echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( 
%{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) 
|| exit 1\
  +}
  +
  +#
  +# Script gets packaged file list on input and buildroot as first parameter.
  +# Returns list of unpackaged files, i.e. files in $RPM_BUILD_ROOT not 
packaged.
  +#
  +# Note: Disable (by commenting out) for legacy compatibility.
  +%__check_files         %{_rpmhome}/check-files %{buildroot}
  +
  +#
  +# Should unpackaged files in a build root terminate a build?
  +#
  +# Note: The default value should be 0 for legacy compatibility.
  +%_unpackaged_files_terminate_build   1
  +
  +#
  +# Should missing %doc files in the build directory terminate a build?
  +#
  +# Note: The default value should be 0 for legacy compatibility.
  +%_missing_doc_files_terminate_build  1
  +
  +#
  +# Should an ELF file processed by find-debuginfo.sh having no build ID
  +# terminate a build?  This is left undefined to disable it and defined to
  +# enable.
  +#
  +#%_missing_build_ids_terminate_build 1
  +
  +#
  +# Use internal dependency generator rather than external helpers?
  +# 0 - Use external generator
  +# 1 - Use internal generator if available
  +# 2 - Use __scriptlet_requires to process scriptlet dependencies
  +%_use_internal_dependency_generator  2
  +
  +#
  +# Disabler for adding /bin/sh scriptlet interpreter dependencies.
  +%_disable_shell_interpreter_deps     0
  +
  +#
  +# Filter GLIBC_PRIVATE Provides: and Requires:
  +%_filter_GLIBC_PRIVATE                       0
  +
  +#
  +# Path to scripts to autogenerate package dependencies,
  +#
  +# Note: Used iff _use_internal_dependency_generator is zero.
  +#%__find_provides    %{_rpmhome}/rpmdeps --provides
  +#%__find_requires    %{_rpmhome}/rpmdeps --requires
  +%__find_provides     %{_rpmhome}/find-provides
  +%__find_requires     %{_rpmhome}/find-requires
  +#%__find_conflicts   ???
  +#%__find_obsoletes   ???
  +
  +#
  +# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
  +# These macros are necessary only for legacy compatibility, and have moved
  +# to per-platform macro configuration (i.e. %{_usrlibrpm}/arch>-<os>/macros)
  +#
  +# Note: These are no longer enabled by default.
  +#%__id_u             @__ID_U@
  +#%__chown_Rhf                @__CHOWN_RHF@
  +#%__chgrp_Rhf                @__CHGRP_RHF@
  +#%_fixowner          [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
  +#%_fixgroup          [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
  +#%_fixperms          %{__chmod} -Rf @FIXPERMS@
  +#
  +
  +#
  +# Choose metadata file digest algorithm:
  +#    1       MD5
  +#    2       SHA1
  +#    3       RIPEMD-160
  +#    5       MD2
  +#    6       TIGER-192
  +#    8       SHA256
  +#    9       SHA384
  +#    10      SHA512
  +#    11      SHA224
  +#    104     MD4
  +#    105     RIPEMD-128
  +#    106     CRC-32
  +#    107     ADLER-32
  +#    108     CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
  +#    109     Jenkins lookup3.c hashlittle()
  +#    111     RIPEMD-256
  +#    112     RIPEMD-320
  +#
  +# Note: choosing anything but MD5 introduces instant legacy incompatibility.
  +%_build_file_digest_algo     1
  +%_build_binary_file_digest_algo      %{_build_file_digest_algo}
  +%_build_source_file_digest_algo      %{_build_file_digest_algo}
  +
  +#
  +# Byte size of line buffer for .spec file parsing
  +%_spec_line_buffer_size 100000
  +
  +#
  +# Maximum Icon: graphic file size (undefined or < 2048 uses 2048).
  +%_build_iconsize 2048
  +
  +#    The output binary package file name template used when building
  +#    binary packages.
  +#
  +# XXX        Note: escaped %% for use in headerSprintf()
  +%_build_name_fmt     %%{ARCH}/%{___NVRA}.rpm
  +
  
+#==============================================================================
  +# ---- per-platform macros.
  +#    Macros that are specific to an individual platform. The values here
  +#    will be used if the per-platform macro file does not exist..
  +#
  +
  +#
  +# Define a generic value for optflags. Normally overridden by per-target 
macros.
  +%optflags            -O2
  +
  +#
  +# Define per-arch and per-os defaults. Normally overridden by per-target 
macros.
  +%__arch_install_post %{nil}
  +%__os_install_post   %{___build_post}
  +
  
+#==============================================================================
  +# ---- Scriptlet template templates.
  +#    Global defaults used for building scriptlet templates.
  +#
  +
  +%___build_shell              
%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
  +%___build_args               -e
  +%___build_cmd                %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} 
%{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} 
}%{___build_shell} %{___build_args}
  +%___build_pre        \
  +  RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
  +  RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
  +  RPM_OPT_FLAGS=\"%{optflags}\"\
  +  RPM_ARCH=\"%{_arch}\"\
  +  RPM_OS=\"%{_os}\"\
  +  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
  +  RPM_DOC_DIR=\"%{_docdir}\"\
  +  export RPM_DOC_DIR\
  +  RPM_PACKAGE_NAME=\"%{name}\"\
  +  RPM_PACKAGE_VERSION=\"%{version}\"\
  +  RPM_PACKAGE_RELEASE=\"%{release}\"\
  +  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
  +  %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
  +  export RPM_BUILD_ROOT}\
  +  %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
  +  export CLASSPATH}\
  +  unset PERL_MM_OPT || :\
  +  LC_ALL=C\
  +  export LC_ALL\
  +  LANG=C\
  +  export LANG\
  +  unset DISPLAY || :\
  +  unset LINGUAS || :\
  +  unset LANGUAGE || :\
  +  unset LC_MESSAGES || :\
  +  \
  +  %{verbose:set -x}%{!verbose:exec > /dev/null}\
  +  umask 022\
  +  cd "%{u2p:%{_builddir}}"\
  +
  +
  +#%___build_body              %{nil}
  +%___build_post               exit 0
  +
  +%___build_template   #!%{___build_shell}\
  +%{___build_pre}\
  +%{nil}
  +
  +#%{___build_body}\
  +#%{___build_post}\
  +#%{nil}
  +
  
+#==============================================================================
  +# ---- Scriptlet templates.
  +#    Macro(s) that expand to a command and script that is executed.
  +#    CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
  +#
  +%__spec_prep_shell   %{___build_shell}
  +%__spec_prep_args    %{___build_args}
  +%__spec_prep_cmd     %{___build_cmd}
  +%__spec_prep_pre     %{___build_pre}
  +%__spec_prep_body    %{___build_body}
  +%__spec_prep_post    %{___build_post}
  +%__spec_prep_template        #!%{__spec_prep_shell}\
  +%{__spec_prep_pre}\
  +%{nil}
  +
  +#%{__spec_prep_body}\
  +#%{__spec_prep_post}\
  +#%{nil}
  +
  +%__spec_build_shell  %{___build_shell}
  +%__spec_build_args   %{___build_args}
  +%__spec_build_cmd    %{___build_cmd}
  +%__spec_build_pre    %{___build_pre}
  +%__spec_build_body   %{___build_body}
  +%__spec_build_post   %{___build_post}
  +%__spec_build_template       #!%{__spec_build_shell}\
  +%{__spec_build_pre}\
  +%{nil}
  +
  +#%{__spec_build_body}\
  +#%{__spec_build_post}\
  +#%{nil}
  +
  +%__spec_install_shell        %{___build_shell}
  +%__spec_install_args %{___build_args}
  +%__spec_install_cmd  %{___build_cmd}
  +%__spec_install_pre  %{___build_pre}\
  +%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
  +%__spec_install_body %{___build_body}
  +%__spec_install_post\
  +%{?__debug_package:%{__debug_install_post}}\
  +%{__arch_install_post}\
  +%{__os_install_post}\
  +%{nil}
  +%__spec_install_template     #!%{__spec_install_shell}\
  +%{__spec_install_pre}\
  +%{nil}
  +
  +#%{__spec_install_body}\
  +#%{__spec_install_post}\
  +#%{nil}
  +
  +%__spec_check_shell  %{___build_shell}
  +%__spec_check_args   %{___build_args}
  +%__spec_check_cmd    %{___build_cmd}
  +%__spec_check_pre    %{___build_pre}
  +%__spec_check_body   %{___build_body}
  +%__spec_check_post   %{___build_post}
  +%__spec_check_template       #!%{__spec_check_shell}\
  +%{__spec_check_pre}\
  +%{nil}
  +
  +#%{__spec_check_body}\
  +#%{__spec_check_post}\
  +#%{nil}
  +
  +#%__spec_autodep_shell       %{___build_shell}
  +#%__spec_autodep_args        %{___build_args}
  +#%__spec_autodep_cmd %{___build_cmd}
  +#%__spec_autodep_pre %{___build_pre}
  +#%__spec_autodep_body        %{___build_body}
  +#%__spec_autodep_post        %{___build_post}
  +#%__spec_autodep_template    #!%{__spec_autodep_shell}\
  +#%{__spec_autodep_pre}\
  +#%{nil}
  +
  +#%{__spec_autodep_body}\
  +#%{__spec_autodep_post}\
  +#%{nil}
  +
  +%__spec_clean_shell  %{___build_shell}
  +%__spec_clean_args   %{___build_args}
  +%__spec_clean_cmd    %{___build_cmd}
  +%__spec_clean_pre    %{___build_pre}
  +%__spec_clean_body   %{?buildroot:%{__rm} -rf '%{buildroot}'}\
  +%{nil}
  +%__spec_clean_post   %{nil}
  +%__spec_clean_template       #!%{__spec_clean_cmd}\
  +%{__spec_clean_pre}\
  +%{nil}
  +
  +#%{__spec_clean_body}\
  +#%{__spec_clean_post}\
  +#%{nil}
  +
  +%__spec_track_shell    %{___build_shell}
  +%__spec_track_args     %{___build_args}
  +%__spec_track_cmd      %{___build_cmd}
  +%__spec_track_pre      %{__vcheck} 
%{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD
  +%__spec_track_body     %{___build_body}
  +%__spec_track_post     GO_SYSIN_DD\
  +%{nil}
  +%__spec_track_template #!%{__spec_track_shell}\
  +%{__spec_track_pre}\
  +%{nil}
  +
  +%__spec_sanitycheck_shell    %{___build_shell}
  +%__spec_sanitycheck_args     %{___build_args}
  +%__spec_sanitycheck_cmd      %{___build_cmd}
  +%__spec_sanitycheck_pre      %{___build_pre}
  +%__spec_sanitycheck_body     %{___build_body}
  +%__spec_sanitycheck_post     %{___build_post}
  +%__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\
  +%{__spec_sanitycheck_pre}\
  +%{nil}
  +
  +%__spec_rmbuild_shell        %{___build_shell}
  +%__spec_rmbuild_args %{___build_args}
  +%__spec_rmbuild_cmd  %{___build_cmd}
  +%__spec_rmbuild_pre  %{___build_pre}
  +%__spec_rmbuild_body %{___build_body}
  +%__spec_rmbuild_post %{___build_post}
  +%__spec_rmbuild_template     #!%{__spec_rmbuild_shell}\
  +%{__spec_rmbuild_pre}\
  +%{nil}
  +
  +#%{__spec_rmbuild_body}\
  +#%{__spec_rmbuild_post}\
  +#%{nil}
  +
  +# XXX We don't expand pre/post install scriptlets (yet).
  +#%__spec_pre_pre             %{nil}
  +#%__spec_pre_post            %{nil}
  +#%__spec_post_pre            %{nil}
  +#%__spec_post_post           %{nil}
  +#%__spec_preun_pre           %{nil}
  +#%__spec_preun_post          %{nil}
  +#%__spec_postun_pre          %{nil}
  +#%__spec_postun_post         %{nil}
  +#%__spec_triggerpostun_pre   %{nil}
  +#%__spec_triggerpostun_post  %{nil}
  +#%__spec_triggerun_pre               %{nil}
  +#%__spec_triggerun_post              %{nil}
  +#%__spec_triggerin_pre               %{nil}
  +#%__spec_triggerin_post              %{nil}
  +
  
+#==============================================================================
  +# ---- specfile macros.
  +#    Macro(s) here can be used reliably for reproducible builds.
  +#    (Note: Above is the goal, below are the macros under development)
  +#
  +# The configure macro does the following:
  +#    optionally change to a subdirectory (not implemented).
  +#    attempt to update config.guess and config.sub.
  +#    run configure with correct prefix, platform, and CFLAGS.
  +#    optionally restore current directory (not implemented).
  +# The configure macro should be invoked as %configure (rather than 
%{configure})
  +# because the rest of the arguments will be expanded using %*.
  +#
  +# This is the version of %configure used through rpm-3.0.4.
  +#%configure  \
  +#  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
  +#  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
  +#
  
+#------------------------------------------------------------------------------
  +# This is an improved version of %configure (from PLD team).
  +%configure \
  +  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  +  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  +  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  +  ./configure --host=%{_host} --build=%{_build} \\\
  +     --target=%{_target_platform} \\\
  +     --program-prefix=%{?_program_prefix} \\\
  +     --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}
  +
  
+#------------------------------------------------------------------------------
  +# The make install analogue of %configure for modern autotools:
  +%make_install make install DESTDIR=%{?buildroot}
  +
  
+#------------------------------------------------------------------------------
  +# Former make install analogue, kept for compatibility and for old/broken
  +#  packages that don't support DESTDIR properly.
  +%makeinstall \
  +  make \\\
  +     prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
  +     exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
  +     bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
  +     sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
  +     sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
  +     datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
  +     includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
  +     libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
  +     libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
  +     localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
  +     sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
  +     mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
  +     infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
  +  install
  +
  
+#------------------------------------------------------------------------------
  +# The GNUconfigure macro does the following:
  +#       update config.guess and config.sub.
  +#       regenerate all autoconf/automake files
  +#       optionally change to a directory (make the directory if requested).
  +#       run configure with correct prefix, platform, and CFLAGS.
  +#       optionally restore current directory.
  +#
  +# Based on autogen.sh from GNOME and orginal GNUconfigure
  +#
  +%GNUconfigure(MCs:)      \
  +  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
  +  LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
  +  %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \
  +  dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \
  +    for coin in `echo ${dirs}` \
  +do \
  +  dr=`dirname ${coin}`; \
  +if test -f ${dr}/NO-AUTO-GEN; then \
  + : \
  +else \
  +     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
  +    ( cd "${dr}"; \
  +      aclocalinclude="${ACLOCAL_FLAGS}"; \
  +      for k in ${macrodirs}; do \
  +        if test -d ${k}; then \
  +          aclocalinclude="${aclocalinclude} -I ${k}"; \
  +        ##else \
  +        ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
  +        fi \
  +      done \
  +      if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \
  +        if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \
  +          : do nothing -- we still have an old unmodified configure.[ai][cn] 
\
  +        else \
  +          test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
  +          echo "no" | gettextize --force --copy; \
  +          test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
  +        fi \
  +      fi \
  +      if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \
  +        %{__libtoolize} --force --copy; \
  +      fi \
  +      aclocal ${aclocalinclude}; \
  +      if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \
  +        %{__autoheader}; \
  +      fi \
  +      echo "Running automake --gnu ${am_opt} ..."; \
  +      %{__automake} --add-missing --gnu ${am_opt}; \
  +      %{__autoconf}; \
  +    ); \
  +  fi \
  +done \
  +  %{-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} %* ; \
  +  %{-C:cd "${_mydir}"; unset _mydir}
  +
  +%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
  +%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
  +
  
+#------------------------------------------------------------------------------
  +# argument to pass to 'make' to run one job per cpu in parallel on smp 
systems.
  +%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
  +     && RPM_BUILD_NCPUS="`...@ncpus_command@`"; \\\
  +     [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
  +
  
+#------------------------------------------------------------------------------
  +# arch macro for all Intel i?86 compatibile processors
  +#  (Note: This macro (and it's analogues) will probably be obsoleted when
  +#   rpm can use regular expressions against target platforms in macro
  +#   conditionals.
  +#
  +%ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
  +
  +# same thing for arm
  +%arm    arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b 
armv5te armv5tel armv5teb xscale armv6 armv6l
  +
  +# same for alpha
  +%alpha  alpha alphaev56 alphaev6 alphaev67
  +
  +# and sparc
  +%sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
  +
  +# add alternative sparc architectures macro (bugzilla #455972 patch)
  +%sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
  +
  +# also for mips
  +%mips mips mips2 mips3 mips4 octeon
  +%mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel
  +
  +%mipsx %mips %mipsel mips64 mips64el
  + 
  +#------------------------------------------------------------------------
  +# Use in %install to generate locale specific file lists. For example,
  +#
  +# %install
  +# ...
  +# %find_lang %{name}
  +# ...
  +# %files -f %{name}.lang
  +#
  +%find_lang   %{_rpmhome}/find-lang.sh %{buildroot}
  +
  +%requires_eq()       %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 
'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 
0:/ /' | grep -v "is not")
  +
  +# \endverbatim
  +#*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/macros/selinux.in
  ============================================================================
  $ cvs diff -u -r0 -r1.1 selinux.in
  --- /dev/null 2009-08-21 21:15:30 +0200
  +++ selinux.in        2009-08-21 21:17:32 +0200
  @@ -0,0 +1,41 @@
  +# SELinux specific macro definitions.
  +# To make use of these macros insert the following line into your spec file:
  +# %{load:%{_usrlibrpm}/macros.d/selinux}
  +#
  +
  +# Desired selinux policy tree
  +%__policy_tree       %{expand:%%global __policy_tree %{lua:\
  +t="targeted"\
  +f = io.open("/etc/selinux/config")\
  +if f then\
  +  for l in f:lines() do\
  +    if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
  +  end\
  +  f:close()\
  +end\
  +print (t)\
  +}}%{__policy_tree}
  +
  +# Path to selinux file context patterns.
  +%__file_context_path 
/etc/selinux/%{__policy_tree}/contexts/files/file_contexts
  +
  +#
  +# Path to selinux file context patterns used to add
  +# RPMTAG_FILECONTEXTS to packages when building.
  +#
  +# Undefined, missing or %{nil} will disable.
  +%_build_file_context_path    %{nil}
  +
  +#
  +# Path to selinux file context patterns used to set
  +# (or override package content) file contexts when installing.
  +#
  +# Undefined, missing or %{nil} will use package content (if available).
  +%_install_file_context_path  %{__file_context_path}
  +
  +#
  +# Path to selinux file context patterns used to verify
  +# file contexts on file system.
  +#
  +# Undefined, missing or %{nil} will use package content (if available).
  +%_verify_file_context_path   %{__file_context_path}
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to