From ba0b7b7637e29319ddfb807dfafed74be97ecb8b Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Wed, 3 Aug 2005 09:55:25 +0000 Subject: - some macro from connectiva --- ChangeLog | 12 ++++++++++ macros.in | 78 +++++++++++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 71 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e72192a..594bff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-06-27 17:09 Olivier Thauvin + + * macros.in: - add %__{chkconfig,service} macros + +2005-06-25 09:43 Olivier Thauvin + + * rpm-mandriva-setup.spec: - requires multiarch utils + +2005-06-23 04:29 Olivier Thauvin + + * rpm-mandriva-setup.spec: - add requirement for update + 2005-06-22 14:00 Olivier Thauvin * rpm-mandriva-setup.spec: - split for dep diff --git a/macros.in b/macros.in index 2e0684d..3ae1aff 100644 --- a/macros.in +++ b/macros.in @@ -498,25 +498,25 @@ Provides: %{1} = %{version}-%{release} #-------------------------------------------------------------------------------- # --without section -%prep %{?_without_prep:%define __spec_prep_cmd /bin/true\ -%%prep\ -%{warn:Skipping %%prep stage\ -}}%{?!_without_prep:%%prep} - -%build %{?_without_build:%define __spec_build_cmd /bin/true\ -%%build\ -%{warn:Skipping %%build stage\ -}}%{?!_without_build:%%build} - -%install %{?_without_install:%define __spec_install_cmd /bin/true\ -%%install\ -%{warn:Skipping %%install stage\ -}}%{?!_without_install:%%install} - -%check %{?_without_check:%define __spec_check_cmd /bin/true\ -%%check\ -%{warn:Skipping %%check stage\ -}}%{?!_without_check:%%check} +#%prep %{?_without_prep:%define __spec_prep_cmd /bin/true\ +#%%prep\ +#%{warn:Skipping %%prep stage\ +#}}%{?!_without_prep:%%prep} +# +#%build %{?_without_build:%define __spec_build_cmd /bin/true\ +#%%build\ +#%{warn:Skipping %%build stage\ +#}}%{?!_without_build:%%build} +# +#%install %{?_without_install:%define __spec_install_cmd /bin/true\ +#%%install\ +#%{warn:Skipping %%install stage\ +#}}%{?!_without_install:%%install} +# +#%check %{?_without_check:%define __spec_check_cmd /bin/true\ +#%%check\ +#%{warn:Skipping %%check stage\ +#}}%{?!_without_check:%%check} # Shorthand for %{defined with_...} # macros provided by rpm 4.4, but buggy :( @@ -534,3 +534,43 @@ 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 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 + +#------------------------------------------------------------------------------ +# Redefine RPM sections to allow jumping over them +# + +%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 %%install \ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} -- cgit v1.2.1