rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

macros
Go to the documentation of this file.

    00001 #
    01036 %_rpmgi_pattern_regex() ^.+/%1-[^-]+-[^-]+\\.[^.]+\\.rpm$
    01037
    01038 #
    01039 # UUIDv3/UUIDv5 namespace URI macros. The complete canonical path is
    01040 #       %_uuid_uri      %{?_uuid_auth}/%{?_uuid_path}/Tagname/Tagvalue
    01041 %_uuid_auth     http://rpm5.org/
    01042 %_uuid_path     /package
    01043
    01044 #==============================================================================
    01045 # ---- EVRD... dependency tuple comparison macros.
    01046 #
    01047
    01048 # STEP 1: Match the string and capture regex parts
    01049 #                      1          2           3             4
    01050 #                      X     ":"  X        "-"X          ":"X
    01051 %evr_tuple_match  ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$
    01052
    01053 # STEP 2: Assemble <E,V,R,D> tuple from regex parts
    01054 # <E,V,R,D>         case 1:  case 2:  case 3:  case 4:  case 5:  case 6:
    01055 #                   X:X-X:X  X:X-X    X:X      X:       X-X      X
    01056 # %evr_tuple_select 1234     123_     12__     1___     _23_     _2__
    01057 %evr_tuple_select 123_
    01058
    01059 # STEP 3: Configure the comparison order of the <E,V,R,D> tuple elements
    01060 %evr_tuple_order  EVR
    01061
    01062 # data validation patterns for identifier tags
    01063 %pattern_Name           ^[A-Za-z0-9][A-Za-z0-9+._-]*$
    01064 %pattern_Epoch          ^[0-9]+$
    01065 %pattern_Version        ^[A-Za-z0-9+._]+$
    01066 %pattern_Release        ^[A-Za-z0-9+._]+$
    01067 %pattern_Disttag        ^[A-Za-z0-9]+$
    01068 %pattern_Repotag        ^[A-Za-z0-9]+$
    01069 %pattern_Distepoch      ^[A-Za-z0-9.]+$
    01070 #%pattern_Url
    01071 #%pattern_Cvsid
    01072 #%pattern_Group
    01073 #%pattern_Summary
    01074 #%pattern_Distribution
    01075 #%pattern_Vendor
    01076 #%pattern_License
    01077 #%pattern_Packager
    01078 #%pattern_Buildroot
    01079 #%pattern_Keywords
    01080 #%pattern_Variants
    01081 #%pattern_Prefixes
    01082 #%pattern_Docdir
    01083 #%pattern_Xmajor
    01084 #%pattern_Xminor
    01085 #%pattern_Autoreqprov
    01086 #%pattern_Autoreq
    01087 #%pattern_Autoprov
    01088 #%pattern_Source
    01089 #%pattern_Patch
    01090 #%pattern_Icon
    01091 #%pattern_Nosource
    01092 #%pattern_Nopatch
    01093 #%pattern_Buildprereq
    01094 #%pattern_Buildprovides
    01095 #%pattern_Buildrequires
    01096 #%pattern_Buildconflicts
    01097 #%pattern_Buildobsoletes
    01098 #%pattern_Buildsuggests
    01099 #%pattern_Buildenhances
    01100 #%pattern_Prereq
    01101 #%pattern_Provideflags
    01102 #%pattern_Requireflags
    01103 #%pattern_Conflictflags
    01104 #%pattern_Obsoleteflags
    01105 #%pattern_Suggestsflags
    01106 #%pattern_Enhancesflags
    01107 #%pattern_Buildplatforms
    01108 #%pattern_Excludearch
    01109 #%pattern_Exclusivearch
    01110 #%pattern_Excludeos
    01111 #%pattern_Exclusiveos
    01112 #%pattern_Buildarchs
    01113
    01114 #==============================================================================
    01115 # ---- Run-time probe dependency macros.
    01116
    01117 #
    01118 %_rpmds_filter_name     archfilter
    01119
    01120 #
    01121 %_rpmds_cpuinfo_path    /proc/cpuinfo
    01122
    01123 #
    01124 %_rpmds_sysinfo_path    %{_etcrpm}/sysinfo
    01125
    01126 #
    01127 %_rpmds_ldconfig_cmd    /sbin/ldconfig -p
    01128 %_rpmds_ldconfig_cache  /etc/ld.so.cache
    01129
    01130 # A colon-separated list of directories which should match the rld's
    01131 # (runtime loader) list of directories it searches for shared objects.
    01132 # Only used on platforms that don't have a configurable loader search
    01133 # path via ldconfig, crle, or something similar.
    01134 #%_rpmds_rld_search_path        /lib:/usr/lib
    01135
    01136 #
    01137 # Full path and arguments to Solaris' command to list what directories
    01138 # the runtime loader searches.  Needs to include `-64' for LP64 Solaris
    01139 # systems.
    01140 #%_rpmds_crle_cmd               /usr/bin/crle
    01141
    01142 #
    01143 %_rpmds_getconf_path    /
    01144
    01145 #
    01146 %_rpmds_perldeps_cmd    %{__find} %{_libdir}/perl5 | %{_rpmhome}/perl.prov
    01147
    01148 #
    01149 %_varrun                /var/run
    01150
    01151 #==============================================================================
    01152 # ---- Cache configuration macros.
    01153 #       Macro(s) used to configure the universe of headers used to
    01154 #       solve dependencies using rpmcache(8).
    01155 #
    01156 #       Note: These values were specific to my machine, and most certainly
    01157 #       are incorrect for any other machine. The macros are
    01158 #       included here only to document the macro names and usage.
    01159 #%_bhpath        file://localhost/mnt/dist
    01160 #%_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)
    01161 #%_bhN           @(SRPMS|i386|alpha|sparc|s390|ia64)
    01162 #%_bhVR          @(RedHat|Fedora)
    01163 #%_bhA           RPMS
    01164
    01165 #
    01166 # A configuration to build an rpmdb from yum package hierarchy
    01167 %_bhpath        file:
    01168 %_bhcoll        @(updates)
    01169 %_bhN           @(packages)
    01170 %_bhVR          %{nil}
    01171 %_bhA           %{nil}
    01172
    01173 #       The cache database directory.
    01174 %_cache_dbpath          /var/cache/yum/rpmdb
    01175
    01176 #==============================================================================
    01177 # ---- per-platform macros.
    01178 #       Macros that are specific to an individual platform. The values here
    01179 #       will be used if the per-platform macro file does not exist..
    01180 #
    01181 %_arch                  sparc64
    01182 %_build_arch            sparc64
    01183 %_vendor                portbld
    01184 %_os                    freebsd
    01185 %_gnu                   %{nil}
    01186
    01187 %_host_platform         %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
    01188 %_build_platform        %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
    01189 %_target_platform       %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
    01190
    01191 #
    01192 # Define a generic value for optflags. Normally overridden by per-target macros.
    01193 %optflags               -O2
    01194
    01195 #
    01196 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
    01197 %__arch_install_post    %{nil}
    01198 %__os_install_post      %{___build_post}
    01199
    01200 #==============================================================================
    01201 # ---- Scriptlet template templates.
    01202 #       Global defaults used for building scriptlet templates.
    01203 #
    01204
    01205 %___build_shell         %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
    01206 %___build_args          -e
    01207 %___build_cmd           %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
    01208 %___build_pre   \
    01209   RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
    01210   RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
    01211   RPM_OPT_FLAGS=\"%{optflags}\"\
    01212   RPM_ARCH=\"%{_arch}\"\
    01213   RPM_OS=\"%{_os}\"\
    01214   export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
    01215   RPM_DOC_DIR=\"%{_docdir}\"\
    01216   export RPM_DOC_DIR\
    01217   RPM_PACKAGE_NAME=\"%{name}\"\
    01218   RPM_PACKAGE_VERSION=\"%{version}\"\
    01219   RPM_PACKAGE_RELEASE=\"%{release}\"\
    01220   export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
    01221   %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
    01222   export RPM_BUILD_ROOT}\
    01223   %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
    01224   export CLASSPATH}\
    01225   unset PERL_MM_OPT || :\
    01226   LC_ALL=C\
    01227   export LC_ALL\
    01228   LANG=C\
    01229   export LANG\
    01230   unset DISPLAY || :\
    01231   unset LINGUAS || :\
    01232   unset LANGUAGE || :\
    01233   unset LC_MESSAGES || :\
    01234   \
    01235   %{verbose:set -x}%{!verbose:exec > /dev/null}\
    01236   umask 022\
    01237   cd "%{u2p:%{_builddir}}"\
    01238
    01239
    01240 #%___build_body         %{nil}
    01241 %___build_post          exit 0
    01242
    01243 %___build_template      #!%{___build_shell}\
    01244 %{___build_pre}\
    01245 %{nil}
    01246
    01247 #%{___build_body}\
    01248 #%{___build_post}\
    01249 #%{nil}
    01250
    01251 #==============================================================================
    01252 # ---- Scriptlet templates.
    01253 #       Macro(s) that expand to a command and script that is executed.
    01254 #       CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
    01255 #
    01256 %__spec_prep_shell      %{___build_shell}
    01257 %__spec_prep_args       %{___build_args}
    01258 %__spec_prep_cmd        %{___build_cmd}
    01259 %__spec_prep_pre        %{___build_pre}
    01260 %__spec_prep_body       %{___build_body}
    01261 %__spec_prep_post       %{___build_post}
    01262 %__spec_prep_template   #!%{__spec_prep_shell}\
    01263 %{__spec_prep_pre}\
    01264 %{nil}
    01265
    01266 #%{__spec_prep_body}\
    01267 #%{__spec_prep_post}\
    01268 #%{nil}
    01269
    01270 %__spec_build_shell     %{___build_shell}
    01271 %__spec_build_args      %{___build_args}
    01272 %__spec_build_cmd       %{___build_cmd}
    01273 %__spec_build_pre       %{___build_pre}
    01274 %__spec_build_body      %{___build_body}
    01275 %__spec_build_post      %{___build_post}
    01276 %__spec_build_template  #!%{__spec_build_shell}\
    01277 %{__spec_build_pre}\
    01278 %{nil}
    01279
    01280 #%{__spec_build_body}\
    01281 #%{__spec_build_post}\
    01282 #%{nil}
    01283
    01284 %__spec_install_shell   %{___build_shell}
    01285 %__spec_install_args    %{___build_args}
    01286 %__spec_install_cmd     %{___build_cmd}
    01287 %__spec_install_pre     %{___build_pre}\
    01288 %{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
    01289 %__spec_install_body    %{___build_body}
    01290 %__spec_install_post\
    01291 %{?__debug_package:%{__debug_install_post}}\
    01292 %{__arch_install_post}\
    01293 %{__os_install_post}\
    01294 %{nil}
    01295 %__spec_install_template        #!%{__spec_install_shell}\
    01296 %{__spec_install_pre}\
    01297 %{nil}
    01298
    01299 #%{__spec_install_body}\
    01300 #%{__spec_install_post}\
    01301 #%{nil}
    01302
    01303 %__spec_check_shell     %{___build_shell}
    01304 %__spec_check_args      %{___build_args}
    01305 %__spec_check_cmd       %{___build_cmd}
    01306 %__spec_check_pre       %{___build_pre}
    01307 %__spec_check_body      %{___build_body}
    01308 %__spec_check_post      %{___build_post}
    01309 %__spec_check_template  #!%{__spec_check_shell}\
    01310 %{__spec_check_pre}\
    01311 %{nil}
    01312
    01313 #%{__spec_check_body}\
    01314 #%{__spec_check_post}\
    01315 #%{nil}
    01316
    01317 #%__spec_autodep_shell  %{___build_shell}
    01318 #%__spec_autodep_args   %{___build_args}
    01319 #%__spec_autodep_cmd    %{___build_cmd}
    01320 #%__spec_autodep_pre    %{___build_pre}
    01321 #%__spec_autodep_body   %{___build_body}
    01322 #%__spec_autodep_post   %{___build_post}
    01323 #%__spec_autodep_template       #!%{__spec_autodep_shell}\
    01324 #%{__spec_autodep_pre}\
    01325 #%{nil}
    01326
    01327 #%{__spec_autodep_body}\
    01328 #%{__spec_autodep_post}\
    01329 #%{nil}
    01330
    01331 %__spec_clean_shell     %{___build_shell}
    01332 %__spec_clean_args      %{___build_args}
    01333 %__spec_clean_cmd       %{___build_cmd}
    01334 %__spec_clean_pre       %{___build_pre}
    01335 %__spec_clean_body      %{?buildroot:%{__rm} -rf '%{buildroot}'}\
    01336 %{nil}
    01337 %__spec_clean_post      %{nil}
    01338 %__spec_clean_template  #!%{__spec_clean_cmd}\
    01339 %{__spec_clean_pre}\
    01340 %{nil}
    01341
    01342 #%{__spec_clean_body}\
    01343 #%{__spec_clean_post}\
    01344 #%{nil}
    01345
    01346 %__spec_track_shell    %{___build_shell}
    01347 %__spec_track_args     %{___build_args}
    01348 %__spec_track_cmd      %{___build_cmd}
    01349 %__spec_track_pre      %{__vcheck} %{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD
    01350 %__spec_track_body     %{___build_body}
    01351 %__spec_track_post     GO_SYSIN_DD\
    01352 %{nil}
    01353 %__spec_track_template #!%{__spec_track_shell}\
    01354 %{__spec_track_pre}\
    01355 %{nil}
    01356
    01357 %__spec_sanitycheck_shell    %{___build_shell}
    01358 %__spec_sanitycheck_args     %{___build_args}
    01359 %__spec_sanitycheck_cmd      %{___build_cmd}
    01360 %__spec_sanitycheck_pre      %{___build_pre}
    01361 %__spec_sanitycheck_body     %{___build_body}
    01362 %__spec_sanitycheck_post     %{___build_post}
    01363 %__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\
    01364 %{__spec_sanitycheck_pre}\
    01365 %{nil}
    01366
    01367 %__spec_rmbuild_shell   %{___build_shell}
    01368 %__spec_rmbuild_args    %{___build_args}
    01369 %__spec_rmbuild_cmd     %{___build_cmd}
    01370 %__spec_rmbuild_pre     %{___build_pre}
    01371 %__spec_rmbuild_body    %{___build_body}
    01372 %__spec_rmbuild_post    %{___build_post}
    01373 %__spec_rmbuild_template        #!%{__spec_rmbuild_shell}\
    01374 %{__spec_rmbuild_pre}\
    01375 %{nil}
    01376
    01377 #%{__spec_rmbuild_body}\
    01378 #%{__spec_rmbuild_post}\
    01379 #%{nil}
    01380
    01381 # XXX We don't expand pre/post install scriptlets (yet).
    01382 #%__spec_pre_pre                %{nil}
    01383 #%__spec_pre_post               %{nil}
    01384 #%__spec_post_pre               %{nil}
    01385 #%__spec_post_post              %{nil}
    01386 #%__spec_preun_pre              %{nil}
    01387 #%__spec_preun_post             %{nil}
    01388 #%__spec_postun_pre             %{nil}
    01389 #%__spec_postun_post            %{nil}
    01390 #%__spec_triggerpostun_pre      %{nil}
    01391 #%__spec_triggerpostun_post     %{nil}
    01392 #%__spec_triggerun_pre          %{nil}
    01393 #%__spec_triggerun_post         %{nil}
    01394 #%__spec_triggerin_pre          %{nil}
    01395 #%__spec_triggerin_post         %{nil}
    01396
    01397 #==============================================================================
    01398 # ---- configure macros.
    01399 #       Macro(s) slavishly copied from autoconf's config.status.
    01400 #
    01401 %_prefix                /usr/local
    01402 %_exec_prefix           %{_prefix}
    01403 %_bindir                %{_exec_prefix}/bin
    01404 %_sbindir               %{_exec_prefix}/sbin
    01405 %_libexecdir            %{_exec_prefix}/libexec
    01406 %_datadir               %{_prefix}/share
    01407 %_sysconfdir            %{_prefix}/etc
    01408 %_sharedstatedir        %{_prefix}/com
    01409 %_localstatedir         %{_prefix}/var
    01410 %_lib                   lib
    01411 %_libdir                %{_exec_prefix}/%{_lib}
    01412 %_includedir            %{_prefix}/include
    01413 %_oldincludedir         /usr/include
    01414 %_infodir               %{_prefix}/info
    01415 %_mandir                %{_prefix}/man
    01416 %_localedir             %{_datadir}/locale
    01417
    01418 %_initrddir             %{_sysconfdir}/rc.d/init.d
    01419
    01420 #---------------------------------------------------------------------
    01421 #   Multilibs
    01422 %_multilibpatt  (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$
    01423
    01424 #==============================================================================
    01425 # ---- config.guess platform macros.
    01426 #       Macro(s) similar to the tokens used by configure.
    01427 #
    01428 %_build                 %{_host}
    01429 %_build_alias           %{_host_alias}
    01430 %_build_cpu             %{_host_cpu}
    01431 %_build_vendor          %{_host_vendor}
    01432 %_build_os              %{_host_os}
    01433 %_host                  sparc64-portbld-freebsd8.1
    01434 %_host_alias            %{nil}
    01435 %_host_cpu              sparc64
    01436 %_host_vendor           portbld
    01437 %_host_os               freebsd8.1
    01438 %_target                %{_host}
    01439 %_target_alias          %{_host_alias}
    01440 %_target_cpu            %{_host_cpu}
    01441 %_target_vendor         %{_host_vendor}
    01442 %_target_os             %{_host_os}
    01443
    01444 #==============================================================================
    01445 # ---- specfile macros.
    01446 #       Macro(s) here can be used reliably for reproducible builds.
    01447 #       (Note: Above is the goal, below are the macros under development)
    01448 #
    01449 # The configure macro does the following:
    01450 #       optionally change to a subdirectory (not implemented).
    01451 #       attempt to update config.guess and config.sub.
    01452 #       run configure with correct prefix, platform, and CFLAGS.
    01453 #       optionally restore current directory (not implemented).
    01454 # The configure macro should be invoked as %configure (rather than %{configure})
    01455 # because the rest of the arguments will be expanded using %*.
    01456 #
    01457 # This is the version of %configure used through rpm-3.0.4.
    01458 #%configure     \
    01459 #  %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
    01460 #  CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
    01461 #
    01462 #------------------------------------------------------------------------------
    01463 # This is an improved version of %configure (from PLD team).
    01464 %configure \
    01465   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
    01466   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
    01467   FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
    01468   ./configure --host=%{_host} --build=%{_build} \\\
    01469         --target=%{_target_platform} \\\
    01470         --program-prefix=%{?_program_prefix} \\\
    01471         --prefix=%{_prefix} \\\
    01472         --exec-prefix=%{_exec_prefix} \\\
    01473         --bindir=%{_bindir} \\\
    01474         --sbindir=%{_sbindir} \\\
    01475         --sysconfdir=%{_sysconfdir} \\\
    01476         --datadir=%{_datadir} \\\
    01477         --includedir=%{_includedir} \\\
    01478         --libdir=%{_libdir} \\\
    01479         --libexecdir=%{_libexecdir} \\\
    01480         --localstatedir=%{_localstatedir} \\\
    01481         --sharedstatedir=%{_sharedstatedir} \\\
    01482         --mandir=%{_mandir} \\\
    01483         --infodir=%{_infodir}
    01484
    01485 #------------------------------------------------------------------------------
    01486 # The make install analogue of %configure:
    01487 %makeinstall \
    01488   make \\\
    01489         prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
    01490         exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
    01491         bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
    01492         sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
    01493         sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
    01494         datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
    01495         includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
    01496         libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
    01497         libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
    01498         localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
    01499         sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
    01500         mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
    01501         infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
    01502   install
    01503
    01504 #------------------------------------------------------------------------------
    01505 # The GNUconfigure macro does the following:
    01506 #       update config.guess and config.sub.
    01507 #       regenerate all autoconf/automake files
    01508 #       optionally change to a directory (make the directory if requested).
    01509 #       run configure with correct prefix, platform, and CFLAGS.
    01510 #       optionally restore current directory.
    01511 #
    01512 # Based on autogen.sh from GNOME and orginal GNUconfigure
    01513 #
    01514 %GNUconfigure(MCs:)      \
    01515   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
    01516   LDFLAGS="${LDFLAGS:-%{-s:-s}}"  ; export LDFLAGS; \
    01517   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \
    01518   dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \
    01519     for coin in `echo ${dirs}` \
    01520 do \
    01521   dr=`dirname ${coin}`; \
    01522 if test -f ${dr}/NO-AUTO-GEN; then \
    01523  : \
    01524 else \
    01525      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
    01526     ( cd "${dr}"; \
    01527       aclocalinclude="${ACLOCAL_FLAGS}"; \
    01528       for k in ${macrodirs}; do \
    01529         if test -d ${k}; then \
    01530           aclocalinclude="${aclocalinclude} -I ${k}"; \
    01531         ##else \
    01532         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
    01533         fi \
    01534       done \
    01535       if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \
    01536         if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \
    01537           : do nothing -- we still have an old unmodified configure.[ai][cn] \
    01538         else \
    01539           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
    01540           echo "no" | gettextize --force --copy; \
    01541           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
    01542         fi \
    01543       fi \
    01544       if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \
    01545         %{__libtoolize} --force --copy; \
    01546       fi \
    01547       aclocal ${aclocalinclude}; \
    01548       if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \
    01549         %{__autoheader}; \
    01550       fi \
    01551       echo "Running automake --gnu ${am_opt} ..."; \
    01552       %{__automake} --add-missing --gnu ${am_opt}; \
    01553       %{__autoconf}; \
    01554     ); \
    01555   fi \
    01556 done \
    01557   %{-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} %* ; \
    01558   %{-C:cd "${_mydir}"; unset _mydir}
    01559
    01560 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
    01561 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
    01562
    01563 #------------------------------------------------------------------------------
    01564 # argument to pass to 'make' to run one job per cpu in parallel on smp systems.
    01565 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
    01566         && RPM_BUILD_NCPUS="`/usr/bin/getconf NPROCESSORS_ONLN`"; \\\
    01567         [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
    01568
    01569 #------------------------------------------------------------------------------
    01570 # arch macro for all Intel i?86 compatibile processors
    01571 #  (Note: This macro (and it's analogues) will probably be obsoleted when
    01572 #   rpm can use regular expressions against target platforms in macro
    01573 #   conditionals.
    01574 #
    01575 %ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
    01576
    01577 # same thing for arm
    01578 %arm    arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b armv5te armv5tel armv5teb xscale armv6 armv6l
    01579
    01580 # same for alpha
    01581 %alpha  alpha alphaev56 alphaev6 alphaev67
    01582
    01583 # and sparc
    01584 %sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
    01585
    01586 # add alternative sparc architectures macro (bugzilla #455972 patch)
    01587 %sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
    01588
    01589 # also for mips
    01590 %mips mips mips2 mips3 mips4 octeon
    01591 %mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel
    01592
    01593 %mipsx %mips %mipsel mips64 mips64el
    01594
    01595 #------------------------------------------------------------------------
    01596 # Use in %install to generate locale specific file lists. For example,
    01597 #
    01598 # %install
    01599 # ...
    01600 # %find_lang %{name}
    01601 # ...
    01602 # %files -f %{name}.lang
    01603 #
    01604 %find_lang      %{_rpmhome}/find-lang.sh %{buildroot}
    01605
    01606 #------------------------------------------------------------------------
    01607 # lua macros
    01608 #
    01609 #%rpm_license_check     %{expand:%%define rpm_license_check %{lua:\
    01610 #f = io.open("/dev/tty", "w")\
    01611 #if f then\
    01612 #    f:write ("\\nJust checking to see who is using rpm-5.2.1.\\nThe RPM Package Manager license is LGPL, as always.\\nRelax ...\\n")\
    01613 #    f:close()\
    01614 #end\
    01615 #}1}%{rpm_license_check}
    01616
    01617 #------------------------------------------------------------------------
    01618 # perl(...) configuration
    01619 #
    01620
    01621 # Path to scripts to autogenerate perl package dependencies,
    01622 #
    01623 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01624 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01625 #%__perl_provides       %{_rpmhome}/perldeps.pl --provides
    01626 #%__perl_requires       %{_rpmhome}/perldeps.pl --requires
    01627 %__perl_provides        %{_rpmhome}/perl.prov
    01628 %__perl_requires        %{_rpmhome}/perl.req
    01629
    01630 # Useful macros for building *.rpm perl packages.
    01631 #       (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
    01632 #
    01633 # For example, these can be used as (from ImageMagick.spec from PLD site)
    01634 #       [...]
    01635 #       BuildPrereq: perl
    01636 #       [...]
    01637 #       %package perl
    01638 #       Summary: libraries and modules for access to ImageMagick from perl
    01639 #       Group: Development/Languages/Perl
    01640 #       Requires: %{name} = %{version}
    01641 #       %requires_eq    perl
    01642 #       [...]
    01643 #       %install
    01644 #       rm -fr $RPM_BUILD_ROOT
    01645 #       install -d $RPM_BUILD_ROOT/%{perl_sitearch}
    01646 #       [...]
    01647 #       %files perl
    01648 #       %defattr(644,root,root,755)
    01649 #       %{perl_sitearch}/Image
    01650 #       %dir %{perl_sitearch}/auto/Image
    01651 #
    01652
    01653 %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")
    01654
    01655 %perl_sitearch  %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
    01656 %perl_sitelib   %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
    01657 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
    01658 %perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
    01659 %perl_archlib   %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
    01660 %perl_privlib   %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
    01661 %perl_version   %(eval "`%{__perl} -V:version`"; echo $version)
    01662
    01663 #------------------------------------------------------------------------
    01664 # python(...) configuration.
    01665 #
    01666 # Path to scripts to autogenerate python package dependencies,
    01667 #
    01668 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01669 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01670 %__python_provides      %{_rpmhome}/pythondeps.sh --provides
    01671 %__python_requires      %{_rpmhome}/pythondeps.sh --requires
    01672
    01673 # Useful macros for building *.rpm python packages (for python > 1.6).
    01674 #
    01675 %python_sitearch %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(1); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib")
    01676 %python_sitelib %(%{__python} -c "import os; from distutils.sysconfig import get_python_lib; lib=get_python_lib(); print os.path.islink(lib) and os.path.abspath(os.path.join(os.path.dirname(lib),os.readlink(lib))) or lib")
    01677 %python_version %(%{__python} -c "import sys; print(sys.version[0:3])")
    01678
    01679 %py_compile(O)  \
    01680 find %1 -name '*.pyc' -name '*.pyo' -exec rm -f {} \\; \
    01681 %{__python} %{?O:-O} -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
    01682
    01683 %py_requires(d) \
    01684 %define maxver %(%{__python} -c "import sys; a,b=sys.version_info[:2]; print '%%d.%%d'%%(a,b+1)" 2>/dev/null || echo PYTHON-NOT-FOUND) \
    01685 BuildRequires: python %{-d:python-devel} \
    01686 PreReq: python >= %{python_version}, python < %{maxver}
    01687
    01688 #------------------------------------------------------------------------
    01689 # php(...) configuration.
    01690 #
    01691 # Path to scripts to autogenerate php package dependencies,
    01692 #
    01693 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01694 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01695 #%__php_provides        %{_rpmhome}/phpdeps.sh --provides
    01696 #%__php_requires        %{_rpmhome}/phpdeps.sh --requires
    01697 #%__php_provides                %{_rpmhome}/php.prov
    01698 #%__php_requires                %{_rpmhome}/php.req
    01699
    01700 #------------------------------------------------------------------------
    01701 # java(...) configuration.
    01702 #
    01703 # Path to scripts to autogenerate java package dependencies,
    01704 #
    01705 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01706 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01707 %__java_provides        %{_rpmhome}/javadeps.sh --provides
    01708 %__java_requires        %{_rpmhome}/javadeps.sh --requires
    01709
    01710 #------------------------------------------------------------------------
    01711 # libtool(...) configuration.
    01712 #
    01713 # Path to scripts to autogenerate libtool package dependencies,
    01714 #
    01715 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01716 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01717 %__libtool_provides     %{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name}
    01718 %__libtool_requires     %{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name}
    01719
    01720 #------------------------------------------------------------------------
    01721 # pkgconfig(...) configuration.
    01722 #
    01723 # Path to scripts to autogenerate pkgconfig package dependencies,
    01724 #
    01725 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01726 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01727 %__pkgconfig_provides   %{_rpmhome}/pkgconfigdeps.sh --provides
    01728 %__pkgconfig_requires   %{_rpmhome}/pkgconfigdeps.sh --requires
    01729
    01730 #------------------------------------------------------------------------
    01731 # mono(...) configuration.
    01732 #
    01733 # Path to scripts to autogenerate mono package dependencies,
    01734 #
    01735 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01736 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01737 %__mono_provides        %{_rpmhome}/mono-find-provides
    01738 %__mono_requires        %{_rpmhome}/mono-find-requires
    01739
    01740 #------------------------------------------------------------------------
    01741 # executable(...) configuration.
    01742 #
    01743 # Path to scripts to autogenerate executable(foo) script dependencies,
    01744 #
    01745 # Note: Used iff _use_internal_dependency_generator is non-zero. The
    01746 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
    01747 #%__executable_provides %{_rpmhome}/executabledeps.sh --provides
    01748 #%__executable_requires %{_rpmhome}/executabledeps.sh --requires
    01749 %__scriptlet_requires   %{__bash} --rpm-requires
    01750
    01751 # \endverbatim
    01752 #*/