Nice ... now Mandriva vendor macros can be used per-spec as %{load:%{_usrlibrpm}/macros.d/mandriva} which starts to address the overly complex structural and dialectical configgery differences as needed, not globally in how rpm is built.
73 de Jeff On Oct 15, 2010, at 11:36 PM, Per Øyvind Karlsen wrote: > RPM Package Manager, CVS Repository > http://rpm5.org/cvs/ > ____________________________________________________________________________ > > Server: rpm5.org Name: Per Øyvind Karlsen > Root: /v/rpm/cvs Email: pkarl...@rpm5.org > Module: rpm Date: 16-Oct-2010 05:36:54 > Branch: HEAD Handle: 2010101603365300 > > Added files: > rpm/macros mandriva.in > Modified files: > rpm CHANGES Makefile.am configure.ac > rpm/macros macros.in > > Log: > add macros from mandriva that's fairly generic enough to possibly be > of use to others, in mandriva/macros. > > Summary: > Revision Changes Path > 1.3469 +2 -0 rpm/CHANGES > 2.256 +1 -1 rpm/Makefile.am > 2.461 +4 -1 rpm/configure.ac > 1.34 +5 -1 rpm/macros/macros.in > 1.1 +57 -0 rpm/macros/mandriva.in > ____________________________________________________________________________ > > patch -p0 <<'@@ .' > Index: rpm/CHANGES > ============================================================================ > $ cvs diff -u -r1.3468 -r1.3469 CHANGES > --- rpm/CHANGES 14 Oct 2010 09:43:37 -0000 1.3468 > +++ rpm/CHANGES 16 Oct 2010 03:36:53 -0000 1.3469 > @@ -1,4 +1,6 @@ > 5.3.4 -> 5.4a1: > + - proyvind: add macros from mandriva that's fairly generic enough to > + possibly be of use to others, in mandriva/macros. > - devzero2000: add an --setfscontext popt alias (lp#660406) > - jbj: spewage: use RPMTAG_SHA1HEADER as the primary retrieval key. > - jbj: rpmpopt: fix: permit popt aliases to be used w "make check". > @@ . > patch -p0 <<'@@ .' > Index: rpm/Makefile.am > ============================================================================ > $ cvs diff -u -r2.255 -r2.256 Makefile.am > --- rpm/Makefile.am 9 Oct 2010 19:33:10 -0000 2.255 > +++ rpm/Makefile.am 16 Oct 2010 03:36:53 -0000 2.256 > @@ -134,7 +134,7 @@ > > pkgcfgdir = $(pkglibdir)/macros.d > pkgcfg_DATA = \ > - macros/java macros/libtool macros/mono macros/perl \ > + macros/java macros/libtool macros/mandriva macros/mono macros/perl \ > macros/pkgconfig macros/php macros/python macros/selinux > > noinst_HEADERS = build.h debug.h system.h > @@ . > patch -p0 <<'@@ .' > Index: rpm/configure.ac > ============================================================================ > $ cvs diff -u -r2.460 -r2.461 configure.ac > --- rpm/configure.ac 9 Oct 2010 18:56:01 -0000 2.460 > +++ rpm/configure.ac 16 Oct 2010 03:36:53 -0000 2.461 > @@ -2215,6 +2215,7 @@ > AC_SUBST(RPMLUAFILES) > AC_MSG_RESULT([$RPMLUAFILES]) > > +DISTRO_MACROS="#" > dnl # determine whether to build using a specific vendor's changes or not > AC_MSG_CHECKING([if building for a specfic vendor]) > AC_ARG_WITH( > @@ -2224,6 +2225,7 @@ > case "$withval" in > "mandriva") > AC_DEFINE([RPM_VENDOR_MANDRIVA], 1, Vendor is Mandriva) > + DISTRO_MACROS="" > ;; > "ark") > AC_DEFINE([RPM_VENDOR_ARK], 1, Vendor is Ark) > @@ -2237,6 +2239,7 @@ > AC_MSG_RESULT(no) > fi] > ) > +AC_SUBST(DISTRO_MACROS) > > testdir="`pwd`/tests" > AC_SUBST(testdir) > @@ -2263,7 +2266,7 @@ > scripts/Makefile > rpmdb/DB_CONFIG > macros/macros macros/macros.rpmbuild > - macros/java macros/libtool macros/mono macros/perl > + macros/java macros/libtool macros/mandriva macros/mono macros/perl > macros/pkgconfig macros/php macros/python macros/selinux > doc/Makefile > doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile > @@ . > patch -p0 <<'@@ .' > Index: rpm/macros/macros.in > ============================================================================ > $ cvs diff -u -r1.33 -r1.34 macros.in > --- rpm/macros/macros.in 9 Oct 2010 02:22:58 -0000 1.33 > +++ rpm/macros/macros.in 16 Oct 2010 03:36:53 -0000 1.34 > @@ -1,7 +1,7 @@ > #/*! \page config_macros Default configuration: @USRLIBRPM@/macros > # \verbatim > # > -# $Id: macros.in,v 1.33 2010/10/09 02:22:58 jbj Exp $ > +# $Id: macros.in,v 1.34 2010/10/16 03:36:53 pkarlsen Exp $ > # > # This is a global RPM configuration file. All changes made here will > # be lost when the rpm package is upgraded. Any per-system configuration > @@ -941,6 +941,10 @@ > %{load:%{_usrlibrpm}/macros.d/mono} > > #------------------------------------------------------------------------ > +# vendor specific macro configuration. > +...@distro_macros@%{load:%{_usrlibrpm}/macros.d/%{_vendor}} > + > +#------------------------------------------------------------------------ > # executable(...) configuration. > # > # Path to scripts to autogenerate executable(foo) script dependencies, > @@ . > patch -p0 <<'@@ .' > Index: rpm/macros/mandriva.in > ============================================================================ > $ cvs diff -u -r0 -r1.1 mandriva.in > --- /dev/null 2010-10-16 05:36:02.000000000 +0200 > +++ mandriva.in 2010-10-16 05:36:53.309930253 +0200 > @@ -0,0 +1,57 @@ > +%_upgrade_tag name > +%_obsolete_tag name > + > +# Disable automatic dependencies on parent directory and symlinks for now > +%_check_symlink_deps 0 > +%_check_dirname_deps 0 > + > +# The directory where buildroots will be created. > +%_buildrootdir %{_topdir}/BUILDROOT > + > +# Build root path, where %install installs the package during build. > +%buildroot > %{_buildrootdir}/%{name}-%{version}-%{release}%{?disttag:-%{disttag}%{?distepoch:%{distepoch}}}.%{_arch}-buildroot > + > +# Path to top of build area. > +%_topdir %(echo $HOME)/rpmbuild > + > +%_docdir_fmt %%{NAME} > + > +%_changelog_truncate 3 years ago > + > +# This will enable the use of distepoch and disttag in stead of polluting > +# %release with such. > +%evr_tuple_select 1234 > +%evr_tuple_order EVRD > +%disttag mdv > +%distepoch %(sed -e 's#.*release\ \(\S*\).*#\1#' /etc/release) > + > +# Dynamic EVRD tags macro for use with versioned provides/requires in place > of > +# '%{version}-%{release}', ie. to automatically add distepoch or epoch if > present > +%EVRD > %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}} > + > +%rename() \ > +Obsoletes: %{1} < %{EVRD} \ > +Provides: %{1} = %{EVRD} > + > + > +%_default_patch_flags -s -U > +%_default_patch_fuzz 0 > + > +# FIXME: will break if spec file is ever differently named, shouldn't parse > +# the spec file itself... > +%apply_patches %{lua:\ > +f = io.open(rpm.expand("%{_specdir}/%{name}.spec"))\ > +if f then\ > + for l in f:lines() do\ > + match,b,num = string.find(string.lower(l), "^%s*patch(%d+)%s*:.*$")\ > + if match then print(rpm.expand("%patch"..num.." -p1 -b > "..string.format(".%04d~",num).." \\\n")); end\ > + end\ > + f:close()\ > +end\ > +} > + > + > +%make %{__make} %{_smp_mflags} > +%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install > + > +%{load:/etc/rpm/macros.d/*.macros} > @@ . > ______________________________________________________________________ > RPM Package Manager http://rpm5.org > CVS Sources Repository rpm-...@rpm5.org ______________________________________________________________________ RPM Package Manager http://rpm5.org Developer Communication List rpm-devel@rpm5.org