- lose the useless rpm user+group, use root:root like everything else

- install x86 arch macros on x86_64 (#194123)
- dont mess up target os+arch on rpmrc include (#232429)
- set pkg-config path based on target (#212522)
This commit is contained in:
Panu Matilainen 2008-01-15 08:36:09 +00:00
parent 438a53d31f
commit 3fd55367ca
4 changed files with 160 additions and 91 deletions

View File

@ -0,0 +1,16 @@
Don't reset target when reading included rpmrc's. Doesn't seem to break
anything and fixes rhbz#232429...
diff -up rpm-4.4.2.2/lib/rpmrc.c.noreset rpm-4.4.2.2/lib/rpmrc.c
--- rpm-4.4.2.2/lib/rpmrc.c.noreset 2008-01-11 10:30:12.000000000 +0200
+++ rpm-4.4.2.2/lib/rpmrc.c 2008-01-11 10:15:27.000000000 +0200
@@ -641,7 +641,9 @@ static int doReadRC( /*@killref@*/ FD_t
while (*se && !xisspace(*se)) se++;
if (*se != '\0') *se++ = '\0';
+#if 0
rpmRebuildTargetVars(NULL, NULL);
+#endif
fn = rpmGetPath(s, NULL);
if (fn == NULL || *fn == '\0') {

View File

@ -0,0 +1,14 @@
Set PKG_CONFIG_PATH correctly wrt target arch.
Optimally belongs in redhat-rpm-config but easier to just add here...
--- rpm-4.4.2/macros.in.pkgconfigpath 2007-01-30 15:57:37.000000000 -0500
+++ rpm-4.4.2/macros.in 2007-01-30 16:04:25.000000000 -0500
@@ -926,6 +926,8 @@
export RPM_BUILD_ROOT}\
%{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
export CLASSPATH}\
+ PKG_CONFIG_PATH=\"%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
+ export PKG_CONFIG_PATH\
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
umask 022\

View File

@ -0,0 +1,36 @@
Hackery to get secondary arch macros included on x86_64...
diff -r 8004da6eac95 installplatform
--- a/installplatform Thu Nov 08 15:59:45 2007 +0200
+++ b/installplatform Mon Nov 12 16:16:31 2007 +0200
@@ -20,7 +20,7 @@ E_O_F
RPM="./rpm --rcfile=$TEMPRC --macros=$MACROS"
-canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_arm[^-]*_arm_;s_\(powerpc\|ppc\)[^-]*_ppc_'
+canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_arm[^-]*_arm_;s_\(powerpc\|ppc\)[^-]*_ppc_;s,\(ia32e\|amd64\),x86_64,'
arch="`$RPM --eval '%{_arch}'|sed -e "$canonarch_sed"`"
VENDOR="`$RPM --eval '%{_vendor}'`"
OS="`$RPM --eval '%{_os}'`"
@@ -35,7 +35,7 @@ case "$arch" in
sparc*) SUBSTS='s_sparc\(64\|64v\|v9v\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
s390*) SUBSTS='s_s390x_s390_ s_s390\([^x]\|$\)_s390x\1_' ;;
- x86_64|amd64|ia32e) SUBSTS='s,x86_64,x86_64, s,x86_64,ia32e, s,x86_64,amd64,' ;;
+ x86_64|amd64|ia32e) SUBSTS='s,x86_64,x86_64, s,x86_64,ia32e, s,x86_64,amd64, s,x86_64,i386, s,x86_64,i486, s,x86_64,i586, s,x86_64,i686, s,x86_64,pentium3, s,x86_64,pentium4, s,x86_64,athlon,' ;;
*) SUBSTS=y___ ;;
esac
@@ -102,9 +102,11 @@ for SUBST in $SUBSTS ; do
;;
esac
+ CANONARCH="`echo $ARCH|sed -e "$canonarch_sed"`"
+
cat $PLATFORM \
| sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
- -e "s,@RPMRC_ARCH@,$ARCH," \
+ -e "s,$arch,$CANONARCH," \
-e "s,@RPMRC_GNU@,$RPMRC_GNU," \
-e "s,@LIB@,$LIB," \
-e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \

185
rpm.spec
View File

@ -6,7 +6,7 @@
Summary: The RPM package management system Summary: The RPM package management system
Name: rpm Name: rpm
Version: 4.4.2.2 Version: 4.4.2.2
Release: 12%{?dist} Release: 13%{?dist}
Group: System Environment/Base Group: System Environment/Base
Url: http://www.rpm.org/ Url: http://www.rpm.org/
Source: http://rpm.org/releases/rpm-4.4.x/%{name}-%{version}.tar.gz Source: http://rpm.org/releases/rpm-4.4.x/%{name}-%{version}.tar.gz
@ -26,13 +26,15 @@ Patch13: rpm-4.4.2.2-nss.patch
Patch14: rpm-4.4.2.2-base64-unsigned-char.patch Patch14: rpm-4.4.2.2-base64-unsigned-char.patch
Patch15: rpm-4.4.2.2-cryptoinit.patch Patch15: rpm-4.4.2.2-cryptoinit.patch
Patch16: rpm-4.4.2.2-gcc43.patch Patch16: rpm-4.4.2.2-gcc43.patch
Patch17: rpm-4.4.2.2-secondary-arch-macros.patch
Patch18: rpm-4.4.2.2-no-targetreset.patch
Patch19: rpm-4.4.2.2-pkgconfig-path.patch
# XXX Beware, this is one murky license, partially GPL/LGPL dual-licensed # XXX Beware, this is one murky license, partially GPL/LGPL dual-licensed
# and several different components with their own licenses included... # and several different components with their own licenses included...
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD and MIT and Sleepycat # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD and MIT and Sleepycat
License: GPLv2+ License: GPLv2+
Requires(pre): shadow-utils
Requires(post): coreutils Requires(post): coreutils
Requires: popt >= 1.10.2.1 Requires: popt >= 1.10.2.1
Requires: crontabs Requires: crontabs
@ -157,6 +159,9 @@ that will manipulate RPM packages and databases.
%patch14 -p1 -b .base64 %patch14 -p1 -b .base64
%patch15 -p1 -b .nss-init %patch15 -p1 -b .nss-init
%patch16 -p1 -b .gcc43 %patch16 -p1 -b .gcc43
%patch17 -p1 -b .archmacros
%patch18 -p1 -b .notargetreset
%patch19 -p1 -b .pkgconfig-path
# force external popt # force external popt
rm -rf popt/ rm -rf popt/
@ -240,13 +245,6 @@ find $RPM_BUILD_ROOT/%{_libdir}/python%{with_python_version} -name "*.py"|xargs
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%pre
getent group rpm > /dev/null || groupadd -g 37 rpm
getent passwd rpm > /dev/null || \
/usr/sbin/useradd -r -d /var/lib/rpm -u 37 -g 37 -s /sbin/nologin \
-c "RPM user" rpm > /dev/null 2>&1
exit 0
%post %post
# XXX Detect (and remove) incompatible dbenv files during upgrade. # XXX Detect (and remove) incompatible dbenv files during upgrade.
# XXX Removing dbenv files in %%post opens a lock race window, a tolerable # XXX Removing dbenv files in %%post opens a lock race window, a tolerable
@ -261,8 +259,7 @@ exit 0
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%define rpmattr %attr(0755, rpm, rpm) %define rpmdbattr %attr(0644, root, root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
%define rpmdbattr %attr(0644, rpm, rpm) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -276,66 +273,66 @@ exit 0
#%ghost %config(noreplace,missingok) %{_sysconfdir}/rpm/platform #%ghost %config(noreplace,missingok) %{_sysconfdir}/rpm/platform
#%ghost %config(noreplace,missingok) %{_sysconfdir}/rpm/macros.tscolor #%ghost %config(noreplace,missingok) %{_sysconfdir}/rpm/macros.tscolor
%attr(0755, rpm, rpm) %dir /var/lib/rpm %dir /var/lib/rpm
%rpmdbattr /var/lib/rpm/* %rpmdbattr /var/lib/rpm/*
%attr(0755, rpm, rpm) %dir /var/spool/repackage %dir /var/spool/repackage
%attr(0755, rpm, rpm) %dir %{rpmhome} %dir %{rpmhome}
%{rpmattr} /bin/rpm /bin/rpm
%{rpmattr} %{_bindir}/rpm2cpio %{_bindir}/rpm2cpio
%{rpmattr} %{_bindir}/gendiff %{_bindir}/gendiff
%{rpmattr} %{_bindir}/rpmdb %{_bindir}/rpmdb
%{rpmattr} %{_bindir}/rpmsign %{_bindir}/rpmsign
%{rpmattr} %{_bindir}/rpmquery %{_bindir}/rpmquery
%{rpmattr} %{_bindir}/rpmverify %{_bindir}/rpmverify
%{rpmattr} %{rpmhome}/config.guess %{rpmhome}/config.guess
%{rpmattr} %{rpmhome}/config.sub %{rpmhome}/config.sub
%{rpmattr} %{rpmhome}/convertrpmrc.sh %{rpmhome}/convertrpmrc.sh
%{rpmattr} %{rpmhome}/freshen.sh %{rpmhome}/freshen.sh
%{rpmattr} %{rpmhome}/mkinstalldirs %{rpmhome}/mkinstalldirs
%{rpmattr} %{rpmhome}/rpm2cpio.sh %{rpmhome}/rpm2cpio.sh
%{rpmattr} %{rpmhome}/rpm[deiukqv] %{rpmhome}/rpm[deiukqv]
%{rpmattr} %{rpmhome}/tgpg %{rpmhome}/tgpg
%{rpmattr} %{rpmhome}/rpmdb_* %{rpmhome}/rpmdb_*
%{rpmattr} %{rpmhome}/rpmfile %{rpmhome}/rpmfile
%attr(0644, rpm, rpm) %{rpmhome}/macros %{rpmhome}/macros
%attr(0644, rpm, rpm) %{rpmhome}/rpmpopt* %{rpmhome}/rpmpopt*
%attr(0644, rpm, rpm) %{rpmhome}/rpmrc %{rpmhome}/rpmrc
%ifarch i386 i486 i586 i686 athlon pentium3 pentium4 %ifarch i386 i486 i586 i686 athlon pentium3 pentium4 x86_64
%attr(-, rpm, rpm) %{rpmhome}/i[3456]86* %{rpmhome}/i[3456]86*
%attr(-, rpm, rpm) %{rpmhome}/athlon* %{rpmhome}/athlon*
%attr(-, rpm, rpm) %{rpmhome}/pentium* %{rpmhome}/pentium*
%endif %endif
%ifarch alpha alphaev5 alphaev56 alphapca56 alphaev6 alphaev67 %ifarch alpha alphaev5 alphaev56 alphapca56 alphaev6 alphaev67
%attr(-, rpm, rpm) %{rpmhome}/alpha* %{rpmhome}/alpha*
%endif %endif
%ifarch sparc sparcv8 sparcv9 sparc64 %ifarch sparc sparcv8 sparcv9 sparc64
%attr(-, rpm, rpm) %{rpmhome}/sparc* %{rpmhome}/sparc*
%endif %endif
%ifarch ia64 %ifarch ia64
%attr(-, rpm, rpm) %{rpmhome}/ia64* %{rpmhome}/ia64*
%endif %endif
%ifarch powerpc ppc ppciseries ppcpseries ppcmac ppc64 %ifarch powerpc ppc ppciseries ppcpseries ppcmac ppc64
%attr(-, rpm, rpm) %{rpmhome}/ppc* %{rpmhome}/ppc*
%endif %endif
%ifarch s390 s390x %ifarch s390 s390x
%attr(-, rpm, rpm) %{rpmhome}/s390* %{rpmhome}/s390*
%endif %endif
%ifarch %{arm} %ifarch %{arm}
%attr(-, rpm, rpm) %{rpmhome}/arm* %{rpmhome}/arm*
%endif %endif
%ifarch mips mipsel %ifarch mips mipsel
%attr(-, rpm, rpm) %{rpmhome}/mips* %{rpmhome}/mips*
%endif %endif
%ifarch x86_64 %ifarch x86_64
%attr(-, rpm, rpm) %{rpmhome}/x86_64* %{rpmhome}/x86_64*
%attr(-, rpm, rpm) %{rpmhome}/amd64* %{rpmhome}/amd64*
%attr(-, rpm, rpm) %{rpmhome}/ia32e* %{rpmhome}/ia32e*
%endif %endif
%attr(-, rpm, rpm) %{rpmhome}/noarch* %{rpmhome}/noarch*
%{_mandir}/man1/gendiff.1* %{_mandir}/man1/gendiff.1*
%{_mandir}/man8/rpm.8* %{_mandir}/man8/rpm.8*
@ -354,47 +351,47 @@ exit 0
%files build %files build
%defattr(-,root,root) %defattr(-,root,root)
%{_usrsrc}/redhat %{_usrsrc}/redhat
%{rpmattr} %{_bindir}/rpmbuild %{_bindir}/rpmbuild
%{rpmattr} %{rpmhome}/brp-* %{rpmhome}/brp-*
%{rpmattr} %{rpmhome}/check-buildroot %{rpmhome}/check-buildroot
%{rpmattr} %{rpmhome}/check-files %{rpmhome}/check-files
%{rpmattr} %{rpmhome}/check-prereqs %{rpmhome}/check-prereqs
%{rpmattr} %{rpmhome}/check-rpaths* %{rpmhome}/check-rpaths*
%{rpmattr} %{rpmhome}/cross-build %{rpmhome}/cross-build
%{rpmattr} %{rpmhome}/debugedit %{rpmhome}/debugedit
%{rpmattr} %{rpmhome}/find-debuginfo.sh %{rpmhome}/find-debuginfo.sh
%{rpmattr} %{rpmhome}/find-lang.sh %{rpmhome}/find-lang.sh
%{rpmattr} %{rpmhome}/find-prov.pl %{rpmhome}/find-prov.pl
%{rpmattr} %{rpmhome}/find-provides %{rpmhome}/find-provides
%{rpmattr} %{rpmhome}/find-provides.perl %{rpmhome}/find-provides.perl
%{rpmattr} %{rpmhome}/find-req.pl %{rpmhome}/find-req.pl
%{rpmattr} %{rpmhome}/find-requires %{rpmhome}/find-requires
%{rpmattr} %{rpmhome}/find-requires.perl %{rpmhome}/find-requires.perl
%{rpmattr} %{rpmhome}/get_magic.pl %{rpmhome}/get_magic.pl
%{rpmattr} %{rpmhome}/getpo.sh %{rpmhome}/getpo.sh
%{rpmattr} %{rpmhome}/http.req %{rpmhome}/http.req
%{rpmattr} %{rpmhome}/javadeps %{rpmhome}/javadeps
%{rpmattr} %{rpmhome}/magic.prov %{rpmhome}/magic.prov
%{rpmattr} %{rpmhome}/magic.req %{rpmhome}/magic.req
%{rpmattr} %{rpmhome}/mono-find-provides %{rpmhome}/mono-find-provides
%{rpmattr} %{rpmhome}/mono-find-requires %{rpmhome}/mono-find-requires
%{rpmattr} %{rpmhome}/osgideps.pl %{rpmhome}/osgideps.pl
%{rpmattr} %{rpmhome}/perldeps.pl %{rpmhome}/perldeps.pl
%{rpmattr} %{rpmhome}/perl.prov %{rpmhome}/perl.prov
%{rpmattr} %{rpmhome}/perl.req %{rpmhome}/perl.req
%{rpmattr} %{rpmhome}/pythondeps.sh %{rpmhome}/pythondeps.sh
%{rpmattr} %{rpmhome}/rpm[bt] %{rpmhome}/rpm[bt]
%{rpmattr} %{rpmhome}/rpmdeps %{rpmhome}/rpmdeps
%{rpmattr} %{rpmhome}/trpm %{rpmhome}/trpm
%{rpmattr} %{rpmhome}/u_pkg.sh %{rpmhome}/u_pkg.sh
%{rpmattr} %{rpmhome}/vpkg-provides.sh %{rpmhome}/vpkg-provides.sh
%{rpmattr} %{rpmhome}/vpkg-provides2.sh %{rpmhome}/vpkg-provides2.sh
%attr(0644, rpm, rpm) %{rpmhome}/config.site %{rpmhome}/config.site
%attr(0644, rpm, rpm) %{rpmhome}/magic %{rpmhome}/magic
%attr(0644, rpm, rpm) %{rpmhome}/magic.mgc %{rpmhome}/magic.mgc
%attr(0644, rpm, rpm) %{rpmhome}/magic.mime %{rpmhome}/magic.mime
%attr(0644, rpm, rpm) %{rpmhome}/magic.mime.mgc %{rpmhome}/magic.mime.mgc
%{_mandir}/man8/rpmbuild.8* %{_mandir}/man8/rpmbuild.8*
%{_mandir}/man8/rpmdeps.8* %{_mandir}/man8/rpmdeps.8*
@ -409,8 +406,8 @@ exit 0
%{_libdir}/librp*[a-z].so %{_libdir}/librp*[a-z].so
%{_mandir}/man8/rpmcache.8* %{_mandir}/man8/rpmcache.8*
%{_mandir}/man8/rpmgraph.8* %{_mandir}/man8/rpmgraph.8*
%{rpmattr} %{rpmhome}/rpmcache %{rpmhome}/rpmcache
%{rpmattr} %{_bindir}/rpmgraph %{_bindir}/rpmgraph
%if %{with_apidocs} %if %{with_apidocs}
%files apidocs %files apidocs
@ -419,6 +416,12 @@ exit 0
%endif %endif
%changelog %changelog
* Fri Jan 11 2008 Panu Matilainen <pmatilai@redhat.com> 4.4.2.2-13
- lose the useless rpm user+group, use root:root like everything else
- install x86 arch macros on x86_64 (#194123)
- dont mess up target os+arch on rpmrc include (#232429)
- set pkg-config path based on target (#212522)
* Fri Jan 04 2008 Panu Matilainen <pmatilai@redhat.com> 4.4.2.2-12 * Fri Jan 04 2008 Panu Matilainen <pmatilai@redhat.com> 4.4.2.2-12
- fix segfault in devel symlink dependency generation from Mark Salter (#338971) - fix segfault in devel symlink dependency generation from Mark Salter (#338971)
- fix debugedit build with gcc 4.3 - fix debugedit build with gcc 4.3