Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > f490bc199fbbb73c7e409c1207615b68 > files > 2

rpm-mandriva-setup-build-1.104-2.1mdv2010.2.i586.rpm


%__gzip			/usr/bin/gzip

%_sys_macros_dir /etc/rpm/macros.d
%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros

# [Pixel, Dec 2008] deprecated, to remove as soon as rpm 4.6.0 dust settles down
%defaultbuildroot  %{_tmppath}/%{name}-%{version}-%{release}-buildroot


# when %_with_git_repository is set, these macros modify the behaviour of "%prep" step:
%_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} /usr/lib/rpm/mandriva/git-repository--after-tarball}
%_patch %{?_with_git_repository:PKG_NAME=%{name} /usr/lib/rpm/mandriva/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U}

# used by "git-repository--after-tarball":
%git_repository_cache %_topdir/%{name}.git


# Various programs used in rpm scripts
%_update_desktop_database_bin %{_bindir}/update-desktop-database
%_update_mime_database_bin %{_bindir}/update-mime-database
%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache
%_gconftool_bin %{_bindir}/gconftool-2
%_scrollkeeper_bin %{_bindir}/scrollkeeper-update

%__service          /sbin/service
%__chkconfig        /sbin/chkconfig

#==============================================================================
# ---- Required rpmrc macros.
#	Macros that used to be initialized as a side effect of rpmrc parsing.
#	These are the default values that can be overridden by other
#	(e.g. per-platform, per-system, per-packager, per-package) macros.
#

%debug_package_and_restore %{debug_package} \
%package __restore__\
Summary: %{summary}\
Group: %{group}\
%description __restore__

%ix86 i386 i486 i586 i686 pentium3 pentium4 athlon k6

%sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
%sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v

#	Multilibs
%_multilibpatt		(/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$

%_arch_tag_suffix (%_lib)
%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}}

# Games macros
%_gamesdir	games
%_gamesbindir   %{_prefix}/%{_gamesdir}
%_gamesdatadir  %{_datadir}/%{_gamesdir}

# Menu directories
%_menudir %{_prefix}/lib/menu
%_iconsdir %{_datadir}/icons
%_miconsdir %{_datadir}/icons/mini
%_liconsdir %{_datadir}/icons/large

%_xfontdir %_datadir/fonts

%_webconfdir %{_sysconfdir}/httpd/conf
%_webappconfdir %_webconfdir/webapps.d
# compatibility
%webappconfdir %_webappconfdir

#==============================================================================
# ---- Build configuration macros.
#
# Package version macro.
#	The type of package to produce, for compatibility with legacy
#	versions of rpm.
#
# Script gets packaged file list on input.
# Returns list of multiarch files that are not marked as such,
# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values
#
# Note: Disable (by commenting out) for legacy compatibility.
#%__check_multiarch_files /usr/lib/rpm/check-multiarch-files %{buildroot}

# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator	0

%__find_provides	/usr/lib/rpm/mandriva/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' /usr/lib/rpm/mandriva/find-provides
%__find_requires	/usr/lib/rpm/mandriva/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' /usr/lib/rpm/mandriva/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}

%find_lang  /usr/lib/rpm/mandriva/find-lang.pl %{buildroot}

# stuff below has been deprecated by rpm filetriggers [June 2008]
%update_menus %{nil}
%clean_menus %{nil}
%update_desktop_database %{nil}
%clean_desktop_database %{nil}
%update_mime_database %{nil}
%clean_mime_database %{nil}
%update_scrollkeeper %{nil}
%clean_scrollkeeper %{nil}

# Update Menu
%_update_menus_bin %{_bindir}/update-menus

# Update Window Managers session.
%_fndsession_bin %{_sbindir}/fndSession
%make_session %{nil}
%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \
%{nil}

# For rebuilding gcj-db
%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db
%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
%{nil}

%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
%{nil}

# Rebuild icon cache
#
# following themes are handled through filetriggers:
%icon_cache_through_filetrigger_hicolor 1
%icon_cache_through_filetrigger_gnome 1
%icon_cache_through_filetrigger_oxygen 1

%update_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} ]; then \
%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true; fi \
%%{nil}}}

%clean_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} -a -r %%{_iconsdir}/%%{1}/index.theme ]; then \
%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true ; fi \
%%{nil}}}

# GConf schemas:
# installation is handled by filetriggers
%post_install_gconf_schemas() %{nil}
# but uninstall still need to be done in %preun:
%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \
SCHEMAS="" \
for SCHEMA in %{*} ; do \
  SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \
done \
GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule  $SCHEMAS > /dev/null || true ; fi \
%{nil}

# Mandriva Linux version
# - "9.1"    =>  910
# - "10.2.2" => 1022
# (user may copy the following line in specfile)
%mdkversion		%(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandriva-release)

%distsuffix mdv

%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}%{?distsuffix:%distsuffix}%{?!distsuffix:mdv}%{?mandriva_release:%mandriva_release}

#==============================================================================
# ---- Build policy macros.
#
#---------------------------------------------------------------------
#   Expanded at end of %install scriptlet.
#

%__os_install_post    \
    %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \
%{nil}

%__debug_install_post   \
   /usr/lib/rpm/mandriva/find-debuginfo.sh "%{_builddir}/%{?buildsubdir}"\
%{nil}


#==============================================================================
# ---- specfile macros.
#	Macro(s) here can be used reliably for reproducible builds.
#	(Note: Above is the goal, below are the macros under development)
#

%old_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


#------------------------------------------------------------------------------
# Useful python macros
%pyver	%(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".")

#------------------------------------------------------------------------------
# Useful perl macros 
# (initially from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
# (modified by Pixel <pixel@mandriva.com>)
#
#	[...]
#	Group: Development/Perl
#	[...]
#	%build
#	perl Makefile.PL INSTALLDIRS=vendor
#	%make
#	[...]
#	%install
#	rm -rf $RPM_BUILD_ROOT
#	make install PREFIX="$RPM_BUILD_ROOT/%{prefix}"
#	[...]
#	%files
#	%defattr(644,root,root,755)
#	%{perl_vendorlib}/CGI
# or
#	%{perl_vendorarch}/DBI
#	%{perl_vendorarch}/auto/DBI
#	%{_mandir}/*/*
#


%perl_convert_version() %(perl -Mversion -le '
	$x = "%{1}";
	$y = $x;
	$x =~ s/[[:alpha:]]*$//;
	$y =~ s/^$x//;
	$x =~ s/\D*$//;
	$v = version->new($x)->normal;
	$v =~ s/^v//;
	print "$v$y";
')

# kept for compatibility, but should not be used, especially the ugly perl_archlib!
%perl_sitearch	%(eval "`perl -V:installsitearch`"; echo $installsitearch)
%perl_archlib	%(eval "`perl -V:installarchlib`"; echo $installarchlib)

#--------------------------------------------------------------------------------
# Macro from conectiva

%rename() \
Obsoletes: %{1} < %{version}-%{release} \
Provides: %{1} = %{version}-%{release}

# Shorthand for %{defined with_...}
# macros provided by rpm 4.4, but buggy :(
%_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } }
%_without() !%{expand: %%{with %1 %{?2:%2}}}

%_package_i18n(g:f:) \
%%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\
Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
License: %{license}\
Group: %{?-g:%{-g*}}%{?!-g:%{group}}\
\
%%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\
Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
\
%%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\
%{nil}


#------------------------------------------------------------------------------
# Python specific macros

# (from rpm 4.4.6)
%python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
%python_sitelib	%(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
%python_version	%(%{__python} -c "import sys; print(sys.version[0:3])")

# More 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)
# backward compatibility
%py_libdir              %py_purelibdir
%py_platlibdir          %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
%py_purelibdir          %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=0)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
%py_incdir              %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
%py_sitedir             %py_puresitedir
%py_platsitedir         %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
%py_puresitedir         %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)

%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} \
Requires: python >= %minver, python < %maxver


#------------------------------------------------------------------------------
# Ocaml macro
#

%ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib

#------------------------------------------------------------------------------
# Redefine RPM sections to allow jumping over them using "--without <section>".
# This an interesting alternative to --short-circuit.
# The following are mostly equivalent:
# % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec
# % rpmbuild -bb --without build foo.spec

%prep %%prep \
[ %{_with prep} -eq 1 ] || exit 0 \
[ %{_with build} -eq 1 ] || exit 0 \
[ %{_with install} -eq 1 ] || exit 0 \
%{nil}

%build %%build \
[ %{_with install} -eq 1 ] || exit 0 \
[ %{_with build} -eq 1 ] || exit 0 \
%{nil}

%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\
%%install\
[ %{_with install} -eq 1 ] || exit 0 \
%{nil}

%check %%check \
[ %{_with check} -eq 1 ] || exit 0 \
%{nil}