X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=macros.in;h=a7cab871d1a1271b80a87b2835cbbbd16e672aed;hb=9cf156d6583a9f9581000bb12ff047980ebcef03;hp=4c77bbbe3825b20bc50eaad4f78ebc9d15d6ce96;hpb=5322c3bd4bb99e9f1221eeddaf8de4da0f729e99;p=platform%2Fupstream%2Frpm.git diff --git a/macros.in b/macros.in index 4c77bbb..a7cab87 100644 --- a/macros.in +++ b/macros.in @@ -179,29 +179,32 @@ # A spec file can %%define _find_debuginfo_opts to pass options to # the script. See the script for details. # + +%_find_debuginfo_opts %{?_rpm_strip_disable:--strip-disable} +%_find_debuginfo_strip_opts %{?_rpm_strip_option:\'--strip-option=%{_rpm_strip_option}\'} + %__debug_install_post \ - %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ + %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} %{?_find_debuginfo_strip_opts} "%{_builddir}/%{?buildsubdir}"\ %{nil} # Template for debug information sub-package. %debug_package \ -%ifnarch noarch\ %global __debug_package 1\ -%package debug\ -Summary: Debug information for package %{name}\ +%package debugsource\ +Summary: Debug sources for package %{name}\ Group: Development/Debug\ AutoReqProv: 0\ -%description debug\ -This package provides debug information for package %{name}.\ -Debug information is useful when developing applications that use this\ +%description debugsource\ +This package provides debug sources for package %{name}.\ +Debug sources are useful when developing applications that use this\ package or when debugging this package.\ -%files debug -f debugfiles.list\ +%files debugsource -f debugsources.list\ %defattr(-,root,root)\ -%endif\ %{nil} -%_defaultdocdir %{_datadir}/doc +%_defaultdocdir %{_datadir}/doc/packages %_defaultlicensedir %{_datadir}/licenses +%_docdir_fmt %%{NAME} # The path to the gzip executable (legacy, use %{__gzip} instead). %_gzipbin %{__gzip} @@ -238,7 +241,8 @@ package or when debugging this package.\ %_tmppath %{_var}/tmp # Path to top of build area. -%_topdir %{getenv:HOME}/rpmbuild +%_topdir %{expand:%%global _topdir %{lua:if posix.access(rpm.expand("%{_usrsrc}/packages"), "w") then print "%{_usrsrc}/packages" else print "%{getenv:HOME}/rpmbuild" end} \ +}%_topdir # The path to the unzip executable (legacy, use %{__unzip} instead). %_unzipbin %{__unzip} @@ -341,7 +345,7 @@ package or when debugging this package.\ # "w7.lzdio" lzma-alone level 7, lzma's default # #%_source_payload w9.gzdio -#%_binary_payload w9.gzdio +%_binary_payload w5.lzdio # Algorithm to use for generating file checksum digests on build. # If not specified or 0, MD5 is used. @@ -365,7 +369,7 @@ package or when debugging this package.\ %_default_patch_fuzz 0 # Default patch flags -%_default_patch_flags -s +#%_default_patch_flags -s #============================================================================== # ---- Build configuration macros. @@ -440,16 +444,26 @@ package or when debugging this package.\ # Directories whose contents should be considered as documentation. %__docdir_path %{_datadir}/doc:%{_datadir}/man:%{_datadir}/info:%{_datadir}/gtk-doc/html:%{?_docdir}:%{?_mandir}:%{?_infodir}:%{?_javadocdir}:/usr/doc:/usr/man:/usr/info:/usr/X11R6/man +# maxnum,cuttime,minnum +# 2009/03/01 (SLES11 GA) +%_binarychangelogtrim 0,1235862000,10 + # # Path to scripts to autogenerate package dependencies, # +%__set_helper_env %{lua: +posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile")); +posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir")); +} # Note: Used iff _use_internal_dependency_generator is zero. #%__find_provides %{_rpmconfigdir}/rpmdeps --provides #%__find_requires %{_rpmconfigdir}/rpmdeps --requires -%__find_provides %{_rpmconfigdir}/find-provides -%__find_requires %{_rpmconfigdir}/find-requires +%__find_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides %name +%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name #%__find_conflicts ??? #%__find_obsoletes ??? +%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name +#%__find_enhances ??? # # Path to file attribute classifications for automatic dependency @@ -512,10 +526,10 @@ package or when debugging this package.\ # Misc BDB tuning options %__dbi_other mp_mmapsize=128Mb mp_size=1Mb -%_dbi_config %{?__dbi_other} +%_dbi_config %{?__dbi_other} nofsync # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd". -%_dbi_config_Packages %{?_dbi_config} lockdbfd +%_dbi_config_Packages %{?__dbi_other} lockdbfd #============================================================================== # ---- GPG/PGP/PGP5 signature macros. @@ -814,7 +828,7 @@ package or when debugging this package.\ %_build_vendor %{_host_vendor} %_build_os %{_host_os} %_host @host@ -%_host_alias @host_alias@%{nil} +%_host_alias @host@%{nil} %_host_cpu @host_cpu@ %_host_vendor @host_vendor@ %_host_os @host_os@ @@ -856,7 +870,8 @@ package or when debugging this package.\ --localstatedir=%{_localstatedir} \\\ --sharedstatedir=%{_sharedstatedir} \\\ --mandir=%{_mandir} \\\ - --infodir=%{_infodir} + --infodir=%{_infodir} \\\ + --disable-dependency-tracking #------------------------------------------------------------------------------ # The make install analogue of %configure for modern autotools: @@ -978,6 +993,40 @@ done \ %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))") %python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])") +# More useful perl macros (from Raul Dias ) +# +%perl_version %(perl -V:version | sed "s!.*='!!;s!'.*!!") +%perl_man1ext %(perl -V:man1ext | sed "s!.*='!!;s!'.*!!") +%perl_man3ext %(perl -V:man3ext | sed "s!.*='!!;s!'.*!!") +%perl_man1dir %(perl -V:man1dir | sed "s!.*='!!;s!'.*!!") +%perl_man3dir %(perl -V:man3dir | sed "s!.*='!!;s!'.*!!") +%perl_installman1dir %(perl -V:installman1dir | sed "s!.*='!!;s!'.*!!") +%perl_installman3dir %(perl -V:installman3dir | sed "s!.*='!!;s!'.*!!") +%perl_installarchlib %(perl -V:installarchlib | sed "s!.*='!!;s!'.*!!") +%perl_prefix %{buildroot} + +#------------------------------------------------------------------------------ +# Python specific macro definitions (originally from PLD). +# +%py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND) +%py_libdir %{py_prefix}/%{_lib}/python%{py_ver} +%py_incdir %{py_prefix}/include/python%{py_ver} +%py_sitedir %{py_libdir}/site-packages +%py_compile(O) \ +find %1 -name '*.pyc' -exec rm -f {} \\; \ +python -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 \ +%{-O: \ +find %1 -name '*.pyo' -exec rm -f {} \\; \ +python -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 \ +} +%py_requires(d) \ +%define minver %py_ver \ +%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) \ +BuildRequires: python %{-d:python-devel} \ +PreReq: python >= %minver, python < %maxver + + #------------------------------------------------------------------------------ # arch macro for all Intel i?86 compatibile processors # (Note: This macro (and it's analogues) will probably be obsoleted when @@ -988,7 +1037,9 @@ done \ #------------------------------------------------------------------------------ # arch macro for all supported ARM processors -%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l +%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv7l armv7hl +%arml armv3l armv4l armv5l armv5tel armv6l armv7l armv7hl +%armb armv4b armv5b armv5teb #------------------------------------------------------------------------------ # arch macro for all supported Sparc processors @@ -998,6 +1049,10 @@ done \ # arch macro for all supported Alpha processors %alpha alpha alphaev56 alphaev6 alphaev67 +#------------------------------------------------------------------------------ +# arch macro for all supported PowerPC 64 processors +%power64 ppc64 ppc64p7 + #------------------------------------------------------------------------ # Use in %install to generate locale specific file lists. For example, # @@ -1008,6 +1063,8 @@ done \ # %files -f %{name}.lang # %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot} +%no_lang_C --without-C + # Commands + opts to use for retrieving remote files # Proxy opts can be set through --httpproxy/--httpport popt aliases, @@ -1027,12 +1084,20 @@ done \ %__collection_sepolicy_flags 1 #------------------------------------------------------------------------------ +# transaction specific macros +%__transaction_plugins msm +%__plugindir %{_libdir}/rpm-plugins +%__transaction_msm %{__plugindir}/msm.so +%__transaction_msm_default_policy %{_libdir}/rpm-plugins/msm-device-sec-policy +#------------------------------------------------------------------------------ # Macros for further automated spec %setup and patch application # default to plain patch %__scm patch # meh, figure something saner -%__scm_author rpm-build +%__scm_username rpm-build +%__scm_usermail +%__scm_author %{__scm_username} %{__scm_usermail} # Plain patch (-m is unused) %__scm_setup_patch(q) %{nil} @@ -1051,6 +1116,8 @@ done \ # Git %__scm_setup_git(q)\ %{__git} init %{-q}\ +%{__git} config user.name "%{__scm_username}"\ +%{__git} config user.email "%{__scm_usermail}"\ %{__git} add .\ %{__git} commit %{-q} -a\\\ --author "%{__scm_author}" -m "%{name}-%{version} base" @@ -1066,8 +1133,8 @@ done \ # Bzr %__scm_setup_bzr(q)\ -%{__bzr} whoami "%{__scm_author}"\ %{__bzr} init %{-q}\ +%{__bzr} whoami --branch "%{__scm_author}"\ %{__bzr} add .\ %{__bzr} commit %{-q} -m "%{name}-%{version} base" @@ -1090,13 +1157,32 @@ end} # One macro to (optionally) do it all. # -S Sets the used patch application style, eg '-S git' enables # usage of git repository and per-patch commits. -# -A Automatically apply all patches +# -N Disable automatic patch application # -p Use -p for patch application -%autosetup(a:b:cDn:TvAS:p:)\ +%autosetup(a:b:cDn:TvNS:p:)\ %setup %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{!-v:-q}\ %{-S:%global __scm %{-S*}}\ %{-S:%{expand:%__scm_setup_%{-S*} %{!-v:-q}}}\ -%{-A:%autopatch %{-v} %{-p:-p%{-p*}}} +%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}} # \endverbatim #*/ + + +#------------------------------------------------------------------------ +# standard build service macros +# +%ext_info .gz +%ext_man .gz + +%info_add() test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \ +%{nil} + +%info_del() test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \ +%{nil} + +%user_group_add() \ +/usr/sbin/groupadd -o -r %{1} 2>/dev/null || :\ +/usr/sbin/useradd -o -r -g %{1} -d %{2} -s %{3} -c %{4} %{1} 2>/dev/null || :\ +%{nil} +