rpm  5.2.1
macros
Go to the documentation of this file.
1 #
1036 %_rpmgi_pattern_regex() ^.+/%1-[^-]+-[^-]+\\.[^.]+\\.rpm$
1037 
1038 #
1039 # UUIDv3/UUIDv5 namespace URI macros. The complete canonical path is
1040 # %_uuid_uri %{?_uuid_auth}/%{?_uuid_path}/Tagname/Tagvalue
1041 %_uuid_auth http://rpm5.org/
1042 %_uuid_path /package
1043 
1044 #==============================================================================
1045 # ---- EVRD... dependency tuple comparison macros.
1046 #
1047 
1048 # STEP 1: Match the string and capture regex parts
1049 # 1 2 3 4
1050 # X ":" X "-"X ":"X
1051 %evr_tuple_match ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$
1052 
1053 # STEP 2: Assemble <E,V,R,D> tuple from regex parts
1054 # <E,V,R,D> case 1: case 2: case 3: case 4: case 5: case 6:
1055 # X:X-X:X X:X-X X:X X: X-X X
1056 # %evr_tuple_select 1234 123_ 12__ 1___ _23_ _2__
1057 %evr_tuple_select 123_
1058 
1059 # STEP 3: Configure the comparison order of the <E,V,R,D> tuple elements
1060 %evr_tuple_order EVR
1061 
1062 # data validation patterns for identifier tags
1063 %pattern_Name ^[A-Za-z0-9][A-Za-z0-9+._-]*$
1064 %pattern_Epoch ^[0-9]+$
1065 %pattern_Version ^[A-Za-z0-9+._]+$
1066 %pattern_Release ^[A-Za-z0-9+._]+$
1067 %pattern_Disttag ^[A-Za-z0-9]+$
1068 %pattern_Repotag ^[A-Za-z0-9]+$
1069 %pattern_Distepoch ^[A-Za-z0-9.]+$
1070 #%pattern_Url
1071 #%pattern_Cvsid
1072 #%pattern_Group
1073 #%pattern_Summary
1074 #%pattern_Distribution
1075 #%pattern_Vendor
1076 #%pattern_License
1077 #%pattern_Packager
1078 #%pattern_Buildroot
1079 #%pattern_Keywords
1080 #%pattern_Variants
1081 #%pattern_Prefixes
1082 #%pattern_Docdir
1083 #%pattern_Xmajor
1084 #%pattern_Xminor
1085 #%pattern_Autoreqprov
1086 #%pattern_Autoreq
1087 #%pattern_Autoprov
1088 #%pattern_Source
1089 #%pattern_Patch
1090 #%pattern_Icon
1091 #%pattern_Nosource
1092 #%pattern_Nopatch
1093 #%pattern_Buildprereq
1094 #%pattern_Buildprovides
1095 #%pattern_Buildrequires
1096 #%pattern_Buildconflicts
1097 #%pattern_Buildobsoletes
1098 #%pattern_Buildsuggests
1099 #%pattern_Buildenhances
1100 #%pattern_Prereq
1101 #%pattern_Provideflags
1102 #%pattern_Requireflags
1103 #%pattern_Conflictflags
1104 #%pattern_Obsoleteflags
1105 #%pattern_Suggestsflags
1106 #%pattern_Enhancesflags
1107 #%pattern_Buildplatforms
1108 #%pattern_Excludearch
1109 #%pattern_Exclusivearch
1110 #%pattern_Excludeos
1111 #%pattern_Exclusiveos
1112 #%pattern_Buildarchs
1113 
1114 #==============================================================================
1115 # ---- Run-time probe dependency macros.
1116 
1117 #
1118 %_rpmds_filter_name archfilter
1119 
1120 #
1121 %_rpmds_cpuinfo_path /proc/cpuinfo
1122 
1123 #
1124 %_rpmds_sysinfo_path %{_etcrpm}/sysinfo
1125 
1126 #
1127 %_rpmds_ldconfig_cmd /sbin/ldconfig -p
1128 %_rpmds_ldconfig_cache /etc/ld.so.cache
1129 
1130 # A colon-separated list of directories which should match the rld's
1131 # (runtime loader) list of directories it searches for shared objects.
1132 # Only used on platforms that don't have a configurable loader search
1133 # path via ldconfig, crle, or something similar.
1134 #%_rpmds_rld_search_path /lib:/usr/lib
1135 
1136 #
1137 # Full path and arguments to Solaris' command to list what directories
1138 # the runtime loader searches. Needs to include `-64' for LP64 Solaris
1139 # systems.
1140 #%_rpmds_crle_cmd /usr/bin/crle
1141 
1142 #
1143 %_rpmds_getconf_path /
1144 
1145 #
1146 %_rpmds_perldeps_cmd %{__find} %{_libdir}/perl5 | %{_rpmhome}/perl.prov
1147 
1148 #
1149 %_varrun /var/run
1150 
1151 #==============================================================================
1152 # ---- Cache configuration macros.
1153 # Macro(s) used to configure the universe of headers used to
1154 # solve dependencies using rpmcache(8).
1155 #
1156 # Note: These values were specific to my machine, and most certainly
1157 # are incorrect for any other machine. The macros are
1158 # included here only to document the macro names and usage.
1159 #%_bhpath file://localhost/mnt/dist
1160 #%_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)
1161 #%_bhN @(SRPMS|i386|alpha|sparc|s390|ia64)
1162 #%_bhVR @(RedHat|Fedora)
1163 #%_bhA RPMS
1164 
1165 #
1166 # A configuration to build an rpmdb from yum package hierarchy
1167 %_bhpath file:
1168 %_bhcoll @(updates)
1169 %_bhN @(packages)
1170 %_bhVR %{nil}
1171 %_bhA %{nil}
1172 
1173 # The cache database directory.
1174 %_cache_dbpath /var/cache/yum/rpmdb
1175 
1176 #==============================================================================
1177 # ---- per-platform macros.
1178 # Macros that are specific to an individual platform. The values here
1179 # will be used if the per-platform macro file does not exist..
1180 #
1181 %_arch ia64
1182 %_build_arch ia64
1183 %_vendor portbld
1184 %_os freebsd
1185 %_gnu %{nil}
1186 
1187 %_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
1188 %_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
1189 %_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
1190 
1191 #
1192 # Define a generic value for optflags. Normally overridden by per-target macros.
1193 %optflags -O2
1194 
1195 #
1196 # Define per-arch and per-os defaults. Normally overridden by per-target macros.
1197 %__arch_install_post %{nil}
1198 %__os_install_post %{___build_post}
1199 
1200 #==============================================================================
1201 # ---- Scriptlet template templates.
1202 # Global defaults used for building scriptlet templates.
1203 #
1204 
1205 %___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
1206 %___build_args -e
1207 %___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
1208 %___build_pre \
1209  RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
1210  RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
1211  RPM_OPT_FLAGS=\"%{optflags}\"\
1212  RPM_ARCH=\"%{_arch}\"\
1213  RPM_OS=\"%{_os}\"\
1214  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
1215  RPM_DOC_DIR=\"%{_docdir}\"\
1216  export RPM_DOC_DIR\
1217  RPM_PACKAGE_NAME=\"%{name}\"\
1218  RPM_PACKAGE_VERSION=\"%{version}\"\
1219  RPM_PACKAGE_RELEASE=\"%{release}\"\
1220  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
1221  %{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
1222  export RPM_BUILD_ROOT}\
1223  %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
1224  export CLASSPATH}\
1225  unset PERL_MM_OPT || :\
1226  LC_ALL=C\
1227  export LC_ALL\
1228  LANG=C\
1229  export LANG\
1230  unset DISPLAY || :\
1231  unset LINGUAS || :\
1232  unset LANGUAGE || :\
1233  unset LC_MESSAGES || :\
1234  \
1235  %{verbose:set -x}%{!verbose:exec > /dev/null}\
1236  umask 022\
1237  cd "%{u2p:%{_builddir}}"\
1238 
1239 
1240 #%___build_body %{nil}
1241 %___build_post exit 0
1242 
1243 %___build_template #!%{___build_shell}\
1244 %{___build_pre}\
1245 %{nil}
1246 
1247 #%{___build_body}\
1248 #%{___build_post}\
1249 #%{nil}
1250 
1251 #==============================================================================
1252 # ---- Scriptlet templates.
1253 # Macro(s) that expand to a command and script that is executed.
1254 # CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
1255 #
1256 %__spec_prep_shell %{___build_shell}
1257 %__spec_prep_args %{___build_args}
1258 %__spec_prep_cmd %{___build_cmd}
1259 %__spec_prep_pre %{___build_pre}
1260 %__spec_prep_body %{___build_body}
1261 %__spec_prep_post %{___build_post}
1262 %__spec_prep_template #!%{__spec_prep_shell}\
1263 %{__spec_prep_pre}\
1264 %{nil}
1265 
1266 #%{__spec_prep_body}\
1267 #%{__spec_prep_post}\
1268 #%{nil}
1269 
1270 %__spec_build_shell %{___build_shell}
1271 %__spec_build_args %{___build_args}
1272 %__spec_build_cmd %{___build_cmd}
1273 %__spec_build_pre %{___build_pre}
1274 %__spec_build_body %{___build_body}
1275 %__spec_build_post %{___build_post}
1276 %__spec_build_template #!%{__spec_build_shell}\
1277 %{__spec_build_pre}\
1278 %{nil}
1279 
1280 #%{__spec_build_body}\
1281 #%{__spec_build_post}\
1282 #%{nil}
1283 
1284 %__spec_install_shell %{___build_shell}
1285 %__spec_install_args %{___build_args}
1286 %__spec_install_cmd %{___build_cmd}
1287 %__spec_install_pre %{___build_pre}\
1288 %{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
1289 %__spec_install_body %{___build_body}
1290 %__spec_install_post\
1291 %{?__debug_package:%{__debug_install_post}}\
1292 %{__arch_install_post}\
1293 %{__os_install_post}\
1294 %{nil}
1295 %__spec_install_template #!%{__spec_install_shell}\
1296 %{__spec_install_pre}\
1297 %{nil}
1298 
1299 #%{__spec_install_body}\
1300 #%{__spec_install_post}\
1301 #%{nil}
1302 
1303 %__spec_check_shell %{___build_shell}
1304 %__spec_check_args %{___build_args}
1305 %__spec_check_cmd %{___build_cmd}
1306 %__spec_check_pre %{___build_pre}
1307 %__spec_check_body %{___build_body}
1308 %__spec_check_post %{___build_post}
1309 %__spec_check_template #!%{__spec_check_shell}\
1310 %{__spec_check_pre}\
1311 %{nil}
1312 
1313 #%{__spec_check_body}\
1314 #%{__spec_check_post}\
1315 #%{nil}
1316 
1317 #%__spec_autodep_shell %{___build_shell}
1318 #%__spec_autodep_args %{___build_args}
1319 #%__spec_autodep_cmd %{___build_cmd}
1320 #%__spec_autodep_pre %{___build_pre}
1321 #%__spec_autodep_body %{___build_body}
1322 #%__spec_autodep_post %{___build_post}
1323 #%__spec_autodep_template #!%{__spec_autodep_shell}\
1324 #%{__spec_autodep_pre}\
1325 #%{nil}
1326 
1327 #%{__spec_autodep_body}\
1328 #%{__spec_autodep_post}\
1329 #%{nil}
1330 
1331 %__spec_clean_shell %{___build_shell}
1332 %__spec_clean_args %{___build_args}
1333 %__spec_clean_cmd %{___build_cmd}
1334 %__spec_clean_pre %{___build_pre}
1335 %__spec_clean_body %{?buildroot:%{__rm} -rf '%{buildroot}'}\
1336 %{nil}
1337 %__spec_clean_post %{nil}
1338 %__spec_clean_template #!%{__spec_clean_cmd}\
1339 %{__spec_clean_pre}\
1340 %{nil}
1341 
1342 #%{__spec_clean_body}\
1343 #%{__spec_clean_post}\
1344 #%{nil}
1345 
1346 %__spec_track_shell %{___build_shell}
1347 %__spec_track_args %{___build_args}
1348 %__spec_track_cmd %{___build_cmd}
1349 %__spec_track_pre %{__vcheck} %{verbose:--verbose}%{!verbose:--noverbose} -f - << GO_SYSIN_DD
1350 %__spec_track_body %{___build_body}
1351 %__spec_track_post GO_SYSIN_DD\
1352 %{nil}
1353 %__spec_track_template #!%{__spec_track_shell}\
1354 %{__spec_track_pre}\
1355 %{nil}
1356 
1357 %__spec_sanitycheck_shell %{___build_shell}
1358 %__spec_sanitycheck_args %{___build_args}
1359 %__spec_sanitycheck_cmd %{___build_cmd}
1360 %__spec_sanitycheck_pre %{___build_pre}
1361 %__spec_sanitycheck_body %{___build_body}
1362 %__spec_sanitycheck_post %{___build_post}
1363 %__spec_sanitycheck_template #!%{__spec_sanitycheck_shell}\
1364 %{__spec_sanitycheck_pre}\
1365 %{nil}
1366 
1367 %__spec_rmbuild_shell %{___build_shell}
1368 %__spec_rmbuild_args %{___build_args}
1369 %__spec_rmbuild_cmd %{___build_cmd}
1370 %__spec_rmbuild_pre %{___build_pre}
1371 %__spec_rmbuild_body %{___build_body}
1372 %__spec_rmbuild_post %{___build_post}
1373 %__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
1374 %{__spec_rmbuild_pre}\
1375 %{nil}
1376 
1377 #%{__spec_rmbuild_body}\
1378 #%{__spec_rmbuild_post}\
1379 #%{nil}
1380 
1381 # XXX We don't expand pre/post install scriptlets (yet).
1382 #%__spec_pre_pre %{nil}
1383 #%__spec_pre_post %{nil}
1384 #%__spec_post_pre %{nil}
1385 #%__spec_post_post %{nil}
1386 #%__spec_preun_pre %{nil}
1387 #%__spec_preun_post %{nil}
1388 #%__spec_postun_pre %{nil}
1389 #%__spec_postun_post %{nil}
1390 #%__spec_triggerpostun_pre %{nil}
1391 #%__spec_triggerpostun_post %{nil}
1392 #%__spec_triggerun_pre %{nil}
1393 #%__spec_triggerun_post %{nil}
1394 #%__spec_triggerin_pre %{nil}
1395 #%__spec_triggerin_post %{nil}
1396 
1397 #==============================================================================
1398 # ---- configure macros.
1399 # Macro(s) slavishly copied from autoconf's config.status.
1400 #
1401 %_prefix /usr/local
1402 %_exec_prefix %{_prefix}
1403 %_bindir %{_exec_prefix}/bin
1404 %_sbindir %{_exec_prefix}/sbin
1405 %_libexecdir %{_exec_prefix}/libexec
1406 %_datadir %{_prefix}/share
1407 %_sysconfdir %{_prefix}/etc
1408 %_sharedstatedir %{_prefix}/com
1409 %_localstatedir %{_prefix}/var
1410 %_lib lib
1411 %_libdir %{_exec_prefix}/%{_lib}
1412 %_includedir %{_prefix}/include
1413 %_oldincludedir /usr/include
1414 %_infodir %{_prefix}/info
1415 %_mandir %{_prefix}/man
1416 %_localedir %{_datadir}/locale
1417 
1418 %_initrddir %{_sysconfdir}/rc.d/init.d
1419 
1420 #---------------------------------------------------------------------
1421 # Multilibs
1422 %_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$
1423 
1424 #==============================================================================
1425 # ---- config.guess platform macros.
1426 # Macro(s) similar to the tokens used by configure.
1427 #
1428 %_build %{_host}
1429 %_build_alias %{_host_alias}
1430 %_build_cpu %{_host_cpu}
1431 %_build_vendor %{_host_vendor}
1432 %_build_os %{_host_os}
1433 %_host ia64-portbld-freebsd9.1
1434 %_host_alias %{nil}
1435 %_host_cpu ia64
1436 %_host_vendor portbld
1437 %_host_os freebsd9.1
1438 %_target %{_host}
1439 %_target_alias %{_host_alias}
1440 %_target_cpu %{_host_cpu}
1441 %_target_vendor %{_host_vendor}
1442 %_target_os %{_host_os}
1443 
1444 #==============================================================================
1445 # ---- specfile macros.
1446 # Macro(s) here can be used reliably for reproducible builds.
1447 # (Note: Above is the goal, below are the macros under development)
1448 #
1449 # The configure macro does the following:
1450 # optionally change to a subdirectory (not implemented).
1451 # attempt to update config.guess and config.sub.
1452 # run configure with correct prefix, platform, and CFLAGS.
1453 # optionally restore current directory (not implemented).
1454 # The configure macro should be invoked as %configure (rather than %{configure})
1455 # because the rest of the arguments will be expanded using %*.
1456 #
1457 # This is the version of %configure used through rpm-3.0.4.
1458 #%configure \
1459 # %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
1460 # CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix}
1461 #
1462 #------------------------------------------------------------------------------
1463 # This is an improved version of %configure (from PLD team).
1464 %configure \
1465  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
1466  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
1467  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
1468  ./configure --host=%{_host} --build=%{_build} \\\
1469  --target=%{_target_platform} \\\
1470  --program-prefix=%{?_program_prefix} \\\
1471  --prefix=%{_prefix} \\\
1472  --exec-prefix=%{_exec_prefix} \\\
1473  --bindir=%{_bindir} \\\
1474  --sbindir=%{_sbindir} \\\
1475  --sysconfdir=%{_sysconfdir} \\\
1476  --datadir=%{_datadir} \\\
1477  --includedir=%{_includedir} \\\
1478  --libdir=%{_libdir} \\\
1479  --libexecdir=%{_libexecdir} \\\
1480  --localstatedir=%{_localstatedir} \\\
1481  --sharedstatedir=%{_sharedstatedir} \\\
1482  --mandir=%{_mandir} \\\
1483  --infodir=%{_infodir}
1484 
1485 #------------------------------------------------------------------------------
1486 # The make install analogue of %configure:
1487 %makeinstall \
1488  make \\\
1489  prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
1490  exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
1491  bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
1492  sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
1493  sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
1494  datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
1495  includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
1496  libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
1497  libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
1498  localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
1499  sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
1500  mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
1501  infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
1502  install
1503 
1504 #------------------------------------------------------------------------------
1505 # The GNUconfigure macro does the following:
1506 # update config.guess and config.sub.
1507 # regenerate all autoconf/automake files
1508 # optionally change to a directory (make the directory if requested).
1509 # run configure with correct prefix, platform, and CFLAGS.
1510 # optionally restore current directory.
1511 #
1512 # Based on autogen.sh from GNOME and orginal GNUconfigure
1513 #
1514 %GNUconfigure(MCs:) \
1515  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
1516  LDFLAGS="${LDFLAGS:-%{-s:-s}}" ; export LDFLAGS; \
1517  %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p "%{-C*}";} cd "%{-C*}"} \
1518  dirs="`find ${_mydir} -name 'configure.[ai][cn]' -print`"; export dirs; \
1519  for coin in `echo ${dirs}` \
1520 do \
1521  dr=`dirname ${coin}`; \
1522 if test -f ${dr}/NO-AUTO-GEN; then \
1523  : \
1524 else \
1525  macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
1526  ( cd "${dr}"; \
1527  aclocalinclude="${ACLOCAL_FLAGS}"; \
1528  for k in ${macrodirs}; do \
1529  if test -d ${k}; then \
1530  aclocalinclude="${aclocalinclude} -I ${k}"; \
1531  ##else \
1532  ## echo "**Warning**: No such directory \`${k}'. Ignored." \
1533  fi \
1534  done \
1535  if grep "^AM_GNU_GETTEXT" configure.[ai][cn] >/dev/null; then \
1536  if grep "sed.*POTFILES" configure.[ai][cn] >/dev/null; then \
1537  : do nothing -- we still have an old unmodified configure.[ai][cn] \
1538  else \
1539  test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
1540  echo "no" | gettextize --force --copy; \
1541  test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
1542  fi \
1543  fi \
1544  if grep "^AM_PROG_LIBTOOL" configure.[ai][cn] >/dev/null; then \
1545  %{__libtoolize} --force --copy; \
1546  fi \
1547  aclocal ${aclocalinclude}; \
1548  if grep "^AM_CONFIG_HEADER" configure.[ai][cn] >/dev/null; then \
1549  %{__autoheader}; \
1550  fi \
1551  echo "Running automake --gnu ${am_opt} ..."; \
1552  %{__automake} --add-missing --gnu ${am_opt}; \
1553  %{__autoconf}; \
1554  ); \
1555  fi \
1556 done \
1557  %{-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} %* ; \
1558  %{-C:cd "${_mydir}"; unset _mydir}
1559 
1560 %patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
1561 %sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
1562 
1563 #------------------------------------------------------------------------------
1564 # argument to pass to 'make' to run one job per cpu in parallel on smp systems.
1565 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
1566  && RPM_BUILD_NCPUS="`/usr/bin/getconf NPROCESSORS_ONLN`"; \\\
1567  [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
1568 
1569 #------------------------------------------------------------------------------
1570 # arch macro for all Intel i?86 compatibile processors
1571 # (Note: This macro (and it's analogues) will probably be obsoleted when
1572 # rpm can use regular expressions against target platforms in macro
1573 # conditionals.
1574 #
1575 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon
1576 
1577 # same thing for arm
1578 %arm arm armv3 armv3l armv3b armv4 armv4l armv4b armv5 armv5l armv5b armv5te armv5tel armv5teb xscale armv6 armv6l
1579 
1580 # same for alpha
1581 %alpha alpha alphaev56 alphaev6 alphaev67
1582 
1583 # and sparc
1584 %sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
1585 
1586 # add alternative sparc architectures macro (bugzilla #455972 patch)
1587 %sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
1588 
1589 # also for mips
1590 %mips mips mips2 mips3 mips4 octeon
1591 %mipsel mipsel mips2el mips3el mips4el loongson2e loongson2f octeonel
1592 
1593 %mipsx %mips %mipsel mips64 mips64el
1594 
1595 #------------------------------------------------------------------------
1596 # Use in %install to generate locale specific file lists. For example,
1597 #
1598 # %install
1599 # ...
1600 # %find_lang %{name}
1601 # ...
1602 # %files -f %{name}.lang
1603 #
1604 %find_lang %{_rpmhome}/find-lang.sh %{buildroot}
1605 
1606 #------------------------------------------------------------------------
1607 # lua macros
1608 #
1609 #%rpm_license_check %{expand:%%define rpm_license_check %{lua:\
1610 #f = io.open("/dev/tty", "w")\
1611 #if f then\
1612 # f:write ("\\nJust checking to see who is using rpm-5.2.1.\\nThe RPM Package Manager license is LGPL, as always.\\nRelax ...\\n")\
1613 # f:close()\
1614 #end\
1615 #}1}%{rpm_license_check}
1616 
1617 #------------------------------------------------------------------------
1618 # perl(...) configuration
1619 #
1620 
1621 # Path to scripts to autogenerate perl package dependencies,
1622 #
1623 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1624 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1625 #%__perl_provides %{_rpmhome}/perldeps.pl --provides
1626 #%__perl_requires %{_rpmhome}/perldeps.pl --requires
1627 %__perl_provides %{_rpmhome}/perl.prov
1628 %__perl_requires %{_rpmhome}/perl.req
1629 
1630 # Useful macros for building *.rpm perl packages.
1631 # (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
1632 #
1633 # For example, these can be used as (from ImageMagick.spec from PLD site)
1634 # [...]
1635 # BuildPrereq: perl
1636 # [...]
1637 # %package perl
1638 # Summary: libraries and modules for access to ImageMagick from perl
1639 # Group: Development/Languages/Perl
1640 # Requires: %{name} = %{version}
1641 # %requires_eq perl
1642 # [...]
1643 # %install
1644 # rm -fr $RPM_BUILD_ROOT
1645 # install -d $RPM_BUILD_ROOT/%{perl_sitearch}
1646 # [...]
1647 # %files perl
1648 # %defattr(644,root,root,755)
1649 # %{perl_sitearch}/Image
1650 # %dir %{perl_sitearch}/auto/Image
1651 #
1652 
1653 %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")
1654 
1655 %perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
1656 %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
1657 %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
1658 %perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
1659 %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
1660 %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
1661 %perl_version %(eval "`%{__perl} -V:version`"; echo $version)
1662 
1663 #------------------------------------------------------------------------
1664 # python(...) configuration.
1665 #
1666 # Path to scripts to autogenerate python package dependencies,
1667 #
1668 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1669 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1670 %__python_provides %{_rpmhome}/pythondeps.sh --provides
1671 %__python_requires %{_rpmhome}/pythondeps.sh --requires
1672 
1673 # Useful macros for building *.rpm python packages (for python > 1.6).
1674 #
1675 %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")
1676 %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")
1677 %python_version %(%{__python} -c "import sys; print(sys.version[0:3])")
1678 
1679 %py_compile(O) \
1680 find %1 -name '*.pyc' -name '*.pyo' -exec rm -f {} \\; \
1681 %{__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 \
1682 
1683 %py_requires(d) \
1684 %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) \
1685 BuildRequires: python %{-d:python-devel} \
1686 PreReq: python >= %{python_version}, python < %{maxver}
1687 
1688 #------------------------------------------------------------------------
1689 # php(...) configuration.
1690 #
1691 # Path to scripts to autogenerate php package dependencies,
1692 #
1693 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1694 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1695 #%__php_provides %{_rpmhome}/phpdeps.sh --provides
1696 #%__php_requires %{_rpmhome}/phpdeps.sh --requires
1697 #%__php_provides %{_rpmhome}/php.prov
1698 #%__php_requires %{_rpmhome}/php.req
1699 
1700 #------------------------------------------------------------------------
1701 # java(...) configuration.
1702 #
1703 # Path to scripts to autogenerate java package dependencies,
1704 #
1705 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1706 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1707 %__java_provides %{_rpmhome}/javadeps.sh --provides
1708 %__java_requires %{_rpmhome}/javadeps.sh --requires
1709 
1710 #------------------------------------------------------------------------
1711 # libtool(...) configuration.
1712 #
1713 # Path to scripts to autogenerate libtool package dependencies,
1714 #
1715 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1716 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1717 %__libtool_provides %{_rpmhome}/libtooldeps.sh --provides %{buildroot} %{name}
1718 %__libtool_requires %{_rpmhome}/libtooldeps.sh --requires %{buildroot} %{name}
1719 
1720 #------------------------------------------------------------------------
1721 # pkgconfig(...) configuration.
1722 #
1723 # Path to scripts to autogenerate pkgconfig package dependencies,
1724 #
1725 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1726 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1727 %__pkgconfig_provides %{_rpmhome}/pkgconfigdeps.sh --provides
1728 %__pkgconfig_requires %{_rpmhome}/pkgconfigdeps.sh --requires
1729 
1730 #------------------------------------------------------------------------
1731 # mono(...) configuration.
1732 #
1733 # Path to scripts to autogenerate mono package dependencies,
1734 #
1735 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1736 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1737 %__mono_provides %{_rpmhome}/mono-find-provides
1738 %__mono_requires %{_rpmhome}/mono-find-requires
1739 
1740 #------------------------------------------------------------------------
1741 # executable(...) configuration.
1742 #
1743 # Path to scripts to autogenerate executable(foo) script dependencies,
1744 #
1745 # Note: Used iff _use_internal_dependency_generator is non-zero. The
1746 # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
1747 #%__executable_provides %{_rpmhome}/executabledeps.sh --provides
1748 #%__executable_requires %{_rpmhome}/executabledeps.sh --requires
1749 %__scriptlet_requires %{__bash} --rpm-requires
1750 
1751 # \endverbatim
1752 #*/