Hello community,
here is the log from the commit of package rpm.469 for openSUSE:12.1:Update checked in at 2012-05-07 11:07:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1:Update/rpm.469 (Old)
and /work/SRC/openSUSE:12.1:Update/.rpm.469.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpm.469", Maintainer is ""
Changes:
--------
New Changes file:
--- /dev/null 2012-05-03 01:24:41.895590051 +0200
+++ /work/SRC/openSUSE:12.1:Update/.rpm.469.new/rpm-python.changes 2012-05-07 11:07:34.000000000 +0200
@@ -0,0 +1,89 @@
+-------------------------------------------------------------------
+Wed Feb 23 14:01:41 CET 2011 - mls@suse.de
+
+- drop standard python directories from filelist [bnc#229189]
+
+-------------------------------------------------------------------
+Fri Oct 22 15:52:32 UTC 2010 - coolo@novell.com
+
+- adapt second spec file to changes done to rpm.spec
+
+-------------------------------------------------------------------
+Mon Oct 18 11:03:53 CEST 2010 - dmueller@suse.de
+
+- adapt buildrequires
+
+-------------------------------------------------------------------
+Thu Feb 12 16:52:26 CET 2009 - ro@suse.de
+
+- adapt buildrequires
+
+-------------------------------------------------------------------
+Wed Oct 8 11:24:22 CEST 2008 - cthiel@suse.de
+
+- added libelf-devel to BuildRequires to fix build
+
+-------------------------------------------------------------------
+Thu Sep 11 15:33:52 CEST 2008 - mls@suse.de
+
+- update to 4.4.2.3 to get rid of >50 patches
+
+-------------------------------------------------------------------
+Sat Aug 30 21:23:38 CEST 2008 - cthiel@suse.de
+
+- add libselinux-devel to BuildRequires
+
+-------------------------------------------------------------------
+Thu Aug 7 16:05:51 CEST 2008 - dmueller@suse.de
+
+- fix build against python 2.6
+
+-------------------------------------------------------------------
+Thu Mar 27 14:47:18 CET 2008 - coolo@suse.de
+
+- fix buildrequires
+
+-------------------------------------------------------------------
+Fri May 25 16:20:53 CEST 2007 - mls@suse.de
+
+- fix unicode queries
+
+-------------------------------------------------------------------
+Fri Mar 30 15:06:28 CEST 2007 - rguenther@suse.de
+
+- add ncurses-devel and zlib-devel BuildRequires.
+
+-------------------------------------------------------------------
+Wed Oct 18 22:59:02 CEST 2006 - mls@suse.de
+
+- use rpm.spec for building instead of duplication everything
+- delete superfluous .a and .la files [#202604]
+- create .pyc and .pyo files [#205711]
+
+-------------------------------------------------------------------
+Sun Oct 15 23:41:37 CEST 2006 - schwab@suse.de
+
+- Make sure config.rpath is present.
+
+-------------------------------------------------------------------
+Fri Sep 22 08:58:57 CEST 2006 - aj@suse.de
+
+- Fix for python2.5.
+
+-------------------------------------------------------------------
+Thu Sep 21 11:41:04 CEST 2006 - lnussel@suse.de
+
+- do not package beecrypt python bindings as libbeecrypt is not
+ packaged either
+- fix literal %{version} in Requires tag
+
+-------------------------------------------------------------------
+Thu Sep 21 10:58:42 CEST 2006 - lnussel@suse.de
+
+- fix build with python 2.5 by overriding autodetection
+
+-------------------------------------------------------------------
+Tue Sep 19 13:48:27 CEST 2006 - rguenther@suse.de
+
+- split from rpm package
+
New Changes file:
--- /dev/null 2012-05-03 01:24:41.895590051 +0200
+++ /work/SRC/openSUSE:12.1:Update/.rpm.469.new/rpm.changes 2012-05-07 11:07:34.000000000 +0200
@@ -0,0 +1,2979 @@
+-------------------------------------------------------------------
+Wed Apr 18 19:01:21 CEST 2012 - mls@suse.de
+
+- fix some more crashes on malformed header data
+ [bnc#754281] [bnc#754284] [bnc#754285]
+- fix quoting in brp-python-hardlink [bnc#756087]
+- fix env export for kernel supplements adding [bnc#741543]
+- fix _fix macros [bnc#728682]
+- fix obsoletes handling of installed packages [bnc#714724]
+
+-------------------------------------------------------------------
+Wed Oct 19 18:28:39 CEST 2011 - mls@suse.de
+
+- update to rpm-4.9.1.2
+ * fixes some securities issues
+ * makes two local patches obsolete
+- add other security checks
+- use ~/rpmbuild as topdir is /usr/src/packages in not writeable
+ [bnc#658536]
+- bump suse_version macro
+
+-------------------------------------------------------------------
+Fri Sep 30 06:42:49 UTC 2011 - adrian@suse.de
+
+- enforce armv7hl plattform by default, despite the kernel only
+ reports armv7l via uname.
+- make armv7hl backward compatible to armv7l
+
+-------------------------------------------------------------------
+Thu Sep 29 18:49:33 CEST 2011 - dmueller@suse.de
+
+- fix architecture definition for armv5el
+
+-------------------------------------------------------------------
+Thu Sep 29 15:16:11 UTC 2011 - adrian@suse.de
+
+- use -O0 for soft FPU ARM
+
+-------------------------------------------------------------------
+Tue Sep 27 13:34:41 UTC 2011 - adrian@suse.de
+
+- define rpmv7hl architecture for hard fpu support
+
+-------------------------------------------------------------------
+Tue Sep 6 11:16:29 UTC 2011 - vuntz@opensuse.org
+
+- Update findlang.diff: do not mark standard gettext translation
+ files as %doc.
+- Rebase langnoc.diff and remove-translations.diff appropriately
+ after this change..
+
+-------------------------------------------------------------------
+Wed Aug 24 12:40:05 UTC 2011 - meissner@novell.com
+
+- restore old debugedit behaviour for stabs, otherwise
+ binaries with stabs in it will fail the build (e.g. vmlinux images
+ on Power)
+
+-------------------------------------------------------------------
+Mon Aug 15 01:04:17 CEST 2011 - ro@suse.de
+
+- workaround in mono-find-requires: use >= as operator when finding
+ .NET 1.0 dependencies, the .NET 1.5 libraries are compatible
+ (note mono-find-requires and mono-find-provides as used by the
+ internal dependency generator are really outdated)
+
+-------------------------------------------------------------------
+Wed Aug 10 02:40:22 UTC 2011 - crrodriguez@opensuse.org
+
+- Do not use -fno-strict-aliasing globally, the code
+ already does in places where really needed.
+
+-------------------------------------------------------------------
+Tue Jul 26 19:09:31 CEST 2011 - mls@suse.de
+
+- fix defattr handling for doc files
+
+-------------------------------------------------------------------
+Thu Jul 21 13:00:47 CEST 2011 - mls@suse.de
+
+- fix problem with trailings slashes and recursive file adding
+
+-------------------------------------------------------------------
+Wed Jul 20 13:42:16 CEST 2011 - mls@suse.de
+
+- fix problem with trailing slashes on dir files
+
+-------------------------------------------------------------------
+Mon Jul 18 19:43:34 CEST 2011 - mls@suse.de
+
+- update to rpm-4.9.1
+ * fixed a bug in signature checking
+ * fixed crash on rpm --import for multiple keys [bnc#704589]
+ * got rid of a couple of patches
+- fixed dependency generation for suid binaries [bnc#702857]
+
+-------------------------------------------------------------------
+Fri Jun 17 11:14:38 UTC 2011 - fcrozat@suse.com
+
+- update brp.diff to not convert /sbin/init to absolute symlink
+ (needed for kiwi and systemd).
+
+-------------------------------------------------------------------
+Wed Jun 8 12:02:51 CEST 2011 - mls@suse.de
+
+- change sigpipe fix so that the code really reads everything
+ from the pipe
+
+-------------------------------------------------------------------
+Mon Jun 6 14:16:49 UTC 2011 - coolo@novell.com
+
+- move desktop.attr to update-desktop-files
+
+-------------------------------------------------------------------
+Mon Jun 6 13:30:05 CEST 2011 - mls@suse.de
+
+- ignore SIGPIPE when writing to dependency helpers, so that
+ builds don't randomly abort when a helper is missing
+
+-------------------------------------------------------------------
+Fri Jun 3 15:19:02 CEST 2011 - mls@suse.de
+
+- add --assume-exec option to elfdeps, so that the dependency
+ generator really works for libs without x-bits
+
+-------------------------------------------------------------------
+Mon May 23 16:21:52 CEST 2011 - mls@suse.de
+
+- do not die if the changelog section is empty [bnc#695400]
+
+-------------------------------------------------------------------
+Fri May 20 13:28:37 CEST 2011 - mls@suse.de
+
+- get rid of "unexpectedly shrank by one" error
+
+-------------------------------------------------------------------
+Thu May 19 14:51:13 CEST 2011 - mls@suse.de
+
+- remove gstreamer from fileattrs
+- remove unused var from magic_and_path patch
+
+-------------------------------------------------------------------
+Thu May 19 11:59:38 CEST 2011 - mls@suse.de
+
+- disable perl requires generation completely
+
+-------------------------------------------------------------------
+Wed May 18 11:34:17 CEST 2011 - mls@suse.de
+
+- split elflib from elf fileattrs so that libraries without
+ x-bits are also scanned
+
+-------------------------------------------------------------------
+Tue May 17 10:47:00 CEST 2011 - mls@suse.de
+
+- allow macro undef/change while expanding the macro itself
+
+-------------------------------------------------------------------
+Mon May 16 14:45:05 CEST 2011 - mls@suse.de
+
+- update to rpm-4.9.0:
+ * use internal dependency generator
+ * pluggable autodeps generators
+ * update to berkeleydb 4.8.30
+ * fixed dependency match corner cases
+ * experimental collection implementation
+
+-------------------------------------------------------------------
+Wed May 4 12:42:33 UTC 2011 - mmarek@novell.com
+
+- rpmsort
+ + Fix comparison function to match rpm (bnc#644515, thanks to
+ Michael Schroeder).
+ + Add --test option to verify result against zypper vcmp.
+
+-------------------------------------------------------------------
+Sat Feb 19 12:39:31 CET 2011 - vuntz@opensuse.org
+
+- Don't call /sbin/conf.d/SuSEconfig.pango in
+ %run_suseconfig_fonts: it has been removed during 11.4
+ development.
+
+-------------------------------------------------------------------
+Fri Jan 14 08:58:40 UTC 2011 - coolo@novell.com
+
+- let %find_lang remove (with a comment) languages not supported.
+ Supported languages are in filesystem.rpm's file list (bnc#659001)
+
+-------------------------------------------------------------------
+Mon Dec 20 11:50:55 CET 2010 - mls@suse.de
+
+- fix depflag_strong filter, all weak deps were shown as
+ strong (bnc#359566).
+
+-------------------------------------------------------------------
+Thu Dec 9 16:44:10 UTC 2010 - meissner@novell.com
+
++++ 2782 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.1:Update/.rpm.469.new/rpm.changes
New:
----
RPM-HOWTO.tar.bz2
RPM-Tips.html.tar.bz2
assumeexec.diff
autodeps.diff
baselibs.conf
beecrypt-4.1.2.diff
beecrypt-4.1.2.tar.bz2
brp.diff
brpcompress.diff
build.diff
buildidprov.diff
buildpipe.diff
checkfilesnoinfodir.diff
convertdb1static.diff
db-4.8.30.tar.bz2
db.diff
dbfsync.diff
dbprivate.diff
dbrointerruptable.diff
debugedit-canon-fix.diff
debugedit-comp-dir.diff
debugedit-stabs-warning.diff
debugedit.diff
debuginfo-mono.patch
debuglink.diff
debugsource-package.diff
debugsubpkg.diff
disttag-macro.diff
extcond.diff
fileattrs.diff
files.diff
finddebuginfo-absolute-links.diff
finddebuginfo.diff
findksyms.diff
findlang.diff
findsupplements.diff
firmware.diff
fontprovides.diff
headeradddb.diff
headerchk.diff
headerchk2.diff
helperenv.diff
initscriptsprov.diff
instobscheck.diff
langnoc.diff
lazystatfs.diff
localetag.diff
macrosin.diff
missingok.diff
modalias-encode.diff
modalias-kernel_module.diff
modalias.diff
mono-find-requires.diff
nameversioncompare.diff
no_rep_autop.diff
nobuildcolor.diff
nomagiccheck.diff
noprereqdeprec.diff
perlprov.diff
platformin.diff
pythondeps.diff
pythonhardlink.diff
refreshtestarch.diff
remove-brp-strips.diff
remove-translations.diff
repackage-nomd5.diff
requires-ge-macro.diff
rpm-4.9.1.2.tar.bz2
rpm-beecrypt.diff
rpm-gst-provides.patch
rpm-python.changes
rpm-python.spec
rpm-shorten-changelog.diff
rpm-suse_macros
rpm.changes
rpm.spec
rpmconfigcheck
rpmpopt.diff
rpmqpack.diff
rpmrc.diff
rpmrctests.diff
rpmsort
safeugid.diff
specfilemacro.diff
suspendlock.diff
symset-table
sysconfig.services-rpm
taggedfileindex.diff
waitlock.diff
weakdeps.diff
whatrequires-doc.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rpm-python.spec ++++++
#
# spec file for package rpm-python
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm-python
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: lua-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
#!BuildIgnore: rpmlint-Factory
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0+
Group: System/Packages
Version: 4.9.1.2
Release: 0
Requires: rpm = %{version}
%py_requires
Source99: rpm.spec
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 1
%description
The rpm-python package contains a module that permits applications
written in the Python programming language to use the interface
supplied by RPM Package Manager libraries.
This package should be installed if you want to develop Python programs
that will manipulate RPM packages and databases.
Authors:
--------
Erik Troan
Marc Ewing
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
make DESTDIR="$RPM_BUILD_ROOT" install
find "%{buildroot}" -not -type d -and -not -path %{buildroot}%{_libdir}/python%{py_ver}/site-packages/rpm/\* -print0 | xargs -0 rm
pushd $RPM_BUILD_ROOT/%py_sitedir/rpm
rm -f _rpmmodule.a _rpmmodule.la
python %py_libdir/py_compile.py *.py
python -O %py_libdir/py_compile.py *.py
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_libdir}/python*/*/*
%changelog
++++++ rpm.spec ++++++
#
# spec file for package rpm
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: lua-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
#!BuildIgnore: rpmlint-Factory
Provides: rpminst
PreReq: %insserv_prereq %fillup_prereq
Summary: The RPM Package Manager
License: GPL-2.0+
Group: System/Packages
Version: 4.9.1.2
Release: 0
Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
Source4: rpm-suse_macros
Source5: rpmsort
Source6: symset-table
Source8: rpmconfigcheck
Source9: sysconfig.services-rpm
Source10: beecrypt-4.1.2.tar.bz2
Source11: db-4.8.30.tar.bz2
Source12: baselibs.conf
Patch1: beecrypt-4.1.2.diff
Patch2: db.diff
# quilt patches start here
Patch10: rpm-beecrypt.diff
Patch11: debugedit.diff
Patch12: localetag.diff
Patch13: missingok.diff
Patch14: nameversioncompare.diff
Patch15: dbfsync.diff
Patch16: dbrointerruptable.diff
Patch17: extcond.diff
Patch18: refreshtestarch.diff
Patch19: rpmrctests.diff
Patch20: waitlock.diff
Patch21: suspendlock.diff
Patch22: weakdeps.diff
Patch23: autodeps.diff
Patch24: brp.diff
Patch25: brpcompress.diff
Patch26: checkfilesnoinfodir.diff
Patch27: finddebuginfo.diff
Patch28: findksyms.diff
Patch29: findlang.diff
Patch30: macrosin.diff
Patch31: modalias.diff
Patch32: platformin.diff
Patch33: rpmpopt.diff
Patch34: rpmrc.diff
Patch35: taggedfileindex.diff
Patch36: rpmqpack.diff
Patch37: convertdb1static.diff
Patch38: build.diff
Patch39: modalias-kernel_module.diff
Patch40: files.diff
Patch41: debugedit-comp-dir.diff
Patch42: perlprov.diff
Patch43: rpm-shorten-changelog.diff
Patch44: debugsource-package.diff
Patch45: whatrequires-doc.diff
Patch46: remove-brp-strips.diff
Patch47: requires-ge-macro.diff
Patch48: debugedit-canon-fix.diff
Patch49: finddebuginfo-absolute-links.diff
Patch50: firmware.diff
Patch51: specfilemacro.diff
Patch52: modalias-encode.diff
Patch53: disttag-macro.diff
Patch54: buildidprov.diff
Patch55: debugsubpkg.diff
Patch56: debuglink.diff
Patch57: debuginfo-mono.patch
Patch58: lazystatfs.diff
Patch59: repackage-nomd5.diff
Patch60: safeugid.diff
Patch61: noprereqdeprec.diff
Patch62: pythondeps.diff
Patch63: fontprovides.diff
Patch64: rpm-gst-provides.patch
Patch65: langnoc.diff
Patch66: initscriptsprov.diff
Patch67: remove-translations.diff
Patch68: no_rep_autop.diff
Patch69: headeradddb.diff
Patch70: dbprivate.diff
Patch71: nobuildcolor.diff
Patch72: fileattrs.diff
Patch73: nomagiccheck.diff
Patch74: findsupplements.diff
Patch75: assumeexec.diff
Patch76: buildpipe.diff
Patch77: mono-find-requires.diff
Patch78: debugedit-stabs-warning.diff
Patch79: headerchk.diff
Patch80: headerchk2.diff
Patch81: pythonhardlink.diff
Patch82: helperenv.diff
Patch83: instobscheck.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
%define _binary_payload w9.bzdio
%description
RPM Package Manager is the main tool for managing the software packages
of the SuSE Linux distribution.
RPM can be used to install and remove software packages. With rpm, it
is easy to update packages. RPM keeps track of all these manipulations
in a central database. This way it is possible to get an overview of
all installed packages. RPM also supports database queries.
Authors:
--------
Erik Troan
Marc Ewing
%package devel
Summary: Include Files and Libraries mandatory for Development
Requires: rpm = %{version}
Requires: popt-devel
%description devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs which
manipulate RPM packages and databases and are intended to make it
easier to create graphical package managers or any other tools that
need an intimate knowledge of RPM packages in order to function.
Authors:
--------
Erik Troan
Marc Ewing
%prep
%setup -q -n rpm-%{version}
rm -rf sqlite
rm -rf beecrypt
tar xjf %{SOURCE10}
tar xjf %{SOURCE11}
ln -s db-4.8.30 db
ln -s beecrypt-4.1.2 beecrypt
chmod -R u+w db/*
#tar xjf %{SOURCE12}
#ln -s neon-0.24.7 neon
# will get linked from db3
rm -f rpmdb/db.h
%patch -P 1 -P 2
%patch -P 10 -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18 -P 19
%patch -P 20 -P 21 -P 22 -P 23 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 37 -P 38 -P 39
%patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59
%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79
%patch -P 80 -P 81 -P 82 -P 83
#chmod 755 scripts/find-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov
#chmod 755 scripts/debuginfo.prov
tar -xjvf %{SOURCE1}
tar -xjvf %{SOURCE2}
if [ -s /etc/rpm/suse_macros ]; then
cp -a /etc/rpm/suse_macros %{SOURCE4}
fi
cp -a %{SOURCE4} suse_macros
rm -f m4/libtool.m4
rm -f m4/lt*.m4
%build
export CFLAGS="$RPM_OPT_FLAGS -ffunction-sections"
export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections"
%ifarch alpha armv5tel
export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
%endif
%if %{_target_cpu}
%ifarch %arm
BUILDTARGET="--build=%{_target_cpu}-suse-linux-gnueabi"
%else
BUILDTARGET="--build=%{_target_cpu}-suse-linux"
%endif
%endif
#cp -p /usr/share/gettext/config.rpath .
cp autogen.sh beecrypt
pushd beecrypt
./autogen.sh --with-pic --without-python $BUILDTARGET
make %{?_smp_mflags}
popd
./autogen.sh --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --with-lua \
--with-selinux --with-internal-beecrypt \
--with-acl --with-cap --enable-shared %{?with_python: --enable-python} $BUILDTARGET
rm po/de.gmo
make %{?_smp_mflags}
make convertdb1
%install
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/share/locale
ln -s ../share/locale $RPM_BUILD_ROOT/usr/lib/locale
make DESTDIR="$RPM_BUILD_ROOT" install
install -m 755 convertdb1 $RPM_BUILD_ROOT/usr/lib/rpm
install -m 644 db3/db.h $RPM_BUILD_ROOT/usr/include/rpm
# remove .la file and the static variant of libpopt
# have to remove the dependency from other .la files as well
for f in $RPM_BUILD_ROOT/%{_libdir}/*.la; do
sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f
done
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m 755 %{SOURCE8} $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/usr/sbin
ln -sf ../../etc/init.d/rpmconfigcheck $RPM_BUILD_ROOT/usr/sbin/rcrpmconfigcheck
cp -a suse_macros $RPM_BUILD_ROOT/usr/lib/rpm
mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/suse
ln -s ../suse_macros $RPM_BUILD_ROOT/usr/lib/rpm/suse/macros
for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
mkdir -p $RPM_BUILD_ROOT/usr/src/packages/$d
chmod 755 $RPM_BUILD_ROOT/usr/src/packages/$d
done
for d in $RPM_BUILD_ROOT/usr/lib/rpm/platform/*-linux/macros ; do
dd=${d%%-linux/macros}
dd=${dd##*/}
mkdir $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd
chmod 755 $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd
done
mkdir -p $RPM_BUILD_ROOT/var/lib/rpm
gzip -9 $RPM_BUILD_ROOT/%{_mandir}/man[18]/*.[18]
export RPM_BUILD_ROOT
%ifarch s390x
[ -f scripts/brp-%_arch-linux ] && sh scripts/brp-%_arch-linux
%endif
chmod 755 doc/manual
rm -rf doc/manual/Makefile*
rm -f $RPM_BUILD_ROOT/usr/lib/rpmpopt
rm -rf $RPM_BUILD_ROOT%{_mandir}/{fr,ja,ko,pl,ru,sk}
rm -f $RPM_BUILD_ROOT%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -c -m0644 %{SOURCE9} $RPM_BUILD_ROOT/var/adm/fillup-templates/
rm -f $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute $RPM_BUILD_ROOT/usr/lib/rpm/cpanflute2
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 scripts/find-supplements{,.ksyms} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 scripts/firmware.prov $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 scripts/debuginfo.prov $RPM_BUILD_ROOT/usr/lib/rpm
rm -f $RPM_BUILD_ROOT/usr/lib/locale $RPM_BUILD_ROOT/usr/lib/rpmrc
mkdir -p $RPM_BUILD_ROOT/etc/rpm
chmod 755 $RPM_BUILD_ROOT/etc/rpm
# remove some nonsense or non-working scripts
pushd $RPM_BUILD_ROOT/usr/lib/rpm/
for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
do
rm -f $f
done
for i in /usr/share/automake-*/*; do
if test -f "$i" && test -f "${i##*/}"; then
rm -f "${i##*/}"
fi
done
popd
gzip -9 CHANGES
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/rpm-plugins/*.la
sh $RPM_BUILD_ROOT/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT rpm
%ifarch armv7hl
# rpm is using the host_cpu as default for the platform, but armv7hl is not known by the kernel.
# so we need to enforce the platform here.
# We don't want to use armv7l because it would make us incompatible to Fedora and MeeGo plattforms.
echo -n armv7hl-suse-linux> $RPM_BUILD_ROOT/etc/rpm/platform
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{fillup_only -an services}
test -f var/lib/rpm/Packages || rpm --initdb
if test -s var/lib/rpm/packages.rpm ; then
echo "converting rpm-3 database to rpm-4 format..."
usr/lib/rpm/convertdb1 var/lib/rpm/packages.rpm
mv -f var/lib/rpm/packages.rpm var/lib/rpm/packages.rpm3
rm -f var/lib/rpm/conflictsindex.rpm var/lib/rpm/fileindex.rpm var/lib/rpm/groupindex.rpm var/lib/rpm/nameindex.rpm var/lib/rpm/providesindex.rpm var/lib/rpm/requiredby.rpm var/lib/rpm/triggerindex.rpm
fi
# delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
%postun
%{insserv_cleanup}
%files -f rpm.lang
%defattr(-,root,root)
%doc CHANGES.gz COPYING GROUPS
%doc doc/manual
%doc RPM-HOWTO RPM-Tips
/etc/rpm
/bin/rpm
/usr/bin/*
/etc/init.d/rpmconfigcheck
/usr/sbin/rcrpmconfigcheck
/usr/lib/rpm
%{_libdir}/rpm-plugins
%{_libdir}/librpm.so.*
%{_libdir}/librpmbuild.so.*
%{_libdir}/librpmio.so.*
%{_libdir}/librpmsign.so.*
%doc %{_mandir}/man[18]/*.[18]*
%dir /var/lib/rpm
%dir %attr(755,root,root) /usr/src/packages/BUILD
%dir %attr(755,root,root) /usr/src/packages/SPECS
%dir %attr(755,root,root) /usr/src/packages/SOURCES
%dir %attr(755,root,root) /usr/src/packages/SRPMS
%dir %attr(755,root,root) /usr/src/packages/RPMS
%dir %attr(755,root,root) /usr/src/packages/BUILDROOT
%dir %attr(755,root,root) /usr/src/packages/RPMS/*
/var/adm/fillup-templates/sysconfig.services-rpm
%files devel
%defattr(644,root,root,755)
/usr/include/rpm
%{_libdir}/librpm.so
%{_libdir}/librpmbuild.so
%{_libdir}/librpmio.so
%{_libdir}/librpmsign.so
%{_libdir}/pkgconfig/rpm.pc
%changelog
++++++ assumeexec.diff ++++++
--- tools/elfdeps.c.orig 2011-06-03 13:12:32.000000000 +0000
+++ tools/elfdeps.c 2011-06-03 13:17:45.000000000 +0000
@@ -14,6 +14,7 @@
int filter_private = 0;
int soname_only = 0;
+int assume_exec = 0;
typedef struct elfInfo_s {
Elf *elf;
@@ -226,7 +227,7 @@ static int processFile(const char *fn, i
ei->isElf64 = 0;
#endif
ei->isDSO = (ehdr->e_type == ET_DYN);
- ei->isExec = (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
+ ei->isExec = assume_exec || (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
processSections(ei);
}
@@ -279,6 +280,7 @@ int main(int argc, char *argv[])
{ "requires", 'R', POPT_ARG_VAL, &requires, -1, NULL, NULL },
{ "filter-private", 0, POPT_ARG_VAL, &filter_private, -1, NULL, NULL },
{ "soname-only", 0, POPT_ARG_VAL, &soname_only, -1, NULL, NULL },
+ { "assume-exec", 0, POPT_ARG_VAL, &assume_exec, -1, NULL, NULL },
POPT_AUTOHELP
POPT_TABLEEND
};
++++++ autodeps.diff ++++++
--- ./autodeps/linux.prov.orig 2011-07-12 11:28:13.000000000 +0000
+++ ./autodeps/linux.prov 2011-07-18 16:47:39.000000000 +0000
@@ -2,60 +2,72 @@
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
-filelist=`sed "s/['\"]/\\\&/g"`
-
-solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \
- xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
+solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
+ tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
+ cut -d: -f1))
pythonlist=
tcllist=
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
#
# --- Alpha does not mark 64bit dependencies
case `uname -m` in
- alpha*) mark64="" ;;
- *) mark64="()(64bit)" ;;
+ alpha*) mark64=false ;;
+ *) mark64=true ;;
esac
#
# --- Library sonames and weak symbol versions (from glibc).
-for f in $solist; do
- soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
+for f in "${solist[@]}"; do
+ soname=$(objdump -p "$f" | awk '/SONAME/ {print $2}')
+ [ -n "$soname" -a -L "$f" ] && continue
+ [ -z "$soname" ] && soname="${f##*/}"
- lib64=`if file -L $f 2>/dev/null | \
- grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- if [ "$soname" != "" ]; then
- if [ ! -L $f ]; then
- echo $soname$lib64
- objdump -p $f | awk '
- BEGIN { START=0 ; }
- /Version definitions:/ { START=1; }
- /^[0-9]/ && (START==1) { print $4; }
- /^$/ { START=0; }
- ' | \
- grep -v $soname | \
- while read symbol ; do
- echo "$soname($symbol)`echo $lib64 | sed 's/()//'`"
- done
- fi
+ if $mark64 && file -L "$f" 2>/dev/null | grep "ELF 64-bit" >/dev/null; then
+ lib64="()(64bit)" slib64="(64bit)"
else
- echo ${f##*/}$lib64
+ lib64= slib64=
fi
+ echo "$soname$lib64"
+ objdump -p "$f" | awk '
+ BEGIN { START=0 ; }
+ /Version definitions:/ { START=1; }
+ /^[0-9]/ && (START==1) { print $4; }
+ /^$/ { START=0; }
+ ' | \
+ while read symbol ; do
+ echo "$soname($symbol)$slib64"
+ done
done | sort -u
#
# --- Perl modules.
[ -x /usr/lib/rpm/perl.prov ] &&
- echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
+ printf "%s\n" "${filelist[@]}" | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
#
# --- Python modules.
[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.prov | sort -u
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.prov | sort -u
#
# --- Tcl modules.
[ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] &&
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.prov | sort -u
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u
+
+#
+# --- Mono exes/dlls
+: ${MONO_PREFIX=/usr}
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-provides || echo "WARNING: MONO RPM PROVIDES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
+fi
+
+#
+# --- Kernel module exported symbols
+[ -x /usr/lib/rpm/find-provides.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
exit 0
--- ./autodeps/linux.req.orig 2011-07-15 09:32:41.000000000 +0000
+++ ./autodeps/linux.req 2011-07-18 16:51:24.000000000 +0000
@@ -18,20 +18,21 @@ fi
#
# --- Grab the file manifest and classify files.
-#filelist=`sed "s/['\"]/\\\&/g"`
-filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
-exelist=`echo $filelist | xargs -r file | \
+#filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+exelist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
grep -Ev ":.* (commands|script)[, ]" | \
- grep ":.*executable" | cut -d: -f1`
-scriptlist=`echo $filelist | xargs -r file | \
- grep -E ":.* (commands|script)[, ]" | cut -d: -f1`
-liblist=`echo $filelist | xargs -r file | \
- grep ":.*shared object" | cut -d : -f1`
+ grep ":.*executable" | cut -d: -f1))
+scriptlist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ grep -E ":.* (commands|script)[, ]" | cut -d: -f1))
+liblist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ grep ":.*shared object" | cut -d : -f1))
-interplist=
-perllist=
-pythonlist=
-tcllist=
+interplist=()
+perllist=()
+pythonlist=()
+tcllist=()
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
#
# --- Alpha does not mark 64bit dependencies
@@ -43,12 +44,12 @@ esac
if [ "$needed" -eq 0 ]; then
#
# --- Executable dependency sonames.
- for f in $exelist; do
- [ -r $f -a -x $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+ for f in "${exelist[@]}"; do
+ [ -r "$f" -a -x "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
+ ldd "$f" | awk '/=>/ {
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -57,12 +58,12 @@ if [ "$needed" -eq 0 ]; then
#
# --- Library dependency sonames.
- for f in $liblist; do
- [ -r $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+ for f in "${liblist[@]}"; do
+ [ -r "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
+ ldd "$f" | awk '/=>/ {
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -72,30 +73,30 @@ fi
#
# --- Script interpreters.
-for f in $scriptlist; do
- [ -r $f -a -x $f ] || continue
- interp=`head -n 1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
- interplist="$interplist $interp"
+for f in "${scriptlist[@]}"; do
+ [ -r "$f" -a -x "$f" ] || continue
+ interp=`head -n 1 "$f" | sed -ne 's/^\#\![ ]*//p' | cut -d" " -f1`
+ interplist=("${interplist[@]}" "$interp")
case $interp in
- */perl) perllist="$perllist $f" ;;
+ */perl) perllist=("${perllist[@]}" "$f") ;;
esac
done
-[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; }
+[ -n "$interplist" ] && { printf "%s\n" "${interplist[@]}" | sort -u ; }
#
# --- Add perl module files to perllist.
-for f in $filelist; do
- [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
+for f in "${filelist[@]}"; do
+ [ -r "$f" -a "${f%.pm}" != "${f}" ] && perllist=("${perllist[@]}" "$f")
done
#
# --- Weak symbol versions (from glibc).
[ -n "$mark64" ] && mark64="(64bit)"
-for f in $liblist $exelist ; do
- [ -r $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+for f in "${liblist[@]}" "${exelist[@]}" ; do
+ [ -r "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
+ objdump -p "$f" | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
/^$/ { START=0; }
/^Dynamic Section:$/ { START=1; }
(START==1) && /NEEDED/ {
@@ -112,7 +113,7 @@ for f in $liblist $exelist ; do
sub(/:/, "", $3);
LIBNAME=$3;
}
- (START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
+ (START==2) && (LIBNAME!="") && ($4!="") {
print LIBNAME "(" $4 ")'$lib64'";
}
'
@@ -120,17 +121,29 @@ done | sort -u
#
# --- Perl modules.
-[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
- echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
+#[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
+# printf "%s\n" "${perllist[@]}" | /usr/lib/rpm/perl.req | sort -u
#
# --- Python modules.
[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.req | sort -u
#
# --- Tcl modules.
[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.req | sort -u
+
+#
+# --- Mono exes/dlls
+: ${MONO_PREFIX=/usr}
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-requires || echo "WARNING: MONO RPM REQUIRES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
+fi
+
+#
+# --- Kernel module imported symbols
+[ -x ${0%/*}/find-requires.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
exit 0
++++++ baselibs.conf ++++++
rpm
arch ppc package rpm-devel
arch sparcv9 package rpm-devel
++++++ beecrypt-4.1.2.diff ++++++
--- beecrypt-4.1.2/Makefile.am.orig 2004-12-22 07:06:31.000000000 +0000
+++ beecrypt-4.1.2/Makefile.am 2006-11-24 14:08:27.000000000 +0000
@@ -49,7 +49,7 @@ libaltdir=$(prefix)/lib@LIBALT@
libalt_LTLIBRARIES = libbeecrypt.la
-libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c rsa.c rsakp.c rsapk.c sha1.c sha256.c sha384.c sha512.c sha_k.c timestamp.c cppglue.cxx
+libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c rsa.c rsakp.c rsapk.c sha1.c sha256.c sha384.c sha512.c sha_k.c timestamp.c
libbeecrypt_la_DEPENDENCIES = $(BEECRYPT_OBJECTS)
libbeecrypt_la_LIBADD = aesopt.lo blowfishopt.lo mpopt.lo sha1opt.lo
libbeecrypt_la_LDFLAGS = -no-undefined -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_LT_REVISION):$(LIBBEECRYPT_LT_AGE)
@@ -62,5 +62,11 @@ EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTOR
DISTCLEANFILES = mpopt.s aesopt.s blowfishopt.s sha1opt.s
+BUILT_SOURCES = listobjs
+
+.PHONY: listobjs
+listobjs:
+ @echo $(libbeecrypt_la_OBJECTS) $(libbeecrypt_la_LIBADD) > $@
+
bench:
(cd tests && $(MAKE) $(AM_MAKEFLAGS) bench)
--- beecrypt-4.1.2/base64.c.orig 2004-12-19 20:21:04.000000000 +0000
+++ beecrypt-4.1.2/base64.c 2006-11-24 14:08:27.000000000 +0000
@@ -253,7 +253,6 @@ char* b64encode(const void* data, size_t
unsigned c;
if (s == NULL) return NULL;
- if (*s == '\0') return calloc(1, sizeof(*t));
if (ns == 0) ns = strlen((const char*) s);
nt = ((ns + 2) / 3) * 4;
--- beecrypt-4.1.2/c++/io/DataOutputStream.cxx.orig 2004-11-04 12:38:15.000000000 +0000
+++ beecrypt-4.1.2/c++/io/DataOutputStream.cxx 2006-11-24 14:09:35.000000000 +0000
@@ -126,8 +126,8 @@ void DataOutputStream::writeLong(javalon
void DataOutputStream::writeChar(javaint v) throw (IOException)
{
_lock.lock();
- out.write((v >> 8) && 0xff);
- out.write((v ) && 0xff);
+ out.write((v >> 8) & 0xff);
+ out.write((v ) & 0xff);
written += 2;
_lock.unlock();
}
++++++ brp.diff ++++++
SUSE specific brp script patches
Index: scripts/Makefile.am
===================================================================
--- scripts/Makefile.am.orig
+++ scripts/Makefile.am
@@ -6,6 +6,7 @@ CLEANFILES =
EXTRA_DIST = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux brp-symlink \
brp-strip brp-strip-comment-note brp-python-hardlink \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
@@ -24,6 +25,7 @@ EXTRA_DIST = \
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux brp-symlink \
brp-strip brp-strip-comment-note brp-python-hardlink \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
Index: scripts/brp-lib64-linux
===================================================================
--- /dev/null
+++ scripts/brp-lib64-linux
@@ -0,0 +1,42 @@
+#!/bin/bash
+# script checks wether package is 64-bit clean
+# and also for a linker bug. (linker allows 64bit libs to link 32bit libs)
+echo "sf@suse.de: if you find problems with this script, drop me a note"
+# If using normal root, avoid changing anything:
+if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
+ exit 0
+fi
+files=
+tfiles=
+LC_ALL=
+LANG=
+# check for 64-bit libs in */lib
+for p in `grep -v 'lib64' /etc/ld.so.conf`
+do
+ if test -d $RPM_BUILD_ROOT$p ; then
+ for f in `find $RPM_BUILD_ROOT$p \
+ -maxdepth 1 -type f -name \*.so\* -o -name \*.a -follow 2>/dev/null`
+ do
+ [ $HOSTTYPE = s390x ] && case $f in */lib/ld64.so.1) continue; esac
+ objdump -f $f 2>/dev/null | grep 'format elf64' \
+ && { echo "$f: should be in */lib64"; exit 1; }
+
+ done
+ fi
+done
+
+# check for 64 bit libs that have an rpath to a 32 bit Library
+
+for p in `grep 'lib64' /etc/ld.so.conf`
+do
+ if test -d $RPM_BUILD_ROOT$p ; then
+ for f in `find $RPM_BUILD_ROOT$p \
+ -maxdepth 1 -type f -name \*.so\* -o -name \*.a -follow 2>/dev/null`
+ do
+ # check for rpath to 32bit libs
+ objdump -x $f 2>/dev/null | grep -v "lib64" | grep -i 'rpath.*lib$' \
+ && { echo "$f: rpath to 32bit lib"; exit 1; }
+ done
+ fi
+done
+exit 0
Index: scripts/brp-strip
===================================================================
--- scripts/brp-strip.orig
+++ scripts/brp-strip
@@ -15,6 +15,7 @@ esac
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep -v ' shared object,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP -g "$f" || :
done
Index: scripts/brp-strip-comment-note
===================================================================
--- scripts/brp-strip-comment-note.orig
+++ scripts/brp-strip-comment-note
@@ -16,6 +16,8 @@ esac
# for already stripped elf files in the build root
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
+ grep -v ' shared object,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
note="-R .note"
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
Index: scripts/brp-symlink
===================================================================
--- /dev/null
+++ scripts/brp-symlink
@@ -0,0 +1,186 @@
+#!/bin/sh
+
+# Task: go through the files in $RPM_BUILD_ROOT and
+# relink symbolic links so that:
+# links crossing top level directory boundaries (/usr/* -> /etc/*)
+# are absolute links
+# links below one top level directory (/usr/bin/* -> /usr/lib/*)
+# are relative links
+# NOTE: we're not doing this to fix a problem (as no matter how you
+# do it you fix one problem by creating another). We're doing it
+# so we can document this as policy - so you can rely on it
+
+# Additional Task: check some usual errors arround symlinks e.g.
+# dangling symlinks or symlinks to init scripts in wrong location
+
+# Author: Stephan Kulow
+
+# If using normal root, avoid changing anything.
+if [ -z "$RPM_BUILD_ROOT" ]; then
+ exit 0
+fi
+
+LC_ALL=
+LANG=
+LC_TIME=POSIX
+
+BASENAME=/usr/bin/basename
+DIRNAME=/usr/bin/dirname
+READLINK=/usr/bin/readlink
+
+cd $RPM_BUILD_ROOT
+
+had_errors=0
+
+links=`find . -type l | sed -e "s,^./,/,"`
+for link in $links
+do
+ link_dest=`$READLINK ./$link`
+ orig_link_dest=$link_dest
+
+ new_link_dest=NONE
+ link_dir=`$DIRNAME $link`
+
+ case $link_dest in
+ .|..|../..) # link to current dir
+ continue ;;
+ .*) # relative links up
+ link_dest="$link_dir/$link_dest"
+ ;;
+ /*) # absolute links
+ ;;
+ */*) # relative links down
+ link_dest="$link_dir/$link_dest"
+ ;;
+ *) # the rest
+ continue
+ esac
+
+ # cleaning out double slash
+ link_dest=`echo $link_dest | sed -e 's,//*,/,g; s,/\.$,/,; s,/$,,'`
+
+ # eliminating /./ components
+ link_dest=`echo $link_dest | sed -e "s,/\./,/,g"`;
+
+ counter=0
+ # eliminating back references
+ while echo $link_dest | egrep -q '/\.\.'; do
+ link_dest=`echo $link_dest | sed -e "s,/[^/]*/\.\.,,"`;
+ case $link_dest in
+ /..*) # this is very mean
+ echo "ERROR: $link points to illegal $link_dest"
+ exit 1
+ ;;
+ esac
+ counter=$((counter + 1))
+ if test $counter -gt 10; then
+ echo "ERROR: more than 10 back references in $link?"
+ exit 1
+ fi
+ done
+
+ # black list
+ case "$link,$link_dest" in
+ *,/var/lib/named*)
+ continue;;
+ /usr/etc,*|/usr/tmp,*)
+ continue;;
+ */share/texmf/*|/usr/share/terminfo/*)
+ continue;;
+ /sbin/init,*) # don't create absolute symlink for /sbin/init
+ continue;;
+ *share/automake-*)
+ echo "ERROR: link target $link points into automake directory"
+ echo " You might want to add a -c to the automake call (or just"
+ echo " skip the files from packaging)"
+ exit 1
+ ;;
+ *,/opt/kde3/share/doc*/HTML/*/common) # white listed for not existant
+ ;;
+ *,/usr/share/doc/kde/HTML/*/common) # white listed for not existant
+ ;;
+ *,/proc/*) # links pointing into /proc file system
+ ;;
+ *)
+ if test ! -L ./$link_dest && test ! -e $link_dest && test ! -e ./$link_dest; then
+ echo "ERROR: link target doesn't exist (neither in build root nor in installed system):"
+ echo " $link -> $link_dest"
+ echo "Add the package providing the target to neededforbuild and Requires"
+ test "$NO_BRP_STALE_LINK_ERROR" != "yes" && had_errors=1
+ fi
+ ;;
+ esac
+
+ forced_absolute=0
+ for prefix in /usr/X11R6/lib/X11 /usr/X11R6/include/X11 /usr/X11R6/lib/X11/app-defaults ; do
+ if echo $link | grep -q "^$prefix/"; then
+ if echo $link_dest | grep -q "^$prefix/"; then
+ # if it's below it, it's fine
+ :
+ else
+ forced_absolute=1
+ fi
+ fi
+ done
+
+ dest_dir=`$DIRNAME $link_dest`
+
+ # figuring out (currently) correct destination
+ if test "$link_dir" = "$dest_dir" || test "$dest_dir" = "."; then
+ new_link_dest=`$BASENAME $link_dest`
+ else
+ # figuring out top level directory
+ top_link=`echo $link | sed -e 's,^\(/[^/]*\)/.*,\1,'`
+ top_dest=`echo $link_dest | sed -e 's,^\(/[^/]*\)/.*,\1,'`
+ if test "$forced_absolute" = 0 && test "$top_link" = "$top_dest"; then # supposed to be relative
+
+ # first we need to cut out the common prefix
+ link_tmp=$link
+ while test "$top_link" = "$top_dest"; do
+ link_orig=$link_tmp
+ dest_orig=$link_dest
+ link_tmp=`echo $link_tmp | sed -e 's,^\(/[^/]*\)/,/,'`
+ link_dest=`echo $link_dest | sed -e 's,^\(/[^/]*\)/,/,'`
+ top_link=`echo $link_tmp | sed -e 's,^\(/[^/]*\)/.*,\1,'`
+ top_dest=`echo $link_dest | sed -e 's,^\(/[^/]*\)/.*,\1,'`
+
+ if test "$top_dest" = "$dest_orig" || test "$top_link" = "$link_orig"; then
+ link_tmp=$link_orig
+ link_dest=$dest_orig
+ break
+ fi
+ done
+
+ # now we add a .. for every directory component
+ link_tmp=`$DIRNAME $link_tmp`
+
+ if test "$link_tmp" = "$link_dest"; then
+ new_link_dest=.
+ elif test "$link_tmp" != "/"; then # we have a directory component
+ link_rel=
+
+ while test -n "$link_tmp"; do
+ link_tmp=`echo $link_tmp | sed -e 's,^\(/[^/]*\),,'`
+ link_rel="../$link_rel"
+ done
+
+ new_link_dest=`echo $link_rel/$link_dest | sed -e "s,//*,/,g"`
+ else
+ # get rid of the slash
+ link_dest=`echo $link_dest | sed -e 's,^/,,'`
+ new_link_dest=$link_dest
+ fi
+ else
+ new_link_dest=$link_dest
+ fi
+ fi
+
+ if test "$new_link_dest" != NONE && test "$new_link_dest" != "$orig_link_dest"; then
+ echo "INFO: relinking $link -> $new_link_dest (was $orig_link_dest)"
+ rm ./$link && ln -s $new_link_dest ./$link
+ fi
+done
+
+if test "$had_errors" = 1; then
+ exit 1
+fi
++++++ brpcompress.diff ++++++
--- ./scripts/brp-compress.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/brp-compress 2011-05-11 14:44:21.000000000 +0000
@@ -5,51 +5,78 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD
exit 0
fi
+LC_ALL=
+LANG=
+LC_TIME=POSIX
+
cd $RPM_BUILD_ROOT
# Compress man pages
COMPRESS="gzip -9 -n"
COMPRESS_EXT=.gz
+function check_for_hard_link
+{
+ dir=$1
+ b=$2
+
+ inode=`ls -i $b | awk '{ print $1 }'`
+ others=`find $dir -type f -inum $inode`
+ for afile in $others ; do
+ [ "$afile" != "$b" ] && rm -f "$afile"
+ done
+
+ case $b in
+ *.Z|*.gz) gunzip $b ;;
+ *.bz2) bunzip2 $b ;;
+ *.xz|*.lzma) unxz $b ;;
+ esac
+
+ type=${b##*.}
+ for afile in $others ; do
+ [ "${afile%.$type}" != "${b%.$type}" ] && ln ${b%.$type} ${afile%.$type}
+ done
+}
+
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f ! -name dir`
+ find $d -type f ! -name dir | while read f
do
[ -f "$f" ] || continue
case "$f" in
- *.gz|*.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
- *.xz|*.lzma) unxz -f $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
- *) b=$f;;
+ *.gz|*.Z) gunzip "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
+ *.bz2) bunzip2 "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.bz2$//'`;;
+ *.xz|*.lzma) unxz "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
+ *) b="$f";;
esac
- $COMPRESS $b /dev/null || {
+ $COMPRESS "$b" /dev/null || {
inode=`ls -i $b | awk '{ print $1 }'`
others=`find $d -type f -inum $inode`
if [ -n "$others" ]; then
for afile in $others ; do
- [ "$afile" != "$b" ] && rm -f $afile
+ [ "$afile" != "$b" ] && rm -f "$afile"
done
- $COMPRESS -f $b
+ $COMPRESS -f "$b"
for afile in $others ; do
- [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
+ [ "$afile" != "$b" ] && ln "$b$COMPRESS_EXT" "$afile$COMPRESS_EXT"
done
else
- $COMPRESS -f $b
+ $COMPRESS -f "$b"
fi
}
done
- for f in `find $d -type l`
+ find $d -type l | while read f
do
- l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
- rm -f $f
- b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
- ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
+ l="`ls -l "$f" | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ rm -f "$f"
+ b="`echo "$f" | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ ln -sf "$l$COMPRESS_EXT" "$b$COMPRESS_EXT"
done
done
++++++ build.diff ++++++
Many changes to Makefiles/autogen and the like to make it build
on SUSE systems.
--- ./configure.ac.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./configure.ac 2011-05-11 15:18:44.000000000 +0000
@@ -850,6 +850,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm
mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
+parisc*|hppa*) RPMCANONCOLOR=0; RPMCANONARCH=hppa ;;
sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
*) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
@@ -860,6 +861,7 @@ esac
RPMCANONVENDOR="$build_vendor"
case "${build_vendor}" in
unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
+ RPMCANONVENDOR=suse
test -f /etc/redhat-release && RPMCANONVENDOR=redhat
test -f /etc/SuSE-release && RPMCANONVENDOR=suse
test -f /etc/pld-release && RPMCANONVENDOR=pld
@@ -872,6 +874,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec
esac
RPMCANONOS="$host_os_noversion"
RPMCANONGNU="$host_os_gnu"
+if test "$RPMCANONVENDOR" = suse ; then
+ RPMCANONCOLOR=0
+fi
AC_SUBST(RPMCANONCOLOR)
AC_SUBST(RPMCANONARCH)
AC_SUBST(RPMCANONVENDOR)
--- ./db3/configure.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./db3/configure 2011-05-11 15:18:44.000000000 +0000
@@ -10,9 +10,9 @@ rm -f config.cache
# XXX edit CFLAGS= ... out of invocation args ???
ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`"
-CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
+CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \
--enable-shared --enable-static \
- --with-uniquename=_rpmdb --srcdir=$db_dist
+ --with-uniquename=_rpmdb --srcdir=$db_dist $ARGS
mv Makefile Makefile.orig
cat Makefile.orig | sed -e '/^install[:-]/c\
--- ./installplatform.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./installplatform 2011-05-11 15:18:44.000000000 +0000
@@ -19,7 +19,7 @@
case "$arch" in
i[3456]86|pentium[34]|athlon|geode) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_pentium3_ s_i386_pentium4_ s_i386_athlon_ s_i386_geode_' ;;
alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
- arm*) SUBSTS='s_arm_arm_ s_arm_armv3l_ s_arm_armv4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_ s_arm_armv7l_' ;;
+ arm*) SUBSTS='s_arm_arm_ s_arm_armv3l_ s_arm_armv4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_ s_arm_armv7l_ s_arm_armv7hl_' ;;
sh4*) SUBSTS='s_sh4_sh4_ s_sh4_sh4a_' ;;
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_' ;;
@@ -47,9 +47,9 @@
ARCH_INSTALL_POST='%{nil}'
case "${ARCH}-${OS}" in
sparc64*-linux) LIB=lib64 ;;
- s390x-linux) LIB=lib64 ;;
- ppc64-linux|powerpc64-linux) LIB=lib64 ;;
- x86_64-linux|amd64-linux|ia32e-linux) LIB=lib64 ;;
+ s390x-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;;
+ ppc64-linux|powerpc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;;
+ x86_64-linux|amd64-linux|ia32e-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;;
*) LIB=lib;;
esac
@@ -129,6 +130,9 @@
apple)
VENDORSED='-e s,^@apple@,,'
;;
+ suse)
+ VENDORSED='-e s,^@SuSE@,,'
+ ;;
esac
CANONARCH="`echo $ARCH|sed -e "$canonarch_sed"`"
++++++ buildidprov.diff ++++++
From: Jan Blunck
Subject: Let debuginfo packages provide the build-id
This patch lets debuginfo packages provide build-id like follows:
debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517
Users can therefore ask zypper to install the correct debuginfo package with:
zypper install -C "debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517"
--- ./autodeps/linux.prov.orig 2011-05-11 15:58:28.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 15:59:31.000000000 +0000
@@ -5,6 +5,9 @@
IFS=$'\n'
filelist=($(cat))
+debuginfolist=($(printf "%s\n" "${filelist[@]}" | grep "/usr/lib/debug/"))
+filelist=($(printf "%s\n" "${filelist[@]}" | grep -v "/usr/lib/debug/"))
+
solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
cut -d: -f1))
@@ -71,6 +74,11 @@ done | sort -u
printf "%s\n" "${firmwarelist[@]}" | /usr/lib/rpm/firmware.prov | sort -u
#
+# --- debuginfo files
+[ -x /usr/lib/rpm/debuginfo.prov -a -n "$debuginfolist" ] &&
+ printf "%s\n" "${debuginfolist[@]}" | /usr/lib/rpm/debuginfo.prov | sort -u
+
+#
# --- Mono exes/dlls
: ${MONO_PREFIX=/usr}
if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
--- ./macros.in.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:31.000000000 +0000
@@ -182,7 +182,8 @@
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
-AutoReqProv: 0\
+AutoReq: 0\
+AutoProv: 1\
#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
--- ./scripts/debuginfo.prov.orig 2011-05-11 15:59:31.000000000 +0000
+++ ./scripts/debuginfo.prov 2011-05-11 15:59:31.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+while read instfile ; do
+ case $instfile in
+ */usr/lib/debug/.build-id/*.debug)
+ if [ -f "$instfile" ] ; then
+ BUILDID=$(echo $instfile | sed -ne 's|.*/usr/lib/debug/.build-id/\([0-9a-f]*\)/\([0-9a-f]*\)\.debug|\1\2|p')
+ echo "debuginfo(build-id) = $BUILDID"
+ fi
+ ;;
+ esac
+done
++++++ buildpipe.diff ++++++
--- ./build/rpmfc.c.orig 2011-07-18 17:40:37.000000000 +0000
+++ ./build/rpmfc.c 2011-07-18 17:40:56.000000000 +0000
@@ -182,12 +182,14 @@ static int sigpipe_init(void)
fcntl(_sigpipe[1], F_SETFD, (fcntl(_sigpipe[1], F_GETFD)|FD_CLOEXEC));
/* XXX SIGPIPE too, but NSPR disables it already, dont mess with it */
signal(SIGCHLD, sigpipe_handler);
+ signal(SIGPIPE, SIG_IGN);
return _sigpipe[0];
}
static void sigpipe_finish(void)
{
signal(SIGCHLD, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
close(_sigpipe[0]);
close(_sigpipe[1]);
_sigpipe[0] = -1;
++++++ checkfilesnoinfodir.diff ++++++
Exclude /usr/share/info/dir from check-files. Probably only
interesting for SUSE.
Index: scripts/check-files
===================================================================
--- scripts/check-files.orig
+++ scripts/check-files
@@ -22,7 +22,9 @@ LC_ALL=C sort > $FILES_RPM
diff -d "$FILES_DISK" "$FILES_RPM" | grep "^< " | cut -c3- |
while read f; do
- echo $f | sed -e "s#^$RPM_BUILD_ROOT# #g"
+ if test "$RPM_BUILD_ROOT/usr/share/info/dir" != "$f" ; then
+ echo $f | sed -e "s#^$RPM_BUILD_ROOT# #g"
+ fi
done
rm -f $FILES_DISK
++++++ convertdb1static.diff ++++++
Build convertdb1, too.
--- ./Makefile.am.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:18:21.000000000 +0000
@@ -174,6 +174,10 @@ bin_PROGRAMS += rpmqpack
rpmqpack_SOURCES = rpmqpack.c
rpmqpack_LDADD = lib/librpm.la
+bin_PROGRAMS += convertdb1
+convertdb1_SOURCES = tools/convertdb1.c
+convertdb1_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- tools/convertdb1.c.orig 2011-05-12 13:31:37.000000000 +0000
+++ tools/convertdb1.c 2011-05-12 13:31:28.000000000 +0000
@@ -0,0 +1,351 @@
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+const char *__progname;
+#else
+#include
+#include
+#include
+#endif
+
+#include
+#include
+#include
+#include
+#include
+
+#define FA_MAGIC 0x02050920
+
+struct faFileHeader{
+ unsigned int magic;
+ unsigned int firstFree;
+};
+
+struct faHeader {
+ unsigned int size;
+ unsigned int freeNext; /* offset of the next free block, 0 if none */
+ unsigned int freePrev;
+ unsigned int isFree;
+
+ /* note that the u16's appear last for alignment/space reasons */
+};
+
+
+static int fadFileSize;
+
+static ssize_t Pread(FD_t fd, void * buf, size_t count, off_t offset) {
+ if (Fseek(fd, offset, SEEK_SET) < 0)
+ return -1;
+ return Fread(buf, sizeof(char), count, fd);
+}
+
+static FD_t fadOpen(const char * path)
+{
+ struct faFileHeader newHdr;
+ FD_t fd;
+ struct stat stb;
+
+ fd = Fopen(path, "r.fdio");
+ if (!fd || Ferror(fd))
+ return NULL;
+
+ if (fstat(Fileno(fd), &stb)) {
+ Fclose(fd);
+ return NULL;
+ }
+ fadFileSize = stb.st_size;
+
+ /* is this file brand new? */
+ if (fadFileSize == 0) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (Pread(fd, &newHdr, sizeof(newHdr), 0) != sizeof(newHdr)) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (newHdr.magic != FA_MAGIC) {
+ Fclose(fd);
+ return NULL;
+ }
+ /*@-refcounttrans@*/ return fd /*@=refcounttrans@*/ ;
+}
+
+static int fadNextOffset(FD_t fd, unsigned int lastOffset)
+{
+ struct faHeader header;
+ int offset;
+
+ offset = (lastOffset)
+ ? (lastOffset - sizeof(header))
+ : sizeof(struct faFileHeader);
+
+ if (offset >= fadFileSize)
+ return 0;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!lastOffset && !header.isFree)
+ return (offset + sizeof(header));
+
+ do {
+ offset += header.size;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!header.isFree) break;
+ } while (offset < fadFileSize && header.isFree);
+
+ if (offset < fadFileSize) {
+ /* Sanity check this to make sure we're not going in loops */
+ offset += sizeof(header);
+
+ if (offset <= lastOffset) return -1;
+
+ return offset;
+ } else
+ return 0;
+}
+
+static int fadFirstOffset(FD_t fd)
+{
+ return fadNextOffset(fd, 0);
+}
+
+/*@-boundsread@*/
+static int dncmp(const void * a, const void * b)
+ /*@*/
+{
+ const char *const * first = a;
+ const char *const * second = b;
+ return strcmp(*first, *second);
+}
+/*@=boundsread@*/
+
+static void compressFilelist(Header h)
+{
+ struct rpmtd_s fileNames;
+ char ** dirNames;
+ const char ** baseNames;
+ uint32_t * dirIndexes;
+ rpm_count_t count;
+ int xx, i;
+ int dirIndex = -1;
+
+ /*
+ * This assumes the file list is already sorted, and begins with a
+ * single '/'. That assumption isn't critical, but it makes things go
+ * a bit faster.
+ */
+
+ if (headerIsEntry(h, RPMTAG_DIRNAMES)) {
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+ return; /* Already converted. */
+ }
+
+ if (!headerGet(h, RPMTAG_OLDFILENAMES, &fileNames, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&fileNames);
+ if (count < 1)
+ return;
+
+ dirNames = xmalloc(sizeof(*dirNames) * count); /* worst case */
+ baseNames = xmalloc(sizeof(*dirNames) * count);
+ dirIndexes = xmalloc(sizeof(*dirIndexes) * count);
+
+ /* HACK. Source RPM, so just do things differently */
+ { const char *fn = rpmtdGetString(&fileNames);
+ if (fn && *fn != '/') {
+ dirIndex = 0;
+ dirNames[dirIndex] = xstrdup("");
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ dirIndexes[i] = dirIndex;
+ baseNames[i] = rpmtdGetString(&fileNames);
+ }
+ goto exit;
+ }
+ }
+
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ char ** needle;
+ char savechar;
+ char * baseName;
+ size_t len;
+ const char *filename = rpmtdGetString(&fileNames);
+
+ if (filename == NULL) /* XXX can't happen */
+ continue;
+ baseName = strrchr(filename, '/') + 1;
+ len = baseName - filename;
+ needle = dirNames;
+ savechar = *baseName;
+ *baseName = '\0';
+ if (dirIndex < 0 ||
+ (needle = bsearch(&filename, dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) {
+ char *s = xmalloc(len + 1);
+ rstrlcpy(s, filename, len + 1);
+ dirIndexes[i] = ++dirIndex;
+ dirNames[dirIndex] = s;
+ } else
+ dirIndexes[i] = needle - dirNames;
+
+ *baseName = savechar;
+ baseNames[i] = baseName;
+ }
+
+exit:
+ if (count > 0) {
+ headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, count);
+ headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, count);
+ headerPutStringArray(h, RPMTAG_DIRNAMES,
+ (const char **) dirNames, dirIndex + 1);
+ }
+
+ rpmtdFreeData(&fileNames);
+ for (i = 0; i <= dirIndex; i++) {
+ free(dirNames[i]);
+ }
+ free(dirNames);
+ free(baseNames);
+ free(dirIndexes);
+
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+}
+
+/*
+ * Up to rpm 3.0.4, packages implicitly provided their own name-version-release.
+ * Retrofit an explicit "Provides: name = epoch:version-release.
+ */
+static void providePackageNVR(Header h)
+{
+ const char *name;
+ char *pEVR;
+ rpmsenseFlags pFlags = RPMSENSE_EQUAL;
+ int bingo = 1;
+ struct rpmtd_s pnames;
+ rpmds hds, nvrds;
+
+ /* Generate provides for this package name-version-release. */
+ pEVR = headerGetEVR(h, &name);
+ if (!(name && pEVR))
+ return;
+
+ /*
+ * Rpm prior to 3.0.3 does not have versioned provides.
+ * If no provides at all are available, we can just add.
+ */
+ if (!headerGet(h, RPMTAG_PROVIDENAME, &pnames, HEADERGET_MINMEM)) {
+ goto exit;
+ }
+
+ /*
+ * Otherwise, fill in entries on legacy packages.
+ */
+ if (!headerIsEntry(h, RPMTAG_PROVIDEVERSION)) {
+ while (rpmtdNext(&pnames) >= 0) {
+ rpmsenseFlags fdummy = RPMSENSE_ANY;
+
+ headerPutString(h, RPMTAG_PROVIDEVERSION, "");
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &fdummy, 1);
+ }
+ goto exit;
+ }
+
+ /* see if we already have this provide */
+ hds = rpmdsNew(h, RPMTAG_PROVIDENAME, 0);
+ nvrds = rpmdsSingle(RPMTAG_PROVIDENAME, name, pEVR, pFlags);
+ if (rpmdsFind(hds, nvrds) >= 0) {
+ bingo = 0;
+ }
+ rpmdsFree(hds);
+ rpmdsFree(nvrds);
+
+exit:
+ if (bingo) {
+ const char *evr = pEVR;
+ headerPutString(h, RPMTAG_PROVIDENAME, name);
+ headerPutString(h, RPMTAG_PROVIDEVERSION, evr);
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pFlags, 1);
+ }
+ rpmtdFreeData(&pnames);
+ free(pEVR);
+}
+/*@=bounds@*/
+
+static rpmdb db;
+
+int
+main(int argc, char ** argv)
+{
+ FD_t fd;
+ int offset;
+ Header h;
+ const char *name;
+ const char *version;
+ const char *release;
+ rpmts ts;
+
+ if (argc != 2)
+ {
+ fprintf(stderr, "usage: %s \n", argv[0]);
+ exit(1);
+ }
+ if ((fd = fadOpen(argv[1])) == 0)
+ {
+ fprintf(stderr, "could not open %s\n", argv[1]);
+ exit(1);
+ }
+ rpmInitMacros(NULL, "/usr/lib/rpm/macros");
+
+ /* speed things up */
+ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1);
+
+ ts = rpmtsCreate();
+
+ if (rpmtsOpenDB(ts, O_RDWR)) {
+ fprintf(stderr, "could not open rpm database\n");
+ exit(1);
+ }
+
+ for (offset = fadFirstOffset(fd); offset; offset = fadNextOffset(fd, offset))
+ {
+ rpmdbMatchIterator mi;
+
+ /* have to use lseek instead of Fseek because headerRead
+ * uses low level IO
+ */
+ if (lseek(Fileno(fd), (off_t)offset, SEEK_SET) == -1)
+ {
+ perror("lseek");
+ continue;
+ }
+ h = headerRead(fd, HEADER_MAGIC_NO);
+ if (!h)
+ continue;
+ compressFilelist(h);
+ providePackageNVR(h);
+ headerNVR(h, &name, &version, &release);
+ mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0);
+ rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, version);
+ rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, release);
+ if (rpmdbNextIterator(mi))
+ {
+ printf("%s-%s-%s is already in database\n", name, version, release);
+ rpmdbFreeIterator(mi);
+ headerFree(h);
+ continue;
+ }
+ rpmdbFreeIterator(mi);
+ if (rpmtsHeaderAddDB(ts, h))
+ {
+ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release);
+ }
+ headerFree(h);
+ }
+ Fclose(fd);
+ rpmtsCloseDB(ts);
+ rpmtsFree(ts);
+ return 0;
+}
+
++++++ db.diff ++++++
--- db/db/db.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db.c 2011-05-12 11:38:59.000000000 +0000
@@ -646,6 +646,8 @@ __env_mpool(dbp, fname, flags)
MAKE_INMEM(dbp);
return (ret);
}
+ if (LF_ISSET(DB_NOFSYNC) && mpf->mfp)
+ F_SET(mpf->mfp, MP_NOFSYNC);
/*
* Set the open flag. We use it to mean that the dbp has gone
--- db/db/db_iface.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db_iface.c 2011-05-12 11:21:32.000000000 +0000
@@ -1230,6 +1230,7 @@ __db_open_arg(dbp, txn, fname, dname, ty
#define OKFLAGS \
(DB_AUTO_COMMIT | DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING | \
DB_MULTIVERSION | DB_NOMMAP | DB_NO_AUTO_COMMIT | DB_RDONLY | \
+ DB_NOFSYNC | \
DB_RDWRMASTER | DB_READ_UNCOMMITTED | DB_THREAD | DB_TRUNCATE)
if ((ret = __db_fchk(env, "DB->open", flags, OKFLAGS)) != 0)
return (ret);
--- db/dbinc/mp.h.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/dbinc/mp.h 2011-05-12 12:01:32.000000000 +0000
@@ -467,6 +467,7 @@ struct __mpoolfile {
#define MP_FAKE_UOC 0x080 /* Unlink_on_close field: fake flag. */
#define MP_NOT_DURABLE 0x100 /* File is not durable. */
#define MP_TEMP 0x200 /* Backing file is a temporary. */
+#define MP_NOFSYNC 0x400 /* Don't fsync */
u_int32_t flags;
};
--- db/dbinc_auto/api_flags.in.orig 2011-05-12 11:40:57.000000000 +0000
+++ db/dbinc_auto/api_flags.in 2011-05-12 11:55:10.000000000 +0000
@@ -83,6 +83,7 @@
#define DB_NOORDERCHK 0x00000002
#define DB_NOPANIC 0x00000800
#define DB_NO_AUTO_COMMIT 0x00001000
+#define DB_NOFSYNC 0x00040000
#define DB_ODDFILESIZE 0x00000080
#define DB_ORDERCHKONLY 0x00000004
#define DB_OVERWRITE 0x00001000
--- db/dist/s_config.orig 2010-04-12 20:25:23.000000000 +0000
+++ db/dist/s_config 2011-05-12 12:00:34.000000000 +0000
@@ -8,7 +8,8 @@ trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3
. ./RELEASE
echo "autoconf: building aclocal.m4..."
-cat aclocal/*.m4 aclocal_java/*.m4 > aclocal.m4
+cat aclocal/*.m4 aclocal_java/*.m4 > acinclude.m4
+aclocal
echo "autoconf: running autoheader to build config.hin..."
rm -f config.hin
--- db/mp/mp_sync.c.orig 2010-04-12 20:25:34.000000000 +0000
+++ db/mp/mp_sync.c 2011-05-12 11:36:58.000000000 +0000
@@ -578,7 +578,7 @@ done: /*
if (ret == 0 && required_write) {
if (dbmfp == NULL)
ret = __memp_sync_files(env);
- else
+ else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
}
@@ -665,7 +665,7 @@ __memp_sync_file(env, mfp, argp, countp,
"%s: unable to flush", (char *)
R_ADDR(dbmp->reginfo, mfp->path_off));
}
- } else
+ } else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
/*
@@ -801,6 +801,8 @@ __memp_mf_sync(dbmp, mfp, locked)
COMPQUIET(hp, NULL);
env = dbmp->env;
+ if (F_ISSET(mfp, MP_NOFSYNC))
+ return 0;
/*
* We need to be holding the hash lock: we're using the path name
* and __memp_nameop might try and rename the file.
++++++ dbfsync.diff ++++++
Support a database-local fsync setting. Needs berkeley db patch.
--- ./lib/backend/dbconfig.c.orig 2011-01-03 13:57:41.000000000 +0000
+++ ./lib/backend/dbconfig.c 2011-05-10 17:00:29.000000000 +0000
@@ -58,8 +58,10 @@ static const struct poptOption rdbOption
{ "mp_size", 0,POPT_ARG_INT, &staticcfg.db_cachesize, 0,
NULL, NULL },
+#if 0
{ "nofsync", 0,POPT_ARG_NONE, &staticcfg.db_no_fsync, 0,
NULL, NULL },
+#endif
/* Per-dbi options */
{ "nommap", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOMMAP,
@@ -69,6 +71,8 @@ static const struct poptOption rdbOption
NULL, NULL },
{ "lockdbfd", 0,POPT_ARG_NONE, &staticdbi.dbi_lockdbfd, 0,
NULL, NULL },
+ { "nofsync", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOFSYNC,
+ NULL, NULL },
POPT_TABLEEND
};
++++++ dbprivate.diff ++++++
Always use DB_PRIVATE. Unfortunately no longer configurable
in the macros file.
--- lib/backend/db3.c.orig 2011-05-12 15:38:18.000000000 +0000
+++ lib/backend/db3.c 2011-05-12 15:38:41.000000000 +0000
@@ -119,7 +119,7 @@ static int db_init(rpmdb rdb, const char
int retry_open = 2;
struct _dbConfig * cfg = &rdb->cfg;
/* This is our setup, thou shall not have other setups before us */
- uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB);
+ uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB|DB_PRIVATE);
if (rdb->db_dbenv != NULL) {
rdb->db_opens++;
++++++ dbrointerruptable.diff ++++++
--- ./lib/rpmdb.c.orig 2011-09-19 10:02:08.000000000 +0000
+++ ./lib/rpmdb.c 2011-10-19 15:06:25.000000000 +0000
@@ -630,10 +630,12 @@ int rpmdbClose(rpmdb db)
{
rpmdb * prev, next;
int rc = 0;
+ int dbmode;
if (db == NULL)
goto exit;
+ dbmode = db->db_mode;
(void) rpmdbUnlink(db);
if (db->nrefs > 0)
@@ -661,7 +663,7 @@ int rpmdbClose(rpmdb db)
db = _free(db);
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (dbmode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(-SIGHUP, NULL);
(void) rpmsqEnable(-SIGINT, NULL);
(void) rpmsqEnable(-SIGTERM, NULL);
@@ -730,7 +732,7 @@ static int openDatabase(const char * pre
/* Try to ensure db home exists, error out if we cant even create */
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
if (rc == 0) {
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(SIGHUP, NULL);
(void) rpmsqEnable(SIGINT, NULL);
(void) rpmsqEnable(SIGTERM, NULL);
++++++ debugedit-canon-fix.diff ++++++
--- ./tools/debugedit.c.orig 2011-07-18 16:53:12.000000000 +0000
+++ ./tools/debugedit.c 2011-07-18 17:15:27.000000000 +0000
@@ -162,7 +162,7 @@ strptr (DSO *dso, int sec, off_t offset)
{
if (data->d_buf
&& offset >= data->d_off
- && offset < data->d_off + data->d_size)
+ && offset < data->d_off + (off_t)data->d_size)
return (const char *) data->d_buf + (offset - data->d_off);
}
}
@@ -503,9 +503,10 @@ static int
edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase)
{
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
- unsigned char **dirt;
+ char **dirt;
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
unsigned char *endcu, *endprol;
+ char line_base;
unsigned char opcode_base;
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
@@ -549,6 +550,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
return 1;
}
+ line_base = (char) (ptr[2 + (value >= 4)] & 0xff);
opcode_base = ptr[4 + (value >= 4)];
ptr = dir = ptr + 4 + (value >= 4) + opcode_base;
@@ -560,13 +562,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
++value;
}
- dirt = (unsigned char **) alloca (value * sizeof (unsigned char *));
+ dirt = (char **) alloca (value * sizeof (unsigned char *));
dirt[0] = (unsigned char *) ".";
dirt_cnt = 1;
ptr = dir;
while (*ptr != 0)
{
- dirt[dirt_cnt++] = ptr;
+ dirt[dirt_cnt++] = (char *)ptr;
ptr = (unsigned char *) strchr ((char *)ptr, 0) + 1;
}
ptr++;
@@ -679,7 +681,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (dest_dir)
{
- unsigned char *srcptr, *buf = NULL;
+ char *srcptr, *buf = NULL;
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
size_t shrank = 0;
@@ -693,11 +695,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off
ptr = dir;
}
else
- ptr = srcptr = dir;
+ {
+ ptr = dir;
+ srcptr = (char *)dir;
+ }
while (*srcptr != 0)
{
size_t len = strlen ((char *)srcptr) + 1;
- const unsigned char *readptr = srcptr;
+ const char *readptr = srcptr;
char *orig = strdup ((const char *) srcptr);
@@ -724,10 +729,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (shrank > 0)
{
- if (--shrank == 0)
+ --shrank;
+#if 0
+ if (shrank == 0)
error (EXIT_FAILURE, 0,
"canonicalization unexpectedly shrank by one character");
else
+#endif
{
memset (ptr, 'X', shrank);
ptr += shrank;
@@ -763,21 +771,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
dirty_section (DEBUG_STR);
}
- else if (ptr != srcptr)
+ else if ((char *)ptr != srcptr)
memmove (ptr, srcptr, len);
srcptr += len;
ptr += len;
- dir = srcptr;
+ dir = (unsigned char *)srcptr;
read_uleb128 (srcptr);
read_uleb128 (srcptr);
read_uleb128 (srcptr);
if (ptr != dir)
- memmove (ptr, dir, srcptr - dir);
- ptr += srcptr - dir;
+ memmove (ptr, dir, (unsigned char *)srcptr - dir);
+ ptr += (unsigned char *)srcptr - dir;
}
*ptr = '\0';
free (buf);
}
+
+ ptr++;
+ /* fill the rest until the line number program starts with NOP opcode */
+ memset(ptr, opcode_base - line_base, endprol - ptr);
+ /* don't touch the line number program */
return 0;
}
++++++ debugedit-comp-dir.diff ++++++
Include compilation directory in source file list if used.
--- ./tools/debugedit.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./tools/debugedit.c 2011-05-11 15:31:31.000000000 +0000
@@ -503,6 +503,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
+ int comp_dir_used = 0;
if (phase != 0)
return 0;
@@ -611,6 +612,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
memcpy (p, dirt[value], dir_len);
p[dir_len] = '/';
memcpy (p + dir_len + 1, file, file_len + 1);
+ comp_dir_used = 1;
}
canonicalize_path (s, s);
if (list_file_fd != -1)
@@ -644,6 +646,30 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
++ptr;
+ if (comp_dir_used && list_file_fd != -1
+ && (base_dir == NULL || has_prefix (comp_dir, base_dir)))
+ {
+ char *p;
+ size_t size;
+ ssize_t ret;
+
+ size = comp_dir_len + 1;
+ p = comp_dir;
+ if (base_dir)
+ {
+ p += strlen (base_dir);
+ size -= strlen (base_dir);
+ }
+ while (size > 0)
+ {
+ ret = write (list_file_fd, p, size);
+ if (ret == -1)
+ break;
+ size -= ret;
+ p += ret;
+ }
+ }
+
if (dest_dir)
{
unsigned char *srcptr, *buf = NULL;
++++++ debugedit-stabs-warning.diff ++++++
--- tools/debugedit.c.stabs 2011-07-29 14:32:45.000000000 +0200
+++ tools/debugedit.c 2011-07-29 14:32:50.000000000 +0200
@@ -1657,7 +1657,7 @@
if (strcmp (name, ".stab") == 0)
{
fprintf (stderr, "Stabs debuginfo not supported: %s\n", file);
- exit (1);
+ break;
}
if (strcmp (name, ".debug_info") == 0)
edit_dwarf2 (dso);
++++++ debugedit.diff ++++++
Make debugedit build without dwarf.h
--- ./Makefile.am.orig 2010-12-22 11:17:20.000000000 +0000
+++ ./Makefile.am 2011-05-10 16:03:49.000000000 +0000
@@ -143,7 +143,6 @@ rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_P
if LIBELF
-if LIBDWARF
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
@@ -156,7 +155,6 @@ elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
endif
-endif
rpmlibexec_PROGRAMS += javadeps
javadeps_SOURCES = tools/javadeps.c
--- ./tools/debugedit.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./tools/debugedit.c 2011-05-10 16:03:49.000000000 +0000
@@ -37,7 +37,37 @@
#include
#include
-#include
+
+
+/* some defines taken from the dwarf standard */
+
+#define DW_TAG_compile_unit 0x11
+
+#define DW_AT_name 0x03
+#define DW_AT_stmt_list 0x10
+#define DW_AT_comp_dir 0x1b
+
+#define DW_FORM_addr 0x01
+#define DW_FORM_block2 0x03
+#define DW_FORM_block4 0x04
+#define DW_FORM_data2 0x05
+#define DW_FORM_data4 0x06
+#define DW_FORM_data8 0x07
+#define DW_FORM_string 0x08
+#define DW_FORM_block 0x09
+#define DW_FORM_block1 0x0a
+#define DW_FORM_data1 0x0b
+#define DW_FORM_flag 0x0c
+#define DW_FORM_sdata 0x0d
+#define DW_FORM_strp 0x0e
+#define DW_FORM_udata 0x0f
+#define DW_FORM_ref_addr 0x10
+#define DW_FORM_ref1 0x11
+#define DW_FORM_ref2 0x12
+#define DW_FORM_ref4 0x13
+#define DW_FORM_ref8 0x14
+#define DW_FORM_ref_udata 0x15
+#define DW_FORM_indirect 0x16
#include
#include
++++++ debuginfo-mono.patch ++++++
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 16:10:22.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:48.000000000 +0000
@@ -211,6 +211,17 @@ while read nlinks inum f; do
;;
*) continue ;;
esac
+ # double check that we really have an ELF file,
+ # to handle monodevelop-debugger-gdb and monodevelop-debugger-mdb
+ ftype=`/usr/bin/file $f | cut -d: -f2-`
+ case $ftype in
+ *ELF*) ;;
+ *)
+ echo "$f is not an ELF file, skipping"
+ continue
+ ;;
+ esac
+
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
++++++ debuglink.diff ++++++
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:59:44.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:22.000000000 +0000
@@ -186,7 +186,8 @@ make_id_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
- bn=$(basename "$1" .debug).debug
+# Do not strip existing .debug suffixes
+ bn=$(basename "$1").debug
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
++++++ debugsource-package.diff ++++++
Subject: Split sources for debugging into separate -debugsource package
At the moment the -debuginfo package also include the sources where used to
build the binary. The patches moves them into a separate package -debugsource.
--- ./macros.in.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./macros.in 2011-05-11 15:36:05.000000000 +0000
@@ -190,6 +190,18 @@ Debug information is useful when develop
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
+\
+%package debugsource\
+Summary: Debug sources for package %{name}\
+Group: Development/Debug\
+AutoReqProv: 0\
+Requires: %{name}-debuginfo = %{version}-%{release}\
+%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 debugsource -f debugsources.list\
+%defattr(-,root,root)\
%{nil}
%_defaultdocdir %{_datadir}/doc/packages
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 14:46:18.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:36:05.000000000 +0000
@@ -187,8 +187,8 @@ set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
-# Strip ELF binaries
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+# Strip ELF binaries (and no static libraries)
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z |
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@@ -300,10 +300,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
(cd "${RPM_BUILD_ROOT}/usr"
test ! -d lib/debug || find lib/debug ! -type d
- test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
) | sed 's,^,/usr/,' >> "$LISTFILE"
fi
+: > "$SOURCEFILE"
+if [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
+ (cd "${RPM_BUILD_ROOT}/usr"
+ test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
+ ) | sed 's,^,/usr/,' >> "$SOURCEFILE"
+fi
+
# Append to $1 only the lines from stdin not already in the file.
append_uniq()
{
++++++ debugsubpkg.diff ++++++
Create a debuginfo package for each subpackage.
--- ./build/files.c.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./build/files.c 2011-05-13 15:35:42.000000000 +0000
@@ -20,6 +20,10 @@
#include /* rpmDoDigest() */
#include
+#if HAVE_GELF_H
+#include
+#endif
+
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include "rpmio/base64.h"
#include "misc/fts.h"
@@ -2105,13 +2109,237 @@ exit:
return rc;
}
+#if HAVE_GELF_H && HAVE_LIBELF
+/* Query the build-id from the ELF file NAME and store it in the newly
+ allocated *build_id array of size *build_id_size. Returns -1 on
+ error. */
+
+int
+getELFBuildId (const char *name,
+ unsigned char **id, size_t *id_size)
+{
+ int fd, i;
+ Elf *elf;
+ GElf_Ehdr ehdr;
+ Elf_Data *build_id = NULL;
+ size_t build_id_offset = 0, build_id_size = 0;
+
+ /* Now query the build-id of the file and add the
+ corresponding links in the .build-id tree.
+ The following code is based on tools/debugedit.c. */
+ fd = open (name, O_RDONLY);
+ if (fd < 0)
+ return -1;
+ elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ {
+ fprintf (stderr, "cannot open ELF file: %s",
+ elf_errmsg (-1));
+ close (fd);
+ return -1;
+ }
+ if (elf_kind (elf) != ELF_K_ELF
+ || gelf_getehdr (elf, &ehdr) == NULL
+ || (ehdr.e_type != ET_DYN
+ && ehdr.e_type != ET_EXEC
+ && ehdr.e_type != ET_REL))
+ {
+ elf_end (elf);
+ close (fd);
+ return -1;
+ }
+ for (i = 0; i < ehdr.e_shnum; ++i)
+ {
+ Elf_Scn *s = elf_getscn (elf, i);
+ GElf_Shdr shdr;
+ Elf_Data *data;
+ Elf32_Nhdr nh;
+ Elf_Data dst =
+ {
+ .d_version = EV_CURRENT, .d_type = ELF_T_NHDR,
+ .d_buf = &nh, .d_size = sizeof nh
+ };
+ Elf_Data src = dst;
+
+ gelf_getshdr (s, &shdr);
+ if (shdr.sh_type != SHT_NOTE
+ || !(shdr.sh_flags & SHF_ALLOC))
+ continue;
+
+ /* Look for a build-ID note here. */
+ data = elf_rawdata (s, NULL);
+ src.d_buf = data->d_buf;
+ assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
+ while (data->d_buf + data->d_size - src.d_buf > (int) sizeof nh
+ && elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA]))
+ {
+ Elf32_Word len = sizeof nh + nh.n_namesz;
+ len = (len + 3) & ~3;
+
+ if (nh.n_namesz == sizeof "GNU" && nh.n_type == 3
+ && !memcmp (src.d_buf + sizeof nh, "GNU", sizeof "GNU"))
+ {
+ build_id = data;
+ build_id_offset = src.d_buf + len - data->d_buf;
+ build_id_size = nh.n_descsz;
+ break;
+ }
+
+ len += nh.n_descsz;
+ len = (len + 3) & ~3;
+ src.d_buf += len;
+ }
+
+ if (build_id != NULL)
+ break;
+ }
+
+ if (build_id == NULL)
+ return -1;
+
+ *id = malloc (build_id_size);
+ *id_size = build_id_size;
+ memcpy (*id, build_id->d_buf + build_id_offset, build_id_size);
+
+ elf_end (elf);
+ close (fd);
+
+ return 0;
+}
+
+
+static rpmTag copyTagsForDebug[] = {
+ RPMTAG_EPOCH,
+ RPMTAG_VERSION,
+ RPMTAG_RELEASE,
+ RPMTAG_LICENSE,
+ RPMTAG_PACKAGER,
+ RPMTAG_DISTRIBUTION,
+ RPMTAG_DISTURL,
+ RPMTAG_VENDOR,
+ RPMTAG_ICON,
+ RPMTAG_URL,
+ RPMTAG_CHANGELOGTIME,
+ RPMTAG_CHANGELOGNAME,
+ RPMTAG_CHANGELOGTEXT,
+ RPMTAG_PREFIXES,
+ RPMTAG_RHNPLATFORM,
+ RPMTAG_OS,
+ RPMTAG_DISTTAG,
+ RPMTAG_CVSID,
+ RPMTAG_ARCH,
+ 0
+};
+
+static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot)
+{
+ const char *a;
+
+ elf_version(EV_CURRENT);
+ a = headerGetString(pkg->header, RPMTAG_ARCH);
+ if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0)
+ {
+ Package dbg;
+ rpmfi fi = pkg->cpioList;
+ char tmp[1024];
+ const char *name;
+ ARGV_t files = NULL;
+ int seen_build_id = 0;
+
+ /* Check if the current package has files with debug info
+ and record them. */
+ fi = rpmfiInit (fi, 0);
+ while (rpmfiNext (fi) >= 0)
+ {
+ const char *base;
+ int i;
+ unsigned char *build_id;
+ size_t build_id_size = 0;
+ struct stat sbuf;
+
+ name = rpmfiFN (fi);
+ /* Skip leading buildroot. */
+ base = name + strlen (buildroot);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildroot, base);
+ /* If that file exists we have debug information for it. */
+ if (access (tmp, F_OK) != 0)
+ continue;
+
+ /* Append the file list preamble. */
+ if (!files)
+ {
+ argvAdd(&files, "%defattr(-,root,root)");
+ argvAdd(&files, "%dir /usr/lib/debug");
+ }
+ /* Add the files main debug-info file. */
+ snprintf (tmp, 1024, "/usr/lib/debug/%s.debug", base);
+ argvAdd(&files, tmp);
+
+ /* Do not bother to check build-ids for symbolic links.
+ We'll handle them for the link target. */
+ if (lstat (name, &sbuf) == -1
+ || S_ISLNK (sbuf.st_mode))
+ continue;
+
+ /* Try to gather the build-id from the binary. */
+ if (getELFBuildId (name, &build_id, &build_id_size) == -1)
+ continue;
+
+ /* If we see build-id links for the first time add the
+ directory. */
+ if (!seen_build_id)
+ argvAdd(&files, "%dir /usr/lib/debug/.build-id");
+
+ /* From the build-id construct the two links pointing back
+ to the debug information file and the binary. */
+ snprintf (tmp, 1024, "/usr/lib/debug/.build-id/%02x/",
+ build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf (tmp + strlen (tmp), "%02x", build_id[i]);
+ argvAdd(&files, tmp);
+ sprintf (tmp + strlen (tmp), ".debug");
+ argvAdd(&files, tmp);
+
+ free (build_id);
+ }
+
+ /* If there are debuginfo files for this package add a
+ new debuginfo package. */
+ if (files)
+ {
+ dbg = newPackage (spec);
+ headerNVR (pkg->header, &name, NULL, NULL);
+ /* Set name, summary and group. */
+ snprintf (tmp, 1024, "%s-debuginfo", name);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ snprintf (tmp, 1024, "Debug information for package %s", name);
+ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp);
+ snprintf (tmp, 1024, "This package provides debug information for package %s.\n"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ }
+ }
+}
+#endif
+
rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test)
{
Package pkg;
rpmRC rc = RPMRC_OK;
+ char *buildroot;
check_fileList = newStringBuf();
+ buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
@@ -2127,8 +2355,12 @@ rpmRC processBinaryFiles(rpmSpec spec, r
rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr);
free(nvr);
- if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
+ if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ goto exit;
+#if HAVE_GELF_H && HAVE_LIBELF
+ addDebuginfoPackage(spec, pkg, buildroot);
+#endif
+ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
a = headerGetString(pkg->header, RPMTAG_ARCH);
--- ./macros.in.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./macros.in 2011-05-13 15:34:10.000000000 +0000
@@ -179,24 +179,10 @@
# Template for debug information sub-package.
%debug_package \
%global __debug_package 1\
-%package debuginfo\
-Summary: Debug information for package %{name}\
-Group: Development/Debug\
-AutoReq: 0\
-AutoProv: 1\
-#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
-%description debuginfo\
-This package provides debug information for package %{name}.\
-Debug information is useful when developing applications that use this\
-package or when debugging this package.\
-%files debuginfo -f debugfiles.list\
-%defattr(-,root,root)\
-\
%package debugsource\
Summary: Debug sources for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
-Requires: %{name}-debuginfo = %{version}-%{release}\
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
--- ./scripts/find-debuginfo.sh.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-13 15:34:10.000000000 +0000
@@ -277,19 +277,11 @@ while read nlinks inum f; do
fi
done || exit
-# For each symlink whose target has a .debug file,
-# make a .debug symlink to that file.
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*" -type l -print |
-while read f
-do
- t=$(readlink -m "$f").debug
- f=${f#$RPM_BUILD_ROOT}
- t=${t#$RPM_BUILD_ROOT}
- if [ -f "$debugdir$t" ]; then
- echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
- debug_link "/usr/lib/debug$t" "${f}.debug"
- fi
-done
+# We used to make a .debug symlink for each symlink whose target
+# has a .debug file to that file. This is not necessary because
+# the debuglink section contains only the destination of those links.
+# Creating those links anyway results in debuginfo packages for
+# devel packages just because of the .so symlinks in them.
if [ -s "$SOURCEFILE" ]; then
mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug"
++++++ disttag-macro.diff ++++++
Hmm, SUSE doesn't use it, so what's the purpose of this patch?
--- ./build/parsePreamble.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 15:59:08.000000000 +0000
@@ -485,6 +485,7 @@ static struct optionalTag {
{ RPMTAG_PACKAGER, "%{packager}" },
{ RPMTAG_DISTRIBUTION, "%{distribution}" },
{ RPMTAG_DISTURL, "%{disturl}" },
+ { RPMTAG_DISTTAG, "%{disttag}" },
{ RPMTAG_BUGURL, "%{bugurl}" },
{ -1, NULL }
};
--- ./macros.in.orig 2011-05-11 15:38:44.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:08.000000000 +0000
@@ -279,6 +279,16 @@ package or when debugging this package.\
#
#%bugurl
+# Configurable distribution tag, same as Disttag: tag in a specfile.
+# The tag will be used to supply reliable information to tools like
+# rpmfind.
+#
+# Note: You should not configure with disturl (or build packages with
+# the Disttag: tag) unless you are willing to supply content in a
+# yet-to-be-determined format at the tag specified.
+#
+#%disttag
+
# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
# marked as %doc should be installed.
#%_excludedocs
++++++ extcond.diff ++++++
This patch supports an extension in the condition evaluation.
If the condition is a format and returns an nonempty string, it is
assumed to be true.
This mechanism is used by the weakdeps patch to filter the
"RPMSENSE_STRONG" flag.
--- ./lib/headerfmt.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/headerfmt.c 2011-05-10 17:06:49.000000000 +0000
@@ -568,8 +568,12 @@ static int parseExpression(headerSprintf
*endPtr = chptr;
+ token->u.cond.tag.type = NULL;
+ token->u.cond.tag.format = "";
token->type = PTOK_COND;
+ if ((token->u.cond.tag.type = strchr(str, ':')) != 0)
+ *token->u.cond.tag.type++ = 0;
(void) findTag(hsa, token, str);
return 0;
@@ -657,6 +661,7 @@ static char * singleSprintf(headerSprint
int i, j, found;
rpm_count_t count, numElements;
sprintfToken spft;
+ sprintfTag stag;
int condNumFormats;
size_t need;
@@ -687,6 +692,18 @@ static char * singleSprintf(headerSprint
headerIsEntry(hsa->h, token->u.cond.tag.tag)) {
spft = token->u.cond.ifFormat;
condNumFormats = token->u.cond.numIfTokens;
+ if (token->u.cond.tag.fmt) {
+ /* check if format creates output */
+ size_t vallen = hsa->vallen;
+ formatValue(hsa, &token->u.cond.tag, element);
+ if (hsa->vallen == vallen) {
+ spft = token->u.cond.elseFormat;
+ condNumFormats = token->u.cond.numElseTokens;
+ } else {
+ hsa->vallen = vallen;
+ hsa->val[hsa->vallen] = 0;
+ }
+ }
} else {
spft = token->u.cond.elseFormat;
condNumFormats = token->u.cond.numElseTokens;
@@ -710,10 +727,13 @@ static char * singleSprintf(headerSprint
for (i = 0; i < token->u.array.numTokens; i++, spft++)
{
rpmtd td = NULL;
- if (spft->type != PTOK_TAG ||
- spft->u.tag.justOne) continue;
+ if (spft->type != PTOK_TAG && spft->type != PTOK_COND)
+ continue;
+ stag = (spft->type == PTOK_COND ? &spft->u.cond.tag : &spft->u.tag);
+ if (stag->justOne)
+ continue;
- if (!(td = getData(hsa, spft->u.tag.tag))) {
+ if (!(td = getData(hsa, stag->tag))) {
continue;
}
++++++ fileattrs.diff ++++++
--- ./fileattrs/Makefile.am.orig 2011-07-12 11:28:13.000000000 +0000
+++ ./fileattrs/Makefile.am 2011-07-18 17:29:11.000000000 +0000
@@ -5,7 +5,8 @@ include $(top_srcdir)/rpm.am
fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
- desktop.attr elf.attr font.attr libtool.attr perl.attr perllib.attr \
- pkgconfig.attr python.attr ocaml.attr script.attr mono.attr
+ elf.attr font.attr libtool.attr perl.attr perllib.attr \
+ pkgconfig.attr python.attr ocaml.attr script.attr mono.attr \
+ debuginfo.attr elflib.attr firmware.attr ksyms.attr sysvinit.attr
EXTRA_DIST = $(fattrs_DATA)
--- ./fileattrs/debuginfo.attr.orig 2011-07-18 17:29:11.000000000 +0000
+++ ./fileattrs/debuginfo.attr 2011-07-18 17:29:11.000000000 +0000
@@ -0,0 +1,2 @@
+%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov
+%__debuginfo_path ^/usr/lib/debug/
--- ./fileattrs/elf.attr.orig 2011-07-15 09:32:41.000000000 +0000
+++ ./fileattrs/elf.attr 2011-07-18 17:31:52.000000000 +0000
@@ -1,4 +1,5 @@
%__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
%__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
-%__elf_magic ^(sticky )?ELF (32|64)-bit.*$
+%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*executable
%__elf_flags exeonly
+%__elf_exclude_path ^/usr/lib/debug/
--- ./fileattrs/elflib.attr.orig 2011-07-18 17:29:11.000000000 +0000
+++ ./fileattrs/elflib.attr 2011-07-18 17:32:28.000000000 +0000
@@ -0,0 +1,4 @@
+%__elflib_provides %{_rpmconfigdir}/elfdeps --assume-exec --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_requires %{_rpmconfigdir}/elfdeps --assume-exec --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*shared object
+%__elflib_exclude_path ^/usr/lib/debug/
--- ./fileattrs/firmware.attr.orig 2011-07-18 17:29:11.000000000 +0000
+++ ./fileattrs/firmware.attr 2011-07-18 17:29:11.000000000 +0000
@@ -0,0 +1,2 @@
+%__firmware_provides %{_rpmconfigdir}/firmware.prov
+%__firmware_path /lib/firmware/
--- ./fileattrs/ksyms.attr.orig 2011-07-18 17:29:11.000000000 +0000
+++ ./fileattrs/ksyms.attr 2011-07-18 17:29:11.000000000 +0000
@@ -0,0 +1,4 @@
+%__ksyms_provides %{_rpmconfigdir}/find-provides.ksyms %name
+%__ksyms_requires %{_rpmconfigdir}/find-requires.ksyms %name
+%__ksyms_supplements %{_rpmconfigdir}/find-supplements.ksyms %name
+%__ksyms_path (/lib/modules/.*\.ko(\.gz)?)|(/boot/vmlinu[xz].*)$
--- ./fileattrs/perl.attr.orig 2011-07-12 11:28:13.000000000 +0000
+++ ./fileattrs/perl.attr 2011-07-18 17:29:11.000000000 +0000
@@ -1,3 +1,4 @@
-%__perl_requires %{_rpmconfigdir}/perl.req
+# disabled for now
+#%__perl_requires %{_rpmconfigdir}/perl.req
%__perl_magic ^.*perl .*$
%__perl_flags exeonly
--- ./fileattrs/perllib.attr.orig 2011-07-12 11:28:13.000000000 +0000
+++ ./fileattrs/perllib.attr 2011-07-18 17:29:11.000000000 +0000
@@ -1,3 +1,4 @@
%__perllib_provides %{_rpmconfigdir}/perl.prov
-%__perllib_requires %{_rpmconfigdir}/perl.req
+#disabled for now
+#%__perllib_requires %{_rpmconfigdir}/perl.req
%__perllib_magic ^Perl[[:digit:]] module source.*
--- ./fileattrs/sysvinit.attr.orig 2011-07-18 17:29:11.000000000 +0000
+++ ./fileattrs/sysvinit.attr 2011-07-18 17:29:11.000000000 +0000
@@ -0,0 +1,2 @@
+%__sysvinit_provides %{_rpmconfigdir}/sysvinitdeps.sh --provides
+%__sysvinit_path ^/etc/init\.d/
++++++ files.diff ++++++
Print "unpackaged files" section even if there was an error
in the filelist.
--- ./build/files.c.orig 2011-05-11 15:27:11.000000000 +0000
+++ ./build/files.c 2011-05-11 15:29:12.000000000 +0000
@@ -2149,10 +2149,10 @@ rpmRC processBinaryFiles(rpmSpec spec, r
*/
+exit:
if (checkFiles(spec->buildRoot, check_fileList) > 0) {
rc = RPMRC_FAIL;
}
-exit:
check_fileList = freeStringBuf(check_fileList);
return rc;
++++++ finddebuginfo-absolute-links.diff ++++++
From: Jan Blunck
Subject: Do the symbolic links right in the first place
Since brp-symlink relinks symbolic links to enforce a certain policy we should
do it right in the first place. So this patch changes find-debuginfo.sh scripts
behavior to reflect that policy.
Signed-off-by: Jan Blunck
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:36:05.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:58:17.000000000 +0000
@@ -124,7 +124,17 @@ debug_link()
local l="/usr/lib/debug$2"
local t="$1"
echo >> "$LINKSFILE" "$l $t"
- link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+
+ # this should correspond to what brp-symlink is doing
+ case $t in
+ /usr*)
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ ;;
+ *)
+ mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
+ ln -snf "$t" "$RPM_BUILD_ROOT$l"
+ ;;
+ esac
}
# Compare two binaries but ignore the .note.gnu.build-id section
@@ -158,8 +168,8 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
- if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
+ if cmp -s "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ||
+ elfcmp "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
++++++ finddebuginfo.diff ++++++
--- ./scripts/find-debuginfo.sh.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 14:46:18.000000000 +0000
@@ -127,6 +127,20 @@ debug_link()
link_relative "$t" "$l" "$RPM_BUILD_ROOT"
}
+# Compare two binaries but ignore the .note.gnu.build-id section
+elfcmp()
+{
+ local tmp1=$(mktemp -t ${1##*/}.XXXXXX)
+ local tmp2=$(mktemp -t ${2##*/}.XXXXXX)
+
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $1 $tmp1
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $2 $tmp2
+ cmp -s $tmp1 $tmp2
+ local res=$?
+ rm -f $tmp1 $tmp2
+ return $res
+}
+
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
@@ -145,7 +159,7 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- eu-elfcmp -q "$root_idfile" "$RPM_BUILD_ROOT$file" 2> /dev/null; then
+ elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
@@ -174,12 +188,18 @@ strict_error=ERROR
$strict || strict_error=WARNING
# Strip ELF binaries
-find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
- \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
- -print |
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
-xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
+ case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
+ *debuglink*) continue ;;
+ *debug*) ;;
+ *gnu.version*)
+ echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!"
+ continue
+ ;;
+ *) continue ;;
+ esac
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
@@ -200,8 +220,11 @@ while read nlinks inum f; do
fi
echo "extracting debug info from $f"
- id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
- -i -l "$SOURCEFILE" "$f") || exit
+ mode=$(stat -c %a "$f")
+ chmod +w "$f"
+ id=$($(DEBUGEDIT=$(which debugedit 2>/dev/null); \
+ echo ${DEBUGEDIT:-/usr/lib/rpm/debugedit}) -b "$RPM_BUILD_DIR" \
+ -d /usr/src/debug -i -l "$SOURCEFILE" "$f") || exit
if [ -z "$id" ]; then
echo >&2 "*** ${strict_error}: No build ID note found in $f"
$strict && exit 2
@@ -218,13 +241,25 @@ while read nlinks inum f; do
esac
mkdir -p "${debugdn}"
- if test -w "$f"; then
- strip_to_debug "${debugfn}" "$f"
- else
- chmod u+w "$f"
- strip_to_debug "${debugfn}" "$f"
- chmod u-w "$f"
- fi
+ objcopy --only-keep-debug $f $debugfn || :
+ (
+ shopt -s extglob
+ strip_option="--strip-all"
+ case "$f" in
+ *.ko)
+ strip_option="--strip-debug" ;;
+ *$STRIP_KEEP_SYMTAB*)
+ if test -n "$STRIP_KEEP_SYMTAB"; then
+ strip_option="--strip-debug"
+ fi
+ ;;
+ esac
+ if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
+ strip_option=
+ fi
+ objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
+ chmod $mode $f
+ ) || :
if [ -n "$id" ]; then
make_id_link "$id" "$dn/$(basename $f)"
@@ -253,12 +288,14 @@ if [ -s "$SOURCEFILE" ]; then
# stupid cpio creates new directories in mode 0700, fixup
find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx
+ find "${RPM_BUILD_ROOT}/usr/src/debug" -type f -print0 |
+ xargs --no-run-if-empty -0 chmod a+r
fi
if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then
((nout > 0)) ||
test ! -d "${RPM_BUILD_ROOT}/usr/lib" ||
- (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) |
+ (cd "${RPM_BUILD_ROOT}/usr/lib"; test ! -d debug || find debug -type d) |
sed 's,^,%dir /usr/lib/,' >> "$LISTFILE"
(cd "${RPM_BUILD_ROOT}/usr"
++++++ findksyms.diff ++++++
SUSE specific kernel provides/requires scripts
--- ./scripts/Makefile.am.orig 2011-05-11 14:31:45.000000000 +0000
+++ ./scripts/Makefile.am 2011-05-11 14:46:38.000000000 +0000
@@ -16,6 +16,7 @@ EXTRA_DIST = \
rpmdb_loadcvt rpm.daily rpm.log rpm2cpio.sh \
tcl.req tgpg vpkg-provides.sh \
find-requires.php find-provides.php \
+ find-requires.ksyms find-provides.ksyms \
find-php-provides find-php-requires \
mono-find-requires mono-find-provides \
ocaml-find-requires.sh ocaml-find-provides.sh \
@@ -32,6 +33,7 @@ rpmconfig_SCRIPTS = \
check-buildroot check-rpaths check-rpaths-worker \
find-lang.sh \
perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \
+ find-requires.ksyms find-provides.ksyms \
mono-find-requires mono-find-provides \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
--- ./scripts/find-provides.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/find-provides.ksyms 2011-05-11 14:46:38.000000000 +0000
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*) ;; # Fedora kernel module package names start with
+ # kernel-module.
+kernel*) kernel_flavor=${1#kernel-} ;;
+esac
+
+trap 'rm -f "$tmp"' EXIT
+tmp=$(mktemp)
+while read f; do
+ test -e "$f" || continue
+ case "$f" in
+ *.debug)
+ continue
+ ;;
+ */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz | */boot/vmlinu[xz]*)
+ ;;
+ *)
+ continue
+ esac
+ unzip=false
+ case "$f" in
+ *.gz | */boot/vmlinuz*)
+ unzip=true
+ esac
+ if $unzip && gzip -cd "$f" >"$tmp"; then
+ f=$tmp
+ fi
+ flavor=$(/sbin/modinfo -F vermagic "$f")
+ flavor=${flavor%% *}
+ flavor=${flavor##*-}
+ if test -z "$flavor"; then
+ flavor=$kernel_flavor
+ fi
+ nm "$f" \
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
+done \
+| sort -u
--- ./scripts/find-requires.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/find-requires.ksyms 2011-05-11 14:46:38.000000000 +0000
@@ -0,0 +1,57 @@
+#! /bin/bash
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*) ;; # Fedora kernel module package names start with
+ # kernel-module.
+kernel*) is_kernel_package=1 ;;
+esac
+
+all_provides() {
+ for module in "$@"; do
+ nm "$module"
+ done \
+ | sed -r -ne 's:^0*([0-9a-f]+) A __crc_(.+):\1\t\2:p' \
+ | sort -t $'\t' -k2 -u
+}
+
+all_requires() {
+ for module in "$@"; do
+ set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q)
+ /sbin/modprobe --dump-modversions "$module" \
+ | sed -r -e 's:^0x0*::' -e 's:$:\t'"$1"':'
+ done \
+ | sort -t $'\t' -k2 -u
+}
+
+if ! [ -z "$is_kernel_package" -a -e /sbin/modinfo -a -e /sbin/modprobe ]; then
+ cat > /dev/null
+ exit 0
+fi
+
+modules=($(grep -E '/lib/modules/.+\.ko$'))
+if [ ${#modules[@]} -gt 0 ]; then
+ symset_table=$(mktemp -t ${0##*/}.XXXXX)
+ /usr/lib/rpm/symset-table | sort -t $'\t' -k 1,1 > $symset_table
+
+ join -t $'\t' -j 1 -a 2 $symset_table <(
+ # Filter out requirements that we fulfill ourself.
+ join -t $'\t' -j 2 -v 1 \
+ <(all_requires "${modules[@]}") \
+ <(all_provides "${modules[@]}") \
+ | awk '
+ BEGIN { FS = "\t" ; OFS = "\t" }
+ { print $3 "/" $2 "/" $1 }
+ ' \
+ | sort -t $'\t' -k 1,1 -u) \
+ | sort -u \
+ | awk '
+ { FS = "\t" ; OFS = "\t" }
+ { split($1, arr, "/")
+ flavor = gensub(/.*-/, "", "", arr[1]) }
+ NF == 3 { print "kernel(" flavor ":" $2 ") = " $3
+ next }
+ { print "ksym(" flavor ":" arr[3] ") = " arr[2] }
+ '
+fi
++++++ findlang.diff ++++++
Index: scripts/find-lang.sh
===================================================================
--- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh
@@ -28,10 +28,10 @@ the top of the tree containing the files
PACKAGE_NAME is the %{name} of the package. This should also be
the basename of the .mo files. the output is written to
PACKAGE_NAME.lang unless \$3 is given in which case output is written
-to \$3.
+to \$3 (note that \$3 is appended to if given).
Additional options:
- --with-gnome find GNOME help files
- --with-kde find KDE help files
+ --without-gnome do not find GNOME help files
+ --without-kde do not find KDE help files
--with-qt find Qt translation files
--with-man find localized man pages
--all-name match all package/domain names
@@ -54,8 +54,8 @@ else NAME=$1
fi
shift
-GNOME=#
-KDE=#
+GNOME=
+KDE=
QT=#
MAN=#
MO=
@@ -73,6 +73,14 @@ while test $# -gt 0 ; do
KDE=
shift
;;
+ --without-gnome )
+ GNOME=#
+ shift
+ ;;
+ --without-kde )
+ KDE=#
+ shift
+ ;;
--with-qt )
QT=
shift
@@ -97,33 +105,40 @@ while test $# -gt 0 ; do
esac
done
+if ! test -s $MO_NAME ; then
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
+fi
+
+MO_NAME_NEW=$MO_NAME.tmp.$$
+rm -f $MO_NAME_NEW
+
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' > $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type f|sed '
s:'"$TOP_DIR"'::
@@ -131,7 +146,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
@@ -143,7 +158,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
@@ -156,7 +171,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
find $TOP_DIR -type f -o -type l|sed '
@@ -168,7 +183,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
@@ -176,17 +191,22 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
-if ! grep -q / $MO_NAME; then
+if ! grep -q / $MO_NAME_NEW; then
echo "No translations found for ${NAME} in ${TOP_DIR}"
+ rm -f $MO_NAME_NEW
exit 1
fi
+
+sort -u $MO_NAME_NEW >> $MO_NAME
+rm -f $MO_NAME_NEW
+
exit 0
++++++ findsupplements.diff ++++++
Add support for supplements to the internal dependency
generator.
--- build/rpmfc.c.orig 2011-05-13 16:54:26.000000000 +0000
+++ build/rpmfc.c 2011-05-13 17:11:20.000000000 +0000
@@ -54,6 +54,7 @@ struct rpmfc_s {
rpmds provides; /*!< (no. provides) package provides */
rpmds requires; /*!< (no. requires) package requires */
+ rpmds supplements; /*!< (no. supplements) package supplements */
};
struct rpmfcTokens_s {
@@ -481,6 +482,14 @@ static int rpmfcHelper(rpmfc fc, unsigne
dsContext = RPMSENSE_FIND_REQUIRES;
tagN = RPMTAG_REQUIRENAME;
break;
+ case 'S':
+ if (fc->skipProv)
+ return 0;
+ depname = "supplements";
+ depsp = &fc->supplements;
+ dsContext = RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK;
+ tagN = RPMTAG_ENHANCESNAME;
+ break;
}
/* If the entire path is filtered out, there's nothing more to do */
@@ -752,6 +761,7 @@ rpmfc rpmfcFree(rpmfc fc)
fc->provides = rpmdsFree(fc->provides);
fc->requires = rpmdsFree(fc->requires);
+ fc->supplements = rpmdsFree(fc->supplements);
}
fc = _free(fc);
return NULL;
@@ -804,6 +814,7 @@ rpmRC rpmfcApply(rpmfc fc)
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
xx += rpmfcHelper(fc, 'P', *fattr);
xx += rpmfcHelper(fc, 'R', *fattr);
+ xx += rpmfcHelper(fc, 'S', *fattr);
}
}
@@ -846,6 +857,11 @@ rpmRC rpmfcApply(rpmfc fc)
dix = rpmdsFind(fc->requires, ds);
ds = rpmdsFree(ds);
break;
+ case 'S':
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
+ dix = rpmdsFind(fc->supplements, ds);
+ ds = rpmdsFree(ds);
+ break;
}
/* XXX assertion incorrect while generating -debuginfo deps. */
@@ -1357,6 +1373,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
}
}
+ /* Add Supplements: */
+ if (fc->supplements != NULL && rpmdsCount(fc->supplements) > 0 && !fc->skipReq) {
+ rpmds pi = rpmdsInit(fc->supplements);
+ while (rpmdsNext(pi) >= 0) {
+ rpmsenseFlags flags = rpmdsFlags(pi);
+
+ headerPutString(pkg->header, RPMTAG_ENHANCESNAME, rpmdsN(pi));
+ headerPutString(pkg->header, RPMTAG_ENHANCESVERSION, rpmdsEVR(pi));
+ headerPutUint32(pkg->header, RPMTAG_ENHANCESFLAGS, &flags, 1);
+ }
+ }
+
/* Add dependency dictionary(#dependencies) */
if (rpmtdFromArgi(&td, RPMTAG_DEPENDSDICT, fc->ddictx)) {
assert(rpmtdType(&td) == RPM_INT32_TYPE);
++++++ firmware.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:28:10.000000000 +0200
+++ autodeps/linux.prov 2011-06-08 13:28:51.755445342 +0200
@@ -11,6 +11,7 @@ solist=($(printf "%s\n" "${filelist[@]}"
pythonlist=
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
#
# --- Alpha does not mark 64bit dependencies
@@ -59,6 +60,11 @@ done | sort -u
printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u
#
+# --- firmware files
+[ -x /usr/lib/rpm/firmware.prov -a -n "$firmwarelist" ] &&
+ printf "%s\n" "${firmwarelist[@]}" | /usr/lib/rpm/firmware.prov | sort -u
+
+#
# --- Mono exes/dlls
: ${MONO_PREFIX=/usr}
if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
Index: scripts/firmware.prov
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ scripts/firmware.prov 2011-06-08 13:28:33.117204009 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Add firmware files in /lib/firmware into RPM provides
+
+while read instfile ; do
+ case $instfile in
+ */lib/firmware/*) test -f "$instfile" && echo "firmware(${instfile##*/lib/firmware/})" ;;
+ esac
+done
++++++ fontprovides.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:37:46.951974468 +0200
+++ autodeps/linux.prov 2011-06-08 13:37:46.967972960 +0200
@@ -15,6 +15,8 @@ pythonlist=($(printf "%s\n" "${filelist[
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
+pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$'))
+fontlist=($(printf "%s\n" "${filelist[@]}" | egrep -i "/usr/share/fonts/.*\.(ttf|otf|pfa)$"))
#
# --- Alpha does not mark 64bit dependencies
@@ -80,6 +82,16 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
fi
#
+# --- pkgconfig provides
+[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] &&
+ printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -P | sort -u
+
+#
+# --- font provides
+[ -x /usr/lib/rpm/fontconfig.prov -a -n "$fontlist" ] &&
+ printf "%s\n" "${fontlist[@]}" | /usr/lib/rpm/fontconfig.prov | sort -u
+
+#
# --- Kernel module exported symbols
[ -x /usr/lib/rpm/find-provides.ksyms ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
Index: autodeps/linux.req
===================================================================
--- autodeps/linux.req.orig 2011-06-08 13:37:46.951974468 +0200
+++ autodeps/linux.req 2011-06-08 13:37:46.968972865 +0200
@@ -34,6 +34,7 @@ perllist=()
pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..'))
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
+pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$'))
#
# --- Alpha does not mark 64bit dependencies
@@ -143,6 +144,11 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
fi
#
+# --- pkgconfig requires
+[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] &&
+ printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -R | sort -u
+
+#
# --- Kernel module imported symbols
[ -x ${0%/*}/find-requires.ksyms ] &&
printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
++++++ headeradddb.diff ++++++
Add rpmtsHeaderAddDB and rpmtsHeaderRemoveDB so that
convertdb1 will build again.
--- lib/rpmts.c.orig 2011-05-12 13:21:03.000000000 +0000
+++ lib/rpmts.c 2011-05-12 13:26:25.000000000 +0000
@@ -159,6 +159,24 @@ int rpmtsVerifyDB(rpmts ts)
return rc;
}
+int rpmtsHeaderAddDB(rpmts ts, Header h)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbRemove(rpmtsGetRdb(ts), hdrNum) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
/* keyp might no be defined. */
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen)
--- lib/rpmts.h.orig 2011-05-12 13:21:11.000000000 +0000
+++ lib/rpmts.h 2011-05-12 13:28:32.000000000 +0000
@@ -264,6 +264,22 @@ int rpmtsRebuildDB(rpmts ts);
int rpmtsVerifyDB(rpmts ts);
/** \ingroup rpmts
+ * Add a header to the database used by the transaction.
+ * @param ts transaction set
+ * @param h header to add
+ * @return 0 on success
+ */
+int rpmtsHeaderAddDB(rpmts ts, Header h);
+
+/** \ingroup rpmts
+ * Remove a header from the database used by the transaction.
+ * @param ts transaction set
+ * @param hdrNum index of header to remove
+ * @return 0 on success
+ */
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum);
+
+/** \ingroup rpmts
* Return transaction database iterator.
* @param ts transaction set
* @param rpmtag database index tag
++++++ headerchk.diff ++++++
--- ./lib/header.c.orig 2011-10-19 15:08:41.000000000 +0000
+++ ./lib/header.c 2011-10-19 15:11:40.000000000 +0000
@@ -904,6 +904,10 @@ Header headerLoad(void * uh)
h->indexUsed += ne;
}
}
+ rdlen += REGION_TAG_COUNT;
+ /* XXX should be equality test, but dribbles are sometimes a bit off? */
+ if (rdlen > dl)
+ goto errxit;
}
h->flags &= ~HEADERFLAG_SORTED;
--- ./rpmio/rpmpgp.c.orig 2011-10-19 15:12:17.000000000 +0000
+++ ./rpmio/rpmpgp.c 2011-10-19 15:13:46.000000000 +0000
@@ -402,6 +402,8 @@ static int pgpPrtSubType(const uint8_t *
while (hlen > 0) {
i = pgpLen(p, &plen);
+ if (i + plen > hlen)
+ break;
p += i;
hlen -= i;
@@ -484,7 +486,7 @@ static int pgpPrtSubType(const uint8_t *
p += plen;
hlen -= plen;
}
- return 0;
+ return (hlen != 0); /* non-zero hlen is an error */
}
static const char * const pgpSigRSA[] = {
@@ -608,7 +610,8 @@ fprintf(stderr, " hash[%zu] -- %s\n",
_digp->hashlen = sizeof(*v) + plen;
_digp->hash = memcpy(xmalloc(_digp->hashlen), v, _digp->hashlen);
}
- (void) pgpPrtSubType(p, plen, v->sigtype, _digp);
+ if (pgpPrtSubType(p, plen, v->sigtype, _digp))
+ return 1;
p += plen;
plen = pgpGrab(p,2);
@@ -619,7 +622,8 @@ fprintf(stderr, " hash[%zu] -- %s\n",
if (_debug && _print)
fprintf(stderr, " unhash[%zu] -- %s\n", plen, pgpHexStr(p, plen));
- (void) pgpPrtSubType(p, plen, v->sigtype, _digp);
+ if (pgpPrtSubType(p, plen, v->sigtype, _digp))
+ return 1;
p += plen;
plen = pgpGrab(p,2);
++++++ headerchk2.diff ++++++
--- lib/header.c.orig 2012-04-17 16:16:29.000000000 +0000
+++ lib/header.c 2012-04-17 16:53:32.000000000 +0000
@@ -197,7 +197,7 @@ int headerVerifyInfo(int il, int dl, con
return i;
if (hdrchkAlign(info->type, info->offset))
return i;
- if (!negate && hdrchkRange(dl, info->offset))
+ if (hdrchkRange(dl, info->offset))
return i;
if (hdrchkData(info->count))
return i;
@@ -837,10 +837,13 @@ Header headerLoad(void * uh)
entry->info.type = htonl(pe->type);
entry->info.count = htonl(pe->count);
+ entry->info.tag = htonl(pe->tag);
- if (hdrchkType(entry->info.type))
+ if (!ENTRY_IS_REGION(entry))
goto errxit;
- if (hdrchkTags(entry->info.count))
+ if (entry->info.type != REGION_TAG_TYPE)
+ goto errxit;
+ if (entry->info.count != REGION_TAG_COUNT)
goto errxit;
{ int off = ntohl(pe->offset);
@@ -856,7 +859,6 @@ Header headerLoad(void * uh)
ril = rdl/sizeof(*pe);
if (hdrchkTags(ril) || hdrchkData(rdl))
goto errxit;
- entry->info.tag = htonl(pe->tag);
} else {
ril = il;
rdl = (ril * sizeof(struct entryInfo_s));
@@ -876,13 +878,12 @@ Header headerLoad(void * uh)
indexEntry newEntry = entry + ril;
int ne = (h->indexUsed - ril);
int rid = entry->info.offset+1;
- int rc;
/* Load dribble entries from region. */
- rc = regionSwab(newEntry, ne, 0, pe+ril, dataStart, dataEnd, rid);
- if (rc < 0)
+ rdlen = regionSwab(newEntry, ne, rdlen, pe+ril,
+ dataStart, dataEnd, rid);
+ if (rdlen < 0)
goto errxit;
- rdlen += rc;
{ indexEntry firstEntry = newEntry;
int save = h->indexUsed;
@@ -905,7 +906,7 @@ Header headerLoad(void * uh)
}
}
rdlen += REGION_TAG_COUNT;
- /* XXX should be equality test, but dribbles are sometimes a bit off? */
+ /* should be equality test, but can be off if entries are not perfectly aligned */
if (rdlen > dl)
goto errxit;
}
--- lib/package.c.orig 2012-04-17 16:26:00.000000000 +0000
+++ lib/package.c 2012-04-17 16:26:05.000000000 +0000
@@ -241,16 +241,23 @@ static rpmRC headerVerify(rpmKeyring key
}
/* Is there an immutable header region tag? */
- if (!(entry.info.tag == RPMTAG_HEADERIMMUTABLE
- && entry.info.type == RPM_BIN_TYPE
- && entry.info.count == REGION_TAG_COUNT))
- {
+ if (!(entry.info.tag == RPMTAG_HEADERIMMUTABLE)) {
rc = RPMRC_NOTFOUND;
goto exit;
}
- /* Is the offset within the data area? */
- if (entry.info.offset >= dl) {
+ /* Is the region tag sane? */
+ if (!(entry.info.type == REGION_TAG_TYPE &&
+ entry.info.count == REGION_TAG_COUNT)) {
+ rasprintf(&buf,
+ _("region tag: BAD, tag %d type %d offset %d count %d\n"),
+ entry.info.tag, entry.info.type,
+ entry.info.offset, entry.info.count);
+ goto exit;
+ }
+
+ /* Is the trailer within the data area? */
+ if (entry.info.offset + REGION_TAG_COUNT > dl) {
rasprintf(&buf,
_("region offset: BAD, tag %d type %d offset %d count %d\n"),
entry.info.tag, entry.info.type,
@@ -263,10 +270,10 @@ static rpmRC headerVerify(rpmKeyring key
(void) memcpy(&info, regionEnd, REGION_TAG_COUNT);
regionEnd += REGION_TAG_COUNT;
- xx = headerVerifyInfo(1, dl, &info, &entry.info, 1);
+ xx = headerVerifyInfo(1, il * sizeof(*pe), &info, &entry.info, 1);
if (xx != -1 ||
!(entry.info.tag == RPMTAG_HEADERIMMUTABLE
- && entry.info.type == RPM_BIN_TYPE
+ && entry.info.type == REGION_TAG_TYPE
&& entry.info.count == REGION_TAG_COUNT))
{
rasprintf(&buf,
--- lib/signature.c.orig 2012-04-17 16:25:52.000000000 +0000
+++ lib/signature.c 2012-04-17 16:26:05.000000000 +0000
@@ -133,12 +133,19 @@ rpmRC rpmReadSignature(FD_t fd, Header *
}
/* Is there an immutable header region tag? */
- if (entry.info.tag == RPMTAG_HEADERSIGNATURES
- && entry.info.type == RPM_BIN_TYPE
- && entry.info.count == REGION_TAG_COUNT)
- {
-
- if (entry.info.offset >= dl) {
+ if (entry.info.tag == RPMTAG_HEADERSIGNATURES) {
+ /* Is the region tag sane? */
+ if (!(entry.info.type == REGION_TAG_TYPE &&
+ entry.info.count == REGION_TAG_COUNT)) {
+ rasprintf(&buf,
+ _("region tag: BAD, tag %d type %d offset %d count %d\n"),
+ entry.info.tag, entry.info.type,
+ entry.info.offset, entry.info.count);
+ goto exit;
+ }
+
+ /* Is the trailer within the data area? */
+ if (entry.info.offset + REGION_TAG_COUNT > dl) {
rasprintf(&buf,
_("region offset: BAD, tag %d type %d offset %d count %d\n"),
entry.info.tag, entry.info.type,
@@ -157,10 +164,10 @@ rpmRC rpmReadSignature(FD_t fd, Header *
}
dataEnd += REGION_TAG_COUNT;
- xx = headerVerifyInfo(1, dl, &info, &entry.info, 1);
+ xx = headerVerifyInfo(1, il * sizeof(*pe), &info, &entry.info, 1);
if (xx != -1 ||
!((entry.info.tag == RPMTAG_HEADERSIGNATURES || entry.info.tag == RPMTAG_HEADERIMAGE)
- && entry.info.type == RPM_BIN_TYPE
+ && entry.info.type == REGION_TAG_TYPE
&& entry.info.count == REGION_TAG_COUNT))
{
rasprintf(&buf,
++++++ helperenv.diff ++++++
--- macros.in.orig 2012-04-18 13:48:07.000000000 +0000
+++ macros.in 2012-04-18 13:47:41.000000000 +0000
@@ -515,7 +515,7 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.ex
# %__myattr_exclude_magic exclude by magic regex
# %__myattr_exclude_path exclude by path regex
#
-%_fileattrsdir %{_rpmconfigdir}/fileattrs
+%_fileattrsdir %{__set_helper_env}%{_rpmconfigdir}/fileattrs
#==============================================================================
# ---- Database configuration macros.
++++++ initscriptsprov.diff ++++++
--- ./autodeps/linux.prov.orig 2011-05-11 16:45:13.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 16:51:10.000000000 +0000
@@ -107,4 +107,9 @@ fi
[ -x /usr/lib/rpm/gstreamer-provides ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u
+#
+# --- Provides of sysvinit scripts
+[ -x /usr/lib/rpm/sysvinitdeps.sh ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/sysvinitdeps.sh -P | sort -u
+
exit 0
--- ./scripts/Makefile.am.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/Makefile.am 2011-05-11 16:52:10.000000000 +0000
@@ -22,6 +22,7 @@ EXTRA_DIST = \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
macros.perl macros.php macros.python
rpmconfig_SCRIPTS = \
@@ -38,6 +39,7 @@ rpmconfig_SCRIPTS = \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
rpmdb_loadcvt rpm2cpio.sh tcl.req tgpg
rpmconfig_DATA = \
--- ./scripts/sysvinitdeps.sh.orig 2011-05-11 16:51:10.000000000 +0000
+++ ./scripts/sysvinitdeps.sh 2011-05-11 16:54:33.000000000 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+[ "$1" = '-P' -o "$1" = '--provides' ] || {
+ cat > /dev/null
+ exit 0
+}
+
+while read file; do
+ case $file in
+ */etc/init.d/*)
+ provs=`grep '^# *Provides:' $file | sed 's,^.*:,,'`
+ for p in $provs; do
+ echo "sysvinit($p)"
+ done
+ ;;
+ esac
+done
++++++ instobscheck.diff ++++++
--- lib/depends.c.orig 2012-04-18 14:46:10.000000000 +0000
+++ lib/depends.c 2012-04-18 14:46:15.000000000 +0000
@@ -355,6 +355,7 @@ static int rpmdbProvides(rpmts ts, depCa
rpmdbMatchIterator mi = NULL;
Header h = NULL;
int rc = 0;
+ int matchnvr = rpmdsTagN(dep) == RPMTAG_OBSOLETENAME;
/* See if we already looked this up */
if (depCacheGetEntry(dcache, DNEVR, &cachedrc, NULL, NULL)) {
@@ -368,7 +369,7 @@ static int rpmdbProvides(rpmts ts, depCa
* taking file state into account: replaced, wrong colored and
* not installed files can not satisfy a dependency.
*/
- if (Name[0] == '/') {
+ if (Name[0] == '/' && !matchnvr) {
mi = rpmtsPrunedIterator(ts, RPMDBI_BASENAMES, Name);
while ((h = rpmdbNextIterator(mi)) != NULL) {
int fs = RPMFILE_STATE_MISSING;
@@ -390,9 +391,16 @@ static int rpmdbProvides(rpmts ts, depCa
if (h == NULL) {
mi = rpmtsPrunedIterator(ts, RPMDBI_PROVIDENAME, Name);
while ((h = rpmdbNextIterator(mi)) != NULL) {
- if (rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) {
- rpmdsNotify(dep, "(db provides)", rc);
- break;
+ if (matchnvr) {
+ if (rpmdsNVRMatchesDep(h, dep , _rpmds_nopromote)) {
+ rpmdsNotify(dep, "(db provides)", rc);
+ break;
+ }
+ } else {
+ if (rpmdsAnyMatchesDep(h, dep, _rpmds_nopromote)) {
+ rpmdsNotify(dep, "(db provides)", rc);
+ break;
+ }
}
}
rpmdbFreeIterator(mi);
++++++ langnoc.diff ++++++
--- ./macros.in.orig 2011-07-18 17:18:24.000000000 +0000
+++ ./macros.in 2011-07-18 17:18:36.000000000 +0000
@@ -1249,6 +1249,7 @@ EOF
# %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,
--- ./scripts/find-lang.sh.orig 2011-07-18 17:18:24.000000000 +0000
+++ ./scripts/find-lang.sh 2011-07-18 17:18:36.000000000 +0000
@@ -62,6 +62,8 @@ MO=
MO_NAME=$NAME.lang
ALL_NAME=#
NO_ALL_NAME=
+ONLY_C=#
+NO_C=#
while test $# -gt 0 ; do
case "${1}" in
@@ -98,6 +100,14 @@ while test $# -gt 0 ; do
NO_ALL_NAME=#
shift
;;
+ --with-only-C )
+ ONLY_C=
+ shift
+ ;;
+ --without-C )
+ NO_C=
+ shift
+ ;;
* )
MO_NAME=${1}
shift
@@ -117,27 +127,32 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%lang(C) %dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%lang(C) %dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
-'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%lang(C) %dir \1:
+'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%lang(C) %dir \1:
s:^\([^%].*\)::
+s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type f|sed '
@@ -145,6 +160,8 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -157,6 +174,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -170,6 +189,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -182,6 +203,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -190,6 +213,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -197,6 +222,8 @@ find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
++++++ lazystatfs.diff ++++++
Prefer sys/vfs.h, as statvfs stats all filesystems again
--- ./configure.ac.orig 2011-05-12 12:36:32.000000000 +0000
+++ ./configure.ac 2011-05-12 12:36:42.000000000 +0000
@@ -402,25 +402,25 @@ dnl
found_struct_statfs=no
if test X$found_struct_statfs = Xno ; then
-dnl Solaris 2.6+ wants to use statvfs
+dnl first try including sys/vfs.h
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
-#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
- AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
- [statfs in (for solaris 2.6+ systems)])
+#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
+ AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)])
found_struct_statfs=yes],[])
fi
if test X$found_struct_statfs = Xno ; then
-dnl first try including sys/vfs.h
+dnl Solaris 2.6+ wants to use statvfs
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
-#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
- AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)])
+#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
+ AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
+ [statfs in (for solaris 2.6+ systems)])
found_struct_statfs=yes],[])
fi
--- ./lib/transaction.c.orig 2011-05-12 12:36:55.000000000 +0000
+++ ./lib/transaction.c 2011-05-12 12:38:03.000000000 +0000
@@ -114,7 +114,11 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(c
dsi->bneeded = 0;
dsi->ineeded = 0;
#ifdef STATFS_HAS_F_BAVAIL
+# ifdef ST_RDONLY
dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail;
+# else
+ dsi->bavail = sfb.f_bavail;
+# endif
#else
/* FIXME: the statfs struct doesn't have a member to tell how many blocks are
* available for non-superusers. f_blocks - f_bfree is probably too big, but
++++++ localetag.diff ++++++
Convert output to the current locale. Assumes utf8 input if the
decoding works, otherwise iso-8859-1.
--- ./lib/tagexts.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/tagexts.c 2011-05-10 16:05:30.000000000 +0000
@@ -2,6 +2,7 @@
* \file lib/formats.c
*/
+#include
#include "system.h"
#include
@@ -150,6 +151,114 @@ exit:
return rc;
}
+static char * strtolocale(char *str)
+{
+ wchar_t *wstr, *wp;
+ const unsigned char *cp;
+ char *cc;
+ int state = 0;
+ int c;
+ int ccl, cca, mb_cur_max;
+ size_t l;
+ mbstate_t ps;
+ int strisutf8 = 1;
+ int locisutf8 = 1;
+
+ if (!str)
+ return 0;
+ if (!*str)
+ return str;
+ wstr = (wchar_t *)xmalloc((strlen(str) + 1) * sizeof(*wstr));
+ wp = wstr;
+ cp = (const unsigned char *)str;
+ while ((c = *cp++) != 0) {
+ if (state) {
+ if ((c & 0xc0) != 0x80) {
+ /* encoding error */
+ break;
+ }
+ c = (c & 0x3f) | (state << 6);
+ if (!(state & 0x40000000)) {
+ /* check for overlong sequences */
+ if ((c & 0x820823e0) == 0x80000000)
+ c = 0xfdffffff;
+ else if ((c & 0x020821f0) == 0x02000000)
+ c = 0xfff7ffff;
+ else if ((c & 0x000820f8) == 0x00080000)
+ c = 0xffffd000;
+ else if ((c & 0x0000207c) == 0x00002000)
+ c = 0xffffff70;
+ }
+ } else {
+ /* new sequence */
+ if (c >= 0xfe)
+ c = 0xfffd;
+ else if (c >= 0xfc)
+ c = (c & 0x01) | 0xbffffffc; /* 5 bytes to follow */
+ else if (c >= 0xf8)
+ c = (c & 0x03) | 0xbfffff00; /* 4 */
+ else if (c >= 0xf0)
+ c = (c & 0x07) | 0xbfffc000; /* 3 */
+ else if (c >= 0xe0)
+ c = (c & 0x0f) | 0xbff00000; /* 2 */
+ else if (c >= 0xc2)
+ c = (c & 0x1f) | 0xfc000000; /* 1 */
+ else if (c >= 0xc0)
+ c = 0xfdffffff; /* overlong */
+ else if (c >= 0x80)
+ c = 0xfffd;
+ }
+ state = (c & 0x80000000) ? c : 0;
+ if (state)
+ continue;
+ *wp++ = (wchar_t)c;
+ }
+ if (state) {
+ /* encoding error, assume latin1 */
+ strisutf8 = 0;
+ cp = (const unsigned char *)str;
+ wp = wstr;
+ while ((c = *cp++) != 0) {
+ *wp++ = (wchar_t)c;
+ }
+ }
+ *wp = 0;
+ mb_cur_max = MB_CUR_MAX;
+ memset(&ps, 0, sizeof(ps));
+ cc = xmalloc(mb_cur_max);
+ /* test locale encoding */
+ if (wcrtomb(cc, 0x20ac, &ps) != 3 || memcmp(cc, "\342\202\254", 3))
+ locisutf8 = 0;
+ if (locisutf8 == strisutf8) {
+ wstr = _free(wstr);
+ return str;
+ }
+ str = _free((char *)str);
+ memset(&ps, 0, sizeof(ps));
+ ccl = cca = 0;
+ for (wp = wstr; ; wp++) {
+ l = wcrtomb(cc + ccl, *wp, &ps);
+ if (*wp == 0)
+ break;
+ if (l == (size_t)-1) {
+ if (*wp < (wchar_t)256 && mbsinit(&ps)) {
+ cc[ccl] = *wp;
+ l = 1;
+ } else
+ l = wcrtomb(cc + ccl, (wchar_t)'?', &ps);
+ }
+ if (l == 0 || l == (size_t)-1)
+ continue;
+ ccl += l;
+ if (ccl > cca) {
+ cca = ccl + 16;
+ cc = xrealloc(cc, cca + mb_cur_max);
+ }
+ }
+ wstr = _free(wstr);
+ return (char *)cc;
+}
+
/**
* Retrieve trigger info.
* @param h header
@@ -435,10 +544,41 @@ static int i18nTag(Header h, rpmTag tag,
#endif
rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (rc && td->data) {
+ td->data = strtolocale(td->data);
+ }
return rc;
}
/**
+ * Retrieve text and convert to locale.
+ */
+static int localeTag(Header h, rpmTag tag, rpmtd td)
+{
+ int rc;
+ rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (!rc)
+ return 0;
+ if (td->type == RPM_STRING_TYPE) {
+ td->data = strtolocale(td->data);
+ td->count = 1;
+ } else if (td->type == RPM_STRING_ARRAY_TYPE) {
+ char **arr;
+ int i;
+ arr = xmalloc(td->count * sizeof(*arr));
+ for (i = 0; i < td->count; i++) {
+ arr[i] = xstrdup(((char **)td->data)[i]);
+ arr[i] = strtolocale(arr[i]);
+ }
+ _free(td->data);
+ td->data = arr;
+ td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED;
+ }
+ return rc;
+}
+
+
+/**
* Retrieve summary text.
* @param h header
* @retval td tag data container
@@ -460,6 +600,16 @@ static int descriptionTag(Header h, rpmt
return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags);
}
+static int changelognameTag(Header h, rpmtd td)
+{
+ return localeTag(h, RPMTAG_CHANGELOGNAME, td);
+}
+
+static int changelogtextTag(Header h, rpmtd td)
+{
+ return localeTag(h, RPMTAG_CHANGELOGTEXT, td);
+}
+
/**
* Retrieve group text.
* @param h header
@@ -677,6 +827,8 @@ static const struct headerTagFunc_s rpmH
{ RPMTAG_LONGARCHIVESIZE, longarchivesizeTag },
{ RPMTAG_LONGSIZE, longsizeTag },
{ RPMTAG_LONGSIGSIZE, longsigsizeTag },
+ { RPMTAG_CHANGELOGNAME, changelognameTag },
+ { RPMTAG_CHANGELOGTEXT, changelogtextTag },
{ RPMTAG_DBINSTANCE, dbinstanceTag },
{ RPMTAG_EVR, evrTag },
{ RPMTAG_NVR, nvrTag },
++++++ macrosin.diff ++++++
--- ./macros.in.orig 2011-01-03 13:57:41.000000000 +0000
+++ ./macros.in 2011-05-12 14:32:18.000000000 +0000
@@ -178,22 +178,22 @@
# Template for debug information sub-package.
%debug_package \
-%ifnarch noarch\
%global __debug_package 1\
-%package debug\
+%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
-%description debug\
+#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
+%description debuginfo\
This package provides debug information for package %{name}.\
Debug information is useful when developing applications that use this\
package or when debugging this package.\
-%files debug -f debugfiles.list\
+%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
-%endif\
%{nil}
-%_defaultdocdir %{_datadir}/doc
+%_defaultdocdir %{_datadir}/doc/packages
+%_docdir_fmt %%{NAME}
# The path to the gzip executable (legacy, use %{__gzip} instead).
%_gzipbin %{__gzip}
@@ -230,7 +230,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}
@@ -333,7 +333,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.
@@ -417,7 +417,7 @@ package or when debugging this package.\
#
# Use internal dependency generator rather than external helpers?
-%_use_internal_dependency_generator 1
+%_use_internal_dependency_generator 1
#
# Filter GLIBC_PRIVATE Provides: and Requires:
@@ -463,16 +463,22 @@ print (t)\
# Undefined, missing or %{nil} will use package content (if available).
%_verify_file_context_path %{__file_context_path}
+# maxnum,cuttime,minnum
+# 2009/03/01 (SLES11 GA)
+%_binarychangelogtrim 0,1235862000,10
+
#
# Path to scripts to autogenerate package dependencies,
#
# 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 %{_rpmconfigdir}/find-provides %name
+%__find_requires %{_rpmconfigdir}/find-requires %name
#%__find_conflicts ???
#%__find_obsoletes ???
+#%__find_supplements ???
+#%__find_enhances ???
#
# Path to file attribute classifications for automatic dependency
@@ -533,12 +539,12 @@ print (t)\
#
# Misc BDB tuning options
-%__dbi_other mp_mmapsize=128Mb mp_size=64Mb
+%__dbi_other mp_mmapsize=128Mb mp_size=64Mb
-%_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.
@@ -857,7 +863,7 @@ print (t)\
%_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@
@@ -1020,6 +1026,181 @@ 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
+
+#------------------------------------------------------------------------------
+#
+# RPM macros for Java applications.
+#
+# JPackage Project http://www.jpackage.org/
+# David Walluck
+# Ville Skytt�
+# Nicolas Mailhot
+#
+# $Id: macros.jpackage,v 1.1.2.5 2003/08/30 13:24:58 scop Exp $
+#
+
+# ---- default Java directories
+
+#
+# Root directory where all Java VMs/SDK/JREs are installed.
+#
+%_jvmdir %{_libdir}/jvm
+
+#
+# Root directory where all Java VMs/SDK/JREs expose their jars
+#
+%_jvmjardir %{_libdir}/jvm-exports
+
+#
+# Root directory for all Java VM/SDK/JRE's private things.
+#
+%_jvmprivdir %{_libdir}/jvm-private
+
+#
+# Directory where arch and version independent jars are installed.
+# This has already been integrated in RH macros following our request.
+#
+# By extension:
+# %{_javadir}-ext:
+# - version dependent jars
+# %{_javadir}-x.y.z:
+# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext)
+# %{_javadir}-utils:
+# - Java-related scripts
+#
+# To simplify things only %{_javadir} is defined.
+#
+%_javadir %{_datadir}/java
+
+#
+# Directory where arch-specific (JNI) version-independent jars are installed.
+#
+# By extension:
+# %{_jnidir}-ext:
+# - version dependent jars
+# %{_jnidir}-x.y.z:
+# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext)
+# To simplify things only %{_jnidir} is defined.
+#
+%_jnidir %{_libdir}/java
+
+#
+# Root directory where all javadoc is installed. Also already in RH macros.
+#
+%_javadocdir %{_datadir}/javadoc
+
+#
+# Current default JVM home.
+#
+%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
+
+# ---- default Java commands
+
+%ant JAVA_HOME=%{java_home} ant
+%jar %{java_home}/bin/jar
+%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
+%javac %{java_home}/bin/javac
+%javadoc %{java_home}/bin/javadoc
+
+# ---- Java extension handling macros
+
+#
+# add_jvm_extension should be used in %install by extension packages to declare
+# what extension jars they provide.
+#
+# For example a package that provides foo.jar which is the bar extension
+# under java 1.2 and 1.3 should do a:
+#
+# %install
+# ... # create foo.jar in %{javadir}-ext
+# %add_jvm_extension foo bar 1.2 1.3
+#
+# %files
+# %{javadir}-ext/foo.jar
+# %{javadir}-*/bar.jar
+#
+%add_jvm_extension JAVA_LIBDIR=%{buildroot}/%{_javadir} %{_bindir}/jvmjar -l
+
+#
+# Standard JPackage script
+#
+# This is kind of tasteless and should be moved to an external template
+#
+# %1 main class
+# %2 flags
+# %3 options
+# %4 jars (separated by ':')
+# %5 the name of script you wish to create
+#
+%jpackage_script() \
+install -d -m 755 $RPM_BUILD_ROOT%{_bindir}\
+cat > $RPM_BUILD_ROOT%{_bindir}/%5 << EOF \
+#!/bin/sh\
+#\
+# %{name} script\
+# JPackage Project http://www.jpackage.org/\
+\
+# Source functions library\
+. %{_javadir}-utils/java-functions\
+\
+# Source system prefs\
+if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then\
+ . %{_sysconfdir}/java/%{name}.conf\
+fi\
+\
+# Source user prefs\
+if [ -f \\$HOME/.%{name}rc ] ; then\
+ . \\$HOME/.%{name}rc\
+fi\
+\
+# Configuration\
+MAIN_CLASS=%1\
+BASE_FLAGS=%2\
+BASE_OPTIONS=%3\
+BASE_JARS="%(echo %4 | sed -e 's,:, ,g')"\
+\
+# Set parameters\
+set_jvm\
+set_classpath \\$BASE_JARS\
+set_flags \\$BASE_FLAGS\
+set_options \\$BASE_OPTIONS\
+\
+# Let's start\
+run "\\$@"\
+EOF
+
#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatibile processors
# (Note: This macro (and it's analogues) will probably be obsoleted when
@@ -1030,7 +1211,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
@@ -1070,3 +1253,26 @@ done \
# \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}
+
+%service_add() %{fillup_and_insserv %{1}}
+%service_del_preun() %{stop_on_removal %{1}}
+%service_del_postun() %{restart_on_update %{1}}
+
+%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}
+
++++++ missingok.diff ++++++
support missingok dependency bit
--- ./lib/depends.c.orig 2011-02-15 13:10:59.000000000 +0000
+++ ./lib/depends.c 2011-05-10 16:06:39.000000000 +0000
@@ -448,8 +448,13 @@ retry:
}
unsatisfied:
- rc = 1; /* dependency is unsatisfied */
- rpmdsNotify(dep, NULL, rc);
+ if (rpmdsFlags(dep) & RPMSENSE_MISSINGOK) {
+ rc = 0; /* dependency is unsatisfied, but just a hint. */
+ rpmdsNotify(dep, _("(hint skipped)"), rc);
+ } else {
+ rc = 1; /* dependency is unsatisfied */
+ rpmdsNotify(dep, NULL, rc);
+ }
exit:
return rc;
--- ./lib/rpmds.h.orig 2011-05-10 16:09:22.000000000 +0000
+++ ./lib/rpmds.h 2011-05-10 16:08:04.000000000 +0000
@@ -68,6 +68,7 @@ typedef rpmFlags rpmsenseFlags;
RPMSENSE_SCRIPT_POSTUN | \
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
+ RPMSENSE_MISSINGOK | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \
++++++ modalias-encode.diff ++++++
Module aliases (modinfo -F alias <module>) may contain special characters
that rpm does not allow in dependencies, such as commas. Encode those as
%XX to avoid generating broken dependencies.
Signed-off-by: Andreas Gruenbacher
Index: rpm-4.4.2.3/scripts/find-supplements.ksyms
===================================================================
--- scripts/find-supplements.ksyms
+++ scripts/find-supplements.ksyms
@@ -48,6 +48,21 @@ combine_modaliases() {
print_modaliases "$class" "$variants" "$pos"
}
+# Encode all characters other than [*:a-zA-Z0-9] in stdin as %XX.
+# (This includes the % character itself, which becomes %25.)
+hexenc() {
+ local line hex
+
+ while read line; do
+ set -- "" "$line"
+ while [[ "$2" =~ ([*:a-zA-Z0-9]*)([^*:a-zA-Z0-9])(.*) ]]; do
+ hex=$(echo -n "${BASH_REMATCH[2]}" | hexdump -e '"%X"')
+ set -- "$1${BASH_REMATCH[1]}%$hex" "${BASH_REMATCH[3]}"
+ done
+ echo "$1$2"
+ done
+}
+
aliases_of_filelist() {
modlist=$(mktemp)
have_module=1
@@ -60,6 +75,7 @@ aliases_of_filelist() {
fi
have_module=0
/sbin/modinfo -F alias "$module" \
+ | hexenc \
| sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p" | tee -a $modlist
done
if ! test -s "$modlist" && test $have_module = 0; then
++++++ modalias-kernel_module.diff ++++++
Index: scripts/find-supplements.ksyms
===================================================================
--- scripts/find-supplements.ksyms.orig
+++ scripts/find-supplements.ksyms
@@ -1,6 +1,8 @@
#! /bin/sh
+SPECFILE=${RPMBUILD_SPECFILE:-/usr/src/packages/SOURCES/$1.spec}
IFS=$'\n'
+PACKAGE=$1
case "$1" in
kernel-module-*) ;; # Fedora kernel module package names start with
@@ -46,11 +48,54 @@ combine_modaliases() {
print_modaliases "$class" "$variants" "$pos"
}
-for module in $(grep -E '/lib/modules/.+\.ko$'); do
- vermagic=$(/sbin/modinfo -F vermagic "$module")
- krel=${vermagic%% *}
- /sbin/modinfo -F alias "$module" \
- | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
-done \
+aliases_of_filelist() {
+ modlist=$(mktemp)
+ have_module=1
+ for module in $(grep -E '/lib/modules/.+\.ko$'); do
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
+ krel=${vermagic%% *}
+ if ! test -x /sbin/modinfo; then
+ echo "ERROR: add module-init-tools to BuildRequires" >&2
+ exit 1
+ fi
+ have_module=0
+ /sbin/modinfo -F alias "$module" \
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p" | tee -a $modlist
+ done
+ if ! test -s "$modlist" && test $have_module = 0; then
+ echo "packageand(kernel-${krel##*-}:$PACKAGE)"
+ fi
+ rm -f $modlist
+}
+
+aliases_of_specfile_macro() {
+ declare regex
+
+ regex=$(
+ set -o noglob
+ set -- $(sed -ne 's:^%supplements_kernel_module[ \t]::p' \
+ $SPECFILE)
+ while [ $# -ge 1 ]; do
+ regex=$(echo "$1" \
+ | sed -e 's:[.]:\\.:g' \
+ -e 's:?:.:g' \
+ -e 's:\*:.*:g' \
+ -e 's:\\:\\\\:g')
+ echo -n "^$regex\$"
+ [ $# -ge 2 ] && echo -n "|"
+ shift
+ done
+ )
+
+ if [ -n "$regex" ]; then
+ awk '
+ $1 == "alias" && $3 ~ regex { print $2 }
+ ' regex="$regex" /lib/modules/*/modules.alias
+ fi
+}
+
+( aliases_of_filelist
+ aliases_of_specfile_macro "$1"
+) \
| sort -u \
| combine_modaliases
++++++ modalias.diff ++++++
--- ./macros.in.orig 2011-05-11 14:57:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:01:39.000000000 +0000
@@ -470,14 +470,18 @@ print (t)\
#
# 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 %name
-%__find_requires %{_rpmconfigdir}/find-requires %name
+%__find_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides %name
+%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name
#%__find_conflicts ???
#%__find_obsoletes ???
-#%__find_supplements ???
+%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name
#%__find_enhances ???
#
--- ./scripts/find-supplements.ksyms.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements.ksyms 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,56 @@
+#! /bin/sh
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*) ;; # Fedora kernel module package names start with
+ # kernel-module.
+kernel*) is_kernel_package=1 ;;
+esac
+
+if ! [ -z "$is_kernel_package" ]; then
+ cat > /dev/null
+ exit 0
+fi
+
+print_modaliases() {
+ declare class=$1 variants=$2 pos=$3
+ if [ -n "$variants" ]; then
+ echo "${class:0:pos}[$variants]${class:pos+1}"
+ else
+ [ -z "$class" ] || echo "$class"
+ fi
+}
+
+combine_modaliases() {
+ declare tag class variants pos n
+ read class
+ while read tag; do
+ for ((n=0; n<${#class}; n++)); do
+ if [ "*" != "${class:n:1}" -a \
+ "${class:0:n}" = "${tag:0:n}" -a \
+ "${class:n+1}" = "${tag:n+1}" ] &&
+ ( [ -z "$pos" ] || [ $n = $pos ] ); then
+ variants="${variants:-${class:n:1}}${tag:n:1}"
+ pos=$n
+ break
+ fi
+ done
+ if [ $n -eq ${#class} ]; then
+ print_modaliases "$class" "$variants" "$pos"
+ variants=
+ pos=
+ class=$tag
+ fi
+ done
+ print_modaliases "$class" "$variants" "$pos"
+}
+
+for module in $(grep -E '/lib/modules/.+\.ko$'); do
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
+ krel=${vermagic%% *}
+ /sbin/modinfo -F alias "$module" \
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
+done \
+| sort -u \
+| combine_modaliases
--- ./scripts/find-supplements.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
+
+#
+# --- Kernel module hardware identifiers
+# (e.g., modalias(pci:v0000109Ed00000878sv00000070sd0000FF01bc*sc*i*)
+[ -x /usr/lib/rpm/find-supplements.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-supplements.ksyms "$@"
+
+exit 0
++++++ mono-find-requires.diff ++++++
--- scripts/mono-find-requires
+++ scripts/mono-find-requires
@@ -42,8 +42,12 @@
(START==1) && /^\tName=/ {
sub(/Name=/, "", $1);
LIBNAME=$1
-
- print "mono(" LIBNAME ") = " VERSION
+ # Allow rpm deps to be resolved for 1.0 profile version
+ if (VERSION=="1.0.3300.0")
+ OP=">="
+ else
+ OP="="
+ print "mono(" LIBNAME ") " OP " " VERSION
START=0
}
') 2> /dev/null
++++++ nameversioncompare.diff ++++++
Also compare the name and not only the version when checking if
two packages are the same. rh#104066
--- ./lib/depends.c.orig 2011-05-12 12:20:01.000000000 +0000
+++ ./lib/depends.c 2011-05-12 12:26:25.000000000 +0000
@@ -95,6 +95,24 @@ static rpmdbMatchIterator rpmtsPrunedIte
return mi;
}
+static int rpmNameVersionCompare(Header first, Header second)
+{
+ const char * one, * two;
+ int rc;
+
+ one = headerGetString(first, RPMTAG_NAME);
+ two = headerGetString(second, RPMTAG_NAME);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ one = headerGetString(first, RPMTAG_ARCH);
+ two = headerGetString(second, RPMTAG_ARCH);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ return rpmVersionCompare(first, second);
+}
+
#define skipColor(_tscolor, _color, _ocolor) \
((_tscolor) && (_color) && (_ocolor) && !((_color) & (_ocolor)))
@@ -111,7 +129,7 @@ static void addUpgradeErasures(rpmts ts,
continue;
/* Skip packages that contain identical NEVR. */
- if (rpmVersionCompare(h, oh) == 0)
+ if (rpmNameVersionCompare(h, oh) == 0)
continue;
removePackage(ts, oh, p);
@@ -150,7 +168,7 @@ static void addObsoleteErasures(rpmts ts
* If no obsoletes version info is available, match all names.
*/
if (rpmdsEVR(obsoletes) == NULL
- || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
+ || rpmdsNVRMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
char * ohNEVRA = headerGetAsString(oh, RPMTAG_NEVRA);
rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n",
rpmdsDNEVR(obsoletes)+2, ohNEVRA);
++++++ no_rep_autop.diff ++++++
It seems to be gone...
--- lib/Makefile.am.orig 2011-05-12 12:59:42.000000000 +0000
+++ lib/Makefile.am 2011-05-12 12:59:59.000000000 +0000
@@ -126,7 +126,6 @@ rpmdb_printlog_LDADD = \
$(top_builddir)/db3/fileops_autop.o \
$(top_builddir)/db3/hash_autop.o \
$(top_builddir)/db3/qam_autop.o \
- $(top_builddir)/db3/rep_autop.o \
$(top_builddir)/db3/txn_autop.o \
$(top_builddir)/db3/util_sig.o \
librpm.la
++++++ nobuildcolor.diff ++++++
Disable file coloring for SUSE systems
--- build/rpmfc.c.orig 2011-05-13 12:35:29.000000000 +0000
+++ build/rpmfc.c 2011-05-13 13:49:37.000000000 +0000
@@ -1312,7 +1312,7 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
goto exit;
/* Add per-file colors(#files) */
- if (rpmtdFromArgi(&td, RPMTAG_FILECOLORS, fc->fcolor)) {
+ if (rpmExpandNumeric("%{?_transaction_color}") != 0 && rpmtdFromArgi(&td, RPMTAG_FILECOLORS, fc->fcolor)) {
rpm_color_t *fcolor;
assert(rpmtdType(&td) == RPM_INT32_TYPE);
/* XXX Make sure only primary (i.e. Elf32/Elf64) colors are added. */
++++++ nomagiccheck.diff ++++++
Don't let rpm complain about a missing /etc/magic.mgc file
--- build/rpmfc.c.orig 2011-05-13 16:33:20.000000000 +0000
+++ build/rpmfc.c 2011-05-13 16:33:55.000000000 +0000
@@ -896,7 +896,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t arg
{
ARGV_t fcav = NULL;
int xx;
- int msflags = MAGIC_CHECK | MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
+ int msflags = MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
magic_t ms = NULL;
rpmRC rc = RPMRC_FAIL;
++++++ noprereqdeprec.diff ++++++
Not deprecated for SUSE builds.
--- ./build/parsePreamble.c.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 16:35:47.000000000 +0000
@@ -891,7 +891,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")},
{RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")},
{RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")},
- {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 2, 0, LEN_AND_STR("prereq")},
{RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")},
@@ -900,7 +900,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarchitectures")},
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarch")},
{RPMTAG_BUILDCONFLICTS, 0, 0, LEN_AND_STR("buildconflicts")},
- {RPMTAG_BUILDPREREQ, 0, 1, LEN_AND_STR("buildprereq")},
+ {RPMTAG_BUILDPREREQ, 0, 0, LEN_AND_STR("buildprereq")},
{RPMTAG_BUILDREQUIRES, 0, 0, LEN_AND_STR("buildrequires")},
{RPMTAG_AUTOREQPROV, 0, 0, LEN_AND_STR("autoreqprov")},
{RPMTAG_AUTOREQ, 0, 0, LEN_AND_STR("autoreq")},
++++++ perlprov.diff ++++++
Support a "first version wins" semantics.
--- ./scripts/perl.prov.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/perl.prov 2011-05-11 15:32:39.000000000 +0000
@@ -170,7 +170,7 @@ sub process_file {
$version = $1;
}
- $require{$package} = $version;
+ $require{$package} ||= $version;
}
# Allow someone to have a variable that defines virtual packages
++++++ platformin.diff ++++++
SUSE specific platform changes.
--- ./platform.in.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./platform.in 2011-05-11 15:02:03.000000000 +0000
@@ -21,7 +21,7 @@
%_exec_prefix @exec_prefix@
%_bindir @bindir@
%_sbindir @sbindir@
-%_libexecdir @libexecdir@
+%_libexecdir %{_exec_prefix}/lib
%_datarootdir @datarootdir@
%_datadir @datadir@
%_sysconfdir @sysconfdir@
@@ -33,7 +33,7 @@
%_oldincludedir @oldincludedir@
%_infodir @infodir@
%_mandir @mandir@
-%_initddir %{_sysconfdir}/rc.d/init.d
+%_initddir %{_sysconfdir}/init.d
# Deprecated misspelling, present for backwards compatibility.
%_initrddir %{_initddir}
@@ -143,3 +143,21 @@
@mandrake@%_gamesdir games
@mandrake@%_gamesbindir %{_prefix}/%{_gamesdir}
@mandrake@%_gamesdatadir %{_datadir}/%{_gamesdir}
+@SuSE@#---------------------------------------------------------------------
+@SuSE@# Expanded at end of %prep
+@SuSE@#
+@SuSE@%__id_u %{__id} -u
+@SuSE@%__chown_Rhf %{__chown} -Rhf
+@SuSE@%__chgrp_Rhf %{__chgrp} -Rhf
+@SuSE@%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
+@SuSE@%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root
+@SuSE@%_fixperms %{__chmod} -Rf @FIXPERMS@
+@SuSE@
+@SuSE@#---------------------------------------------------------------------
+@SuSE@# Expanded at start of %build
+@SuSE@#
+@SuSE@%__spec_build_pre %{___build_pre}\
+@SuSE@%{?buildroot: %__rm -rf "$RPM_BUILD_ROOT"\
+@SuSE@ %__mkdir_p `dirname "$RPM_BUILD_ROOT"`\
+@SuSE@ %__mkdir "$RPM_BUILD_ROOT"\
+@SuSE@}
++++++ pythondeps.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:31:39.000000000 +0200
+++ autodeps/linux.prov 2011-06-08 13:31:39.191646314 +0200
@@ -11,7 +11,7 @@ filelist=($(printf "%s\n" "${filelist[@]
solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
cut -d: -f1))
-pythonlist=
+pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/bin/python.\..$'))
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
@@ -54,8 +54,8 @@ done | sort -u
#
# --- Python modules.
-[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
- printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.prov | sort -u
+[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] &&
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -P | sort -u
#
# --- Tcl modules.
Index: autodeps/linux.req
===================================================================
--- autodeps/linux.req.orig 2011-06-08 13:31:38.000000000 +0200
+++ autodeps/linux.req 2011-06-08 13:31:39.191646314 +0200
@@ -31,7 +31,7 @@ liblist=($(printf "%s\0" "${filelist[@]}
interplist=()
perllist=()
-pythonlist=()
+pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..'))
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
@@ -127,8 +127,8 @@ done | sort -u
#
# --- Python modules.
-[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
- printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.req | sort -u
+[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] && \
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -R | sort -u
#
# --- Tcl modules.
++++++ pythonhardlink.diff ++++++
--- scripts/brp-python-hardlink.orig 2012-04-18 13:33:39.000000000 +0000
+++ scripts/brp-python-hardlink 2012-04-18 13:34:52.000000000 +0000
@@ -10,8 +10,8 @@ fi
find "$RPM_BUILD_ROOT" -type f -name "*.pyc" | while read pyc ; do
pyo="${pyc%c}o"
if [ -f "$pyo" ] ; then
- csha="$(sha1sum -b $pyc | cut -d' ' -f 1)" && \
- osha="$(sha1sum -b $pyo | cut -d' ' -f 1)" && \
+ csha="$(sha1sum -b "$pyc" | cut -d' ' -f 1)" && \
+ osha="$(sha1sum -b "$pyo" | cut -d' ' -f 1)" && \
if [ "$csha" = "$osha" ] ; then
ln -f "$pyc" "$pyo"
fi
++++++ refreshtestarch.diff ++++++
Also test architecture in "refresh" test when not colored. This allows
updates to different architectures.
--- ./lib/psm.c.orig 2010-12-21 09:50:23.000000000 +0000
+++ ./lib/psm.c 2011-05-11 12:47:13.000000000 +0000
@@ -723,6 +723,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
psm->scriptArg = psm->npkgs_installed + 1;
+ /* this must match rpmNameVersionCompare in depends.c */
mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(psm->te), 0);
xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP,
rpmteE(psm->te));
@@ -730,9 +731,9 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
rpmteV(psm->te));
xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP,
rpmteR(psm->te));
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP,
+ rpmteA(psm->te));
if (tscolor) {
- xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP,
- rpmteA(psm->te));
xx = rpmdbSetIteratorRE(mi, RPMTAG_OS, RPMMIRE_STRCMP,
rpmteO(psm->te));
}
++++++ remove-brp-strips.diff ++++++
Subject: remove references to removed brp scripts
Some brp-scripts are not used in openSUSE, remove references
to it
--- ./platform.in.orig 2011-05-11 15:02:03.000000000 +0000
+++ ./platform.in 2011-05-11 15:38:05.000000000 +0000
@@ -55,8 +55,6 @@
%__os_install_post \
%{_rpmconfigdir}/brp-compress \
%{_rpmconfigdir}/brp-strip %{__strip} \
- %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
- %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}
%__spec_install_post\
++++++ remove-translations.diff ++++++
--- ./scripts/find-lang.sh.orig 2011-05-11 16:45:30.000000000 +0000
+++ ./scripts/find-lang.sh 2011-05-11 16:55:14.000000000 +0000
@@ -122,6 +122,17 @@ fi
MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW
+# remove languages we do not yet support - but give out statistics
+find $TOP_DIR/usr/share/locale/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
+ echo -n "removing translation $file: "
+ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
+ done
+ rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi
+done
+
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
++++++ repackage-nomd5.diff ++++++
Don't complain about a bad md5 sum for repackaged rpms.
--- ./lib/psm.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./lib/psm.c 2011-05-11 16:32:11.000000000 +0000
@@ -811,6 +811,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
case PSM_PROCESS:
if (psm->goal == PKG_INSTALL) {
FD_t payload = NULL;
+ rpmtransFlags oldtsflags;
if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break;
@@ -828,6 +829,9 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
break;
}
+ oldtsflags = rpmtsFlags(ts);
+ if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+ (void) rpmtsSetFlags(ts, oldtsflags | RPMTRANS_FLAG_NOMD5);
rc = fsmSetup(rpmfiFSM(fi), FSM_PKGINSTALL, ts, psm->te, fi,
payload, NULL, &psm->failedFile);
(void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_UNCOMPRESS),
@@ -835,6 +839,8 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
(void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST),
fdOp(payload, FDSTAT_DIGEST));
xx = fsmTeardown(rpmfiFSM(fi));
+ if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+ (void) rpmtsSetFlags(ts, oldtsflags);
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
xx = Fclose(payload);
++++++ requires-ge-macro.diff ++++++
--- ./macros.in.orig 2011-05-11 15:36:05.000000000 +0000
+++ ./macros.in 2011-05-11 15:38:44.000000000 +0000
@@ -1027,7 +1027,8 @@ done \
# %{perl_sitearch}/Image
# %dir %{perl_sitearch}/auto/Image
#
-%requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
+%requires_eq() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
+%requires_ge() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
++++++ rpm-beecrypt.diff ++++++
++++ 1725 lines (skipped)
++++++ rpm-gst-provides.patch ++++++
Index: ./autodeps/linux.prov
===================================================================
--- ./autodeps/linux.prov
+++ ./autodeps/linux.prov
@@ -102,4 +102,9 @@ fi
[ -x /usr/lib/rpm/find-provides.ksyms ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
+#
+# --- GStreamer provides, codecs
+[ -x /usr/lib/rpm/gstreamer-provides ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u
+
exit 0
++++++ rpm-shorten-changelog.diff ++++++
--- ./build/pack.c.orig 2011-02-15 13:03:56.000000000 +0000
+++ ./build/pack.c 2011-05-11 15:35:07.000000000 +0000
@@ -671,6 +671,63 @@ static rpmRC checkPackages(char *pkgchec
return RPMRC_OK;
}
+static void trimChangelog(Header h)
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
+ int * times;
+ char ** names = 0, ** texts = 0;
+ int i, keep, count = 0;
+
+ if (!oneshot) {
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
+ oneshot = 1;
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ maxnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ cuttime = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ minnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ }
+ }
+ if (!cuttime && !minnum && !maxnum) {
+ return;
+ }
+ if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count))
+ return;
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ return;
+ }
+ keep = count;
+ if (maxnum && keep > maxnum)
+ keep = maxnum;
+ if (cuttime) {
+ for (i = 0; i < keep; i++) {
+ if (i >= minnum && times[i] < cuttime)
+ break;
+ }
+ keep = i;
+ }
+ if (keep >= count)
+ return;
+ headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count);
+ headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, keep);
+ free(names);
+ free(texts);
+}
+
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
struct cpioSourceArchive_s csabuf;
@@ -680,6 +737,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
Package pkg;
char *pkglist = NULL;
+ trimChangelog(spec->packages->header);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *fn;
--- ./build/parseChangelog.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./build/parseChangelog.c 2011-05-11 15:33:22.000000000 +0000
@@ -168,6 +168,11 @@ static rpmRC addChangelog(Header h, ARGV
return RPMRC_FAIL;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;
++++++ rpm-suse_macros ++++++
# need to keep this around for a while
%suse_check %{nil}
# directories
%_infodir %{_prefix}/share/info
%_mandir %{_prefix}/share/man
%_sysconfdir /etc
%_localstatedir /var
%_defaultdocdir %{_usr}/share/doc/packages
# package build macros
%make_install make install DESTDIR=%{?buildroot}
%makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install
%rb_arch %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/")
%rb_ver %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")')
%insserv_prereq insserv sed
%fillup_prereq fillup coreutils grep diffutils
%suseconfig_fonts_prereq perl aaa_base
%install_info_prereq info
# _suse_os_install_post is defined in brp-checks-suse
%__os_install_post %{?_suse_os_install_post}%{!?_suse_os_install_post: \
/usr/lib/rpm/brp-compress \
/usr/lib/rpm/brp-symlink \
%{nil}}
# macro: %restart_on_update()
# Used to restart a service in postun section, if we are
# not running from YaST2 in instsys on update.
%restart_on_update() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if test "$FIRST_ARG" -ge 1 ; then \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \
for service in %{?*} ; do \
/etc/init.d/$service try-restart > /dev/null || : \
done \
fi \
fi \
%nil
# macro: %stop_on_removal()
# Used to stop a service in preun section, if we are
# not running from YaST2 in instsys on removal of this package.
%stop_on_removal() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if test "$FIRST_ARG" = "0" ; then \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \
for service in %{?*} ; do \
/etc/init.d/$service stop > /dev/null \
done \
fi \
fi \
%nil
# macro: %configure_kernel_source
#
#
%configure_kernel_source() \
if test -d /usr/src/linux ; then \
pushd /usr/src/linux \
test -f .config || cp arch/%_arch/defconfig.default .config \
yes "" | make oldconfig \
make dep \
popd \
fi \
%nil
%is_plus %(if test -f /.buildenv ; then source /.buildenv ; if [[ "$BUILD_BASENAME" == *+kde ]] ; then echo 1 ; else echo 0 ; fi ; else echo 0 ; fi)
# deprecated, use %set_permissions instead
%run_permissions() \
if test "$YAST_IS_RUNNING" != "instsys" ; then \
if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.permissions ; then \
/sbin/SuSEconfig --module permissions \
fi \
fi \
%nil
%run_suseconfig(m:) \
%{!-m:echo -e "\\nERROR: missing parameter for macro run_suseconfig\\n" ; exit 1 ; } \
if test "$YAST_IS_RUNNING" != "instsys" ; then \
if test -x /sbin/SuSEconfig -a -f /sbin/conf.d/SuSEconfig.%{-m*} ; then \
/sbin/SuSEconfig --module %{-m*} \
else \
echo -e "\\nWARNING: SuSEconfig or requested SuSEconfig module not present!\\n" ; \
fi \
fi \
%nil
# macro: run_suseconfig_fonts
# call SuSEconfig modules necessary for font setup
# options:
# -c (the fonts are CJK fonts, also do setup which is only needed
# for CJK)
%run_suseconfig_fonts(c) \
if test -z "$YAST_IS_RUNNING" ; then \
if test -x /sbin/conf.d/SuSEconfig.fonts ; then \
%run_suseconfig -m fonts \
fi \
%{-c:if test -x /sbin/conf.d/SuSEconfig.ghostscript-cjk ; then \
%run_suseconfig -m ghostscript-cjk \
fi} \
fi \
%nil
%set_permissions(f:) \
if [ -x /usr/bin/chkstat ]; then \
/usr/bin/chkstat -n --set --system %{**} \
fi \
%nil
%verify_permissions(e:f:) \
/usr/bin/chkstat -n --warn --system %{**} 1>&2 \
%nil
# %{suse_update_config [-fcl] [dirs...]}
# -f: force, ignore timestamp
# -c: no config.guess,config.sub
# -l: no ltconfig,ltmain.sh
%suse_update_config(fcl) \
AUTOMAKE_DIR=/usr/share/automake \
[ -d $AUTOMAKE_DIR ] || AUTOMAKE_DIR=/usr/share/automake* \
%{!-c:\
[ -d $AUTOMAKE_DIR ] || { \
echo 'Please, install automake.' \
exit 1 \
} \
} \
for d in . %{?*}; do \
%{!-c:\
for f in config.sub config.guess; do \
if test -f $d/$f -a ! $d/$f -ef $AUTOMAKE_DIR/$f ; then \
%{!-f:[ $d/$f -nt $AUTOMAKE_DIR/$f ] ||} cp -f $AUTOMAKE_DIR/$f $d/$f \
fi \
if test -d $d -a ! -f $d/depcomp -a -f $AUTOMAKE_DIR/depcomp ; then \
cp -f $AUTOMAKE_DIR/depcomp $d/depcomp \
echo "please add depcomp to sources for new automake!" \
fi \
if test -f $d/missing -a ! $d/missing -ef $AUTOMAKE_DIR/missing ; then \
cp -f $AUTOMAKE_DIR/missing $d/missing \
fi \
done \
} \
%{!-l:\
for f in ltconfig ltmain.sh; do \
if test -f $d/$f; then \
sed 's/linux-gnu\\([^*][^*]*\\)\\*/linux*\\1*/g; s/linux-gnu/linux/g; s,/lib\\\>,/%_lib,g; s,/%_lib\\([\$-]\\),/lib\\1,g' $d/$f > $d/$f-$$ && \
mv -f $d/$f-$$ $d/$f \
chmod +x $d/$f \
fi \
done \
} \
done \
%suse_update_libdir() \
if [ %_lib != lib ]; then \
for file in %{?*} ; do \
[ ! -e $file ] && echo "Error: $file does not exist!" && exit -1 \
[ -e $file.nolib64 ] && echo "Error: $file.nolib64 already exists!" && exit -1 \
cp $file $file.nolib64 \
echo "patching $file" \
sed -e "s,/lib\\\>,/%_lib,g" $file.nolib64 | sed -e "s,/%_lib/cpp,/lib/cpp,; s,/usr/%_lib/perl,/usr/lib/perl, ; s,/%_lib\\([\$-]\\),/lib\\1,g" > $file \
rm -f $file.nolib64 \
done; \
fi ; \
# macro: fillup_and_insserv
# do the fillup and insserv calls for postinstall
# options:
# -n (use first argument as name for fillup template filenames
# instead of package name)
# -f (skip fillup parts)
# -i (skip insserv parts)
# -y (default start-variable value to yes)
# Used only if X-UnitedLinux-Default-Enabled is not specified
# in the init script
# -Y (force_yes: always activate, discard setting before update)
# arguments:
# [if "-n" first argument as package name]
# Pairs of:
# main script name
# and
# name of (old) START variable (unless -s is given)
#
# template for variables into /etc/sysconfig/package:
# /var/adm/fillup-templates/sysconfig.package
%fillup_and_insserv(finpsyY) \
%{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \
%{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
%{-Y:FORCE_YES=1}%{!-Y:FORCE_YES=0} \
set -- %{?*} \
%{-n:PNAME=$1 ; shift }%{!-n:PNAME=%{name}} \
INSSRV_ARRAY="" \
while [ ${#*} -gt 0 ] ; do \
SCRIPTNAME=$1 \
shift \
SV_B='^### BEGIN INIT INFO' \
SV_E='^### END INIT INFO' \
SV_KW=Default-Enabled \
SV_VALUE=`sed -n -e "/$SV_B/,/$SV_E/{/^# [^[:space:]]*$SV_KW:[[:space:]]*\\([^[:space:]]*\\).*/s//\\1/p;}" < /etc/init.d/$SCRIPTNAME` \
test "$FORCE_YES" = "1" && SV_VALUE="yes" \
test -n "$SV_VALUE" || SV_VALUE=%{-y:"yes"}%{!-y:"no"} \
INSSRV_ARRAY="$INSSRV_ARRAY $SCRIPTNAME $SV_VALUE" \
done \
%{!-f: %{do_real_fillup}} \
%{!-i: %{add_start_if_needed $INSSRV_ARRAY } } \
%nil
# do_real_fillup: internal macro
# this part really calls fillup for the appropriate files
#
%do_real_fillup() \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \
SD_NAME="" \
%{sysc_fillup}
# add_start_if_needed: internally used by fillup_and_insserv
%add_start_if_needed() \
set -- %{?*} \
while [ ${#*} -gt 0 ] ; do \
SCRIPTNAME=$1 \
SV_VALUE=$2 \
shift 2 \
test -n "$SCRIPTNAME" -a -n "$SV_VALUE" || { echo "SCRIPTNAME or SV_VALUE unknown"; exit 1;} \
if test "$FIRST_ARG" = "1" -a "$SV_VALUE" = "no" ; then \
/sbin/insserv ${YAST_IS_RUNNING:+-f} -r /etc/init.d/$SCRIPTNAME \
elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \
/sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \
fi \
done
# macro: insserv_cleanup
%insserv_cleanup() \
/sbin/insserv /etc/init.d
# macro: fillup_only
# do the fillup for sysconfig files
# template naming convention:
# .../fillup-templates/sysconfig.$NAME1[-$NAME2]
# NAME1: the name of the sysconfig-file
# NAME2: if needed (if more packages fill the
# same sysconfig file) the package name
# options:
# -n set sysconfig name manually
# -a use package name as $NAME2
# -s use second arg as package-name
# -d use a subdirectory of sysconfig
# (last arg as directory name)
%fillup_only(dans) \
%{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \
%{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \
SD_NAME="" \
%{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \
%{sysc_fillup} \
%nil
# internal only: sysc_fillup
%sysc_fillup() \
if [ -x /bin/fillup ] ; then \
if [ -f $SYSC_TEMPLATE ] ; then \
echo "Updating /etc/sysconfig/$SD_NAME$PNAME..." \
mkdir -p /etc/sysconfig/$SD_NAME \
touch /etc/sysconfig/$SD_NAME$PNAME \
/bin/fillup -q /etc/sysconfig/$SD_NAME$PNAME $SYSC_TEMPLATE \
fi \
else \
echo "ERROR: fillup not found. This should not happen. Please compare" \
echo "/etc/sysconfig/$PNAME and $TEMPLATE_DIR/sysconfig.$PNAME and" \
echo "update by hand." \
fi
# macro: rename_sysconfig_variable
# as the name says, rename a variable in the file given with -f
%rename_sysconfig_variable(f:) \
%{!-f:echo "missing argument for rename_sysconfig_variable"; exit 1; }%{-f:FILE=%{-f*}} \
if [ -f $FILE ] ; then \
sed -i -e "s/^%{1}=/%{2}=/" $FILE \
fi
# macro: remove_and_set
# remove variables from sysconfig.$NAME
# (both if existant) and set them in the environment
# for further handling in postinstall
# options: -n set package name
# -y default to yes if not found (otherwise no)
%remove_and_set(n:y) \
%{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \
DEF_VAL=%{-y:"yes"}%{!-y:"no"} \
DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \
rm -f $DEL_TEMPL \
for var in %{?*} ; do \
echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \
done \
if [ -f /etc/sysconfig/$PNAME ] ; then \
/bin/fillup -q -t -r -i -d "=" /etc/sysconfig/$PNAME $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ \
test -f /etc/sysconfig/$PNAME.new && mv /etc/sysconfig/$PNAME.new /etc/sysconfig/$PNAME \
fi \
for i in $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ ; do \
if [ -f $i ] ; then \
. $i \
rm -f $i \
fi \
done
%insserv_force_if_yast() \
/sbin/insserv ${YAST_IS_RUNNING:+-f} %{?*}
%run_ldconfig /sbin/ldconfig
%install_info(:-:) \
ALL_ARGS=(%{**}) \
NUM_ARGS=${#ALL_ARGS[@]} \
if test -x /sbin/install-info ; then \
if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
/sbin/install-info "${ALL_ARGS[@]}" \
fi \
fi ;
%install_info_delete(:-:) \
ALL_ARGS=(%{**}) \
NUM_ARGS=${#ALL_ARGS[@]} \
if test -x /sbin/install-info ; then \
if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
/sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
fi ; \
fi ;
# find-supplements.ksyms parses this macro directly out of the spec file:
%supplements_kernel_module() \
%{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}
%suse_version 1210
%sles_version 0
%ul_version 0
%do_profiling 1
%cflags_profile_generate -fprofile-generate
%cflags_profile_feedback -fprofile-use
%suse_install_update_message() \
install -D -m 644 %1 %buildroot/var/adm/update-messages/%{name}-%{version}-%{release}-%(basename %1).txt \
%nil
%suse_install_update_script() \
install -D -m 755 %1 %buildroot/var/adm/update-scripts/%{name}-%{version}-%{release}-%(basename %1).txt \
%nil
# Template for lang sub-package.
%lang_package(n:) \
%package %{-n:-n %{-n*}-}lang \
Summary: Languages for package %{name} \
Group: System/Localization \
Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
Supplements: packageand(bundle-lang-other:%{-n:%{-n*}}%{!-n:%{name}}) \
BuildArch: noarch \
%description %{-n:-n %{-n*}-}lang \
Provides translations to the package %{name}
++++++ rpmconfigcheck ++++++
#! /bin/bash
# Copyright (c) 2002 SuSE GmbH Nuernberg, Germany.
#
# Author: Michael Schroeder
#
# /etc/init.d/rpmconfigcheck
# /usr/sbin/rcrpmconfigcheck
#
# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
#
### BEGIN INIT INFO
# Provides: rpmconfigcheck
# Required-Start: $remote_fs
# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Description: rpm config file scan
### END INIT INFO
. /etc/rc.status
# First reset status of this service
rc_reset
configcheckfile=/var/adm/rpmconfigcheck
packages=/var/lib/rpm/Packages
test -z "$1" && set start
case "$1" in
start|restart|try-restart|reload|force-reload)
if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
echo -n "Searching for unresolved configuration files"
if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
rpm -qalc | sort | perl -lne '-e "$_.rpmnew" and print "$_.rpmnew"; -e "$_.rpmorig" and print "$_.rpmorig"; -e "$_.rpmsave" and print "$_.rpmsave"' > $configcheckfile
else
mv -f $configcheckfile $configcheckfile.old
while read l; do
test -e $l && echo $l
done < $configcheckfile.old > $configcheckfile
true
fi
rc_status -v
if test -s $configcheckfile; then
echo "Please check the following files (see /var/adm/rpmconfigcheck):"
sed -e 's/^/ /' < $configcheckfile
touch $configcheckfile.old
cat $configcheckfile $configcheckfile.old | sort | uniq -d > $configcheckfile.dup
cat $configcheckfile $configcheckfile.dup | sort | uniq -u > $configcheckfile.new
if test -s $configcheckfile.new ; then
(
echo "----------------------------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "rpmconfigcheck"
date
echo "----------------------------------------"
echo "This is a warning message."
echo "rpmconfigcheck has found the following new unresolved config files"
echo "(all files are listed in /var/adm/rpmconfigcheck):"
cat $configcheckfile.new
echo "----------------------------------------"
) >> /var/log/update-messages
fi
fi
rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
fi
;;
stop)
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac
rc_exit
++++++ rpmpopt.diff ++++++
--- ./rpmpopt.in.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./rpmpopt.in 2011-05-11 15:02:34.000000000 +0000
@@ -101,7 +101,8 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
%|URL?{URL : %{URL}\n}|\
%|BUGURL?{Bug URL : %{BUGURL}\n}|\
Summary : %{SUMMARY}\n\
-Description :\n%{DESCRIPTION}\n' \
+Description :\n%{DESCRIPTION}\n\
+Distribution: %{DISTRIBUTION}\n' \
--POPTdesc=$"list descriptive information from package(s)"
rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \
++++++ rpmqpack.diff ++++++
Provide rpmqpack, a fast way to list all installed packages are
check if some package is installed. This is a hack.
--- ./Makefile.am.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:15:27.000000000 +0000
@@ -170,6 +170,10 @@ rpmgraph_LDADD = lib/librpm.la rpmio/lib
dist_bin_SCRIPTS = scripts/gendiff
+bin_PROGRAMS += rpmqpack
+rpmqpack_SOURCES = rpmqpack.c
+rpmqpack_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- ./doc/Makefile.am.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/Makefile.am 2011-05-11 15:16:24.000000000 +0000
@@ -8,7 +8,7 @@ EXTRA_DIST += $(man_man1_DATA)
man_man8dir = $(mandir)/man8
man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8
-man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
+man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmqpack.8
EXTRA_DIST += $(man_man8_DATA)
man_fr_man8dir = $(mandir)/fr/man8
--- ./doc/rpmqpack.8.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./doc/rpmqpack.8 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,25 @@
+.TH RPMQPACK 8 "Mar 2002"
+.SH NAME
+rpmqpack \- check for installed rpm packages
+
+.SH SYNOPSIS
+.B rpmqpack
+.RI [ pack1 "] [" pack2 ]...
+
+.SH DESCRIPTION
+rpmqpack checks if packages given as arguments are installed in
+the system. It prints each installed package to stdout.
+If no arguments are given all installed packages are printed.
+
+.SH EXIT STATUS
+rpmqpack returns 0 if all given packages are installed, otherwise
+1.
+
+.SH SEE ALSO
+.BR rpm (1)
+
+.SH COPYRIGHT
+2002 SuSE Linux AG Nuernberg, Germany.
+
+.SH AUTHOR
+Michael Schroeder
--- ./rpmqpack.c.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./rpmqpack.c 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,59 @@
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+DBT key;
+DBT data;
+
+int
+main(int argc, char **argv)
+{
+ DB *db = 0;
+ DBC *dbc = 0;
+ int ret = 0;
+
+ if (db_create(&db, 0, 0))
+ {
+ perror("db_create");
+ exit(1);
+ }
+ if (db->open(db, 0, "/var/lib/rpm/Name", 0, DB_UNKNOWN, DB_RDONLY, 0664))
+ {
+ perror("db->open");
+ exit(1);
+ }
+ if (argc == 1)
+ {
+ if (db->cursor(db, NULL, &dbc, 0))
+ {
+ perror("db->cursor");
+ exit(1);
+ }
+ while (dbc->c_get(dbc, &key, &data, DB_NEXT) == 0)
+ printf("%*.*s\n", (int)key.size, (int)key.size, (char *)key.data);
+ dbc->c_close(dbc);
+ }
+ else
+ {
+ argc--;
+ while (argc--)
+ {
+ argv++;
+ key.data = (void *)*argv;
+ key.size = strlen(*argv);
+ data.data = NULL;
+ data.size = 0;
+ if (db->get(db, 0, &key, &data, 0) == 0)
+ printf("%s\n", *argv);
+ else
+ ret = 1;
+ }
+ }
+ db->close(db, 0);
+ return ret;
+}
++++++ rpmrc.diff ++++++
--- rpmrc.in.orig 2011-09-30 08:38:11.410453344 +0200
+++ rpmrc.in 2011-09-30 14:10:00.149253193 +0200
@@ -12,16 +12,16 @@
# "fat" binary with both archs, for Darwin
optflags: fat -O2 -g -arch i386 -arch ppc
-optflags: i386 -O2 -g -march=i386 -mtune=i686
-optflags: i486 -O2 -g -march=i486
-optflags: i586 -O2 -g -march=i586
-optflags: i686 -O2 -g -march=i686
-optflags: pentium3 -O2 -g -march=pentium3
-optflags: pentium4 -O2 -g -march=pentium4
-optflags: athlon -O2 -g -march=athlon
+optflags: i386 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i486 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i686 -O2 -g -m32 -march=i686 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: pentium3 -O2 -g -m32 -march=pentium3
+optflags: pentium4 -O2 -g -m32 -march=pentium4
+optflags: athlon -O2 -g -m32 -march=athlon
optflags: geode -Os -g -m32 -march=geode
-optflags: ia64 -O2 -g
-optflags: x86_64 -O2 -g
+optflags: ia64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: amd64 -O2 -g
optflags: ia32e -O2 -g
@@ -41,15 +41,16 @@
optflags: m68k -O2 -g -fomit-frame-pointer
-optflags: ppc -O2 -g -fsigned-char
-optflags: ppc8260 -O2 -g -fsigned-char
-optflags: ppc8560 -O2 -g -fsigned-char
-optflags: ppc32dy4 -O2 -g -fsigned-char
-optflags: ppciseries -O2 -g -fsigned-char
-optflags: ppcpseries -O2 -g -fsigned-char
-optflags: ppc64 -O2 -g -fsigned-char
+optflags: ppc -O2 -g -m32 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc8260 -O2 -g -m32
+optflags: ppc8560 -O2 -g -m32
+optflags: ppc32dy4 -O2 -g -m32
+optflags: ppciseries -O2 -g -m32
+optflags: ppcpseries -O2 -g -m32
+optflags: ppc64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: parisc -O2 -g -mpa-risc-1-0
+optflags: hppa -O2 -g -mpa-risc-1-0
optflags: hppa1.0 -O2 -g -mpa-risc-1-0
optflags: hppa1.1 -O2 -g -mpa-risc-1-0
optflags: hppa1.2 -O2 -g -mpa-risc-1-0
@@ -66,6 +67,7 @@
optflags: armv5tejl -O2 -g -march=armv5te
optflags: armv6l -O2 -g -march=armv6
optflags: armv7l -O2 -g -march=armv7
+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux
optflags: atarist -O2 -g -fomit-frame-pointer
optflags: atariste -O2 -g -fomit-frame-pointer
@@ -75,8 +77,8 @@
optflags: milan -O2 -g -fomit-frame-pointer
optflags: hades -O2 -g -fomit-frame-pointer
-optflags: s390 -O2 -g
-optflags: s390x -O2 -g
+optflags: s390 -O2 -g -m31 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: s390x -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: sh3 -O2 -g
optflags: sh4 -O2 -g -mieee
@@ -140,6 +142,7 @@
arch_canon: armv5tejl: armv5tejl 12
arch_canon: armv6l: armv6l 12
arch_canon: armv7l: armv7l 12
+arch_canon: armv7hl: armv7hl 12
arch_canon: m68kmint: m68kmint 13
arch_canon: atarist: m68kmint 13
@@ -200,17 +203,17 @@
#############################################################
# For a given uname().machine, the default build arch
-buildarchtranslate: osfmach3_i686: i386
-buildarchtranslate: osfmach3_i586: i386
+buildarchtranslate: osfmach3_i686: i586
+buildarchtranslate: osfmach3_i586: i586
buildarchtranslate: osfmach3_i486: i386
buildarchtranslate: osfmach3_i386: i386
-buildarchtranslate: athlon: i386
-buildarchtranslate: geode: i386
-buildarchtranslate: pentium4: i386
-buildarchtranslate: pentium3: i386
-buildarchtranslate: i686: i386
-buildarchtranslate: i586: i386
+buildarchtranslate: athlon: i586
+buildarchtranslate: geode: i586
+buildarchtranslate: pentium4: i586
+buildarchtranslate: pentium3: i586
+buildarchtranslate: i686: i586
+buildarchtranslate: i586: i586
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386
@@ -239,6 +242,7 @@
buildarchtranslate: ppcpseries: ppc
buildarchtranslate: ppc64iseries: ppc64
buildarchtranslate: ppc64pseries: ppc64
+buildarchtranslate: powerpc64: ppc64
buildarchtranslate: armv3l: armv3l
buildarchtranslate: armv4b: armv4b
@@ -248,6 +252,7 @@
buildarchtranslate: armv5tejl: armv5tejl
buildarchtranslate: armv6l: armv6l
buildarchtranslate: armv7l: armv7l
+buildarchtranslate: armv7hl: armv7hl
buildarchtranslate: atarist: m68kmint
buildarchtranslate: atariste: m68kmint
@@ -270,6 +275,15 @@
buildarchtranslate: sh4: sh4
buildarchtranslate: sh4a: sh4
+buildarchtranslate: parisc: hppa
+buildarchtranslate: hppa2.0: hppa
+buildarchtranslate: hppa64: hppa
+
+buildarchtranslate: armv5l: armv4l
+buildarchtranslate: armv5tel: armv4l
+buildarchtranslate: armv5b: armv4b
+buildarchtranslate: armv5teb: armv4b
+
#############################################################
# Architecture compatibility
@@ -325,14 +339,19 @@
arch_compat: hppa2.0: hppa1.2
arch_compat: hppa1.2: hppa1.1
arch_compat: hppa1.1: hppa1.0
-arch_compat: hppa1.0: parisc
+arch_compat: hppa1.0: hppa
+arch_compat: hppa: parisc
arch_compat: parisc: noarch
+arch_compat: armv5teb: armv5b
+arch_compat: armv5b: armv4b
arch_compat: armv4b: noarch
+arch_compat: armv7hl: armv7l
arch_compat: armv7l: armv6l
arch_compat: armv6l: armv5tejl
arch_compat: armv5tejl: armv5tel
-arch_compat: armv5tel: armv4tl
+arch_compat: armv5tel: armv5l
+arch_compat: armv5l: armv4tl
arch_compat: armv4tl: armv4l
arch_compat: armv4l: armv3l
arch_compat: armv3l: noarch
@@ -349,9 +368,9 @@
arch_compat: s390: noarch
arch_compat: s390x: s390 noarch
-arch_compat: ia64: noarch
+arch_compat: ia64: i686 noarch
-arch_compat: x86_64: amd64 athlon noarch
+arch_compat: x86_64: amd64 em64t athlon noarch
arch_compat: amd64: x86_64 athlon noarch
arch_compat: ia32e: x86_64 athlon noarch
@@ -433,6 +452,7 @@
buildarch_compat: mipsel: noarch
buildarch_compat: armv4b: noarch
+buildarch_compat: armv7hl: armv7l
buildarch_compat: armv7l: armv6l
buildarch_compat: armv6l: armv5tejl
buildarch_compat: armv5tejl: armv5tel
@@ -444,7 +464,8 @@
buildarch_compat: hppa2.0: hppa1.2
buildarch_compat: hppa1.2: hppa1.1
buildarch_compat: hppa1.1: hppa1.0
-buildarch_compat: hppa1.0: parisc
+buildarch_compat: hppa1.0: hppa
+buildarch_compat: hppa: parisc
buildarch_compat: parisc: noarch
buildarch_compat: atarist: m68kmint noarch
++++++ rpmrctests.diff ++++++
Patch machine detection code: detect transmeta, rename parisc to hppa. [#52713]
--- ./lib/rpmrc.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/rpmrc.c 2011-05-11 12:48:02.000000000 +0000
@@ -1,9 +1,6 @@
#include "system.h"
#include
-#if defined(__linux__) && defined(__powerpc__)
-#include
-#endif
#if HAVE_SYS_UTSNAME_H
#include
@@ -788,6 +785,14 @@ static inline int RPMClass(void)
cpu = (tfms>>8)&15;
+ if (cpu == 5
+ && cpuid_ecx(0)=='68xM'
+ && cpuid_edx(0)=='Teni'
+ && (cpuid_edx(1) & ((1<<8)|(1<<15))) == ((1<<8)|(1<<15))) {
+ sigaction(SIGILL, &oldsa, NULL);
+ return 6; /* has CX8 and CMOV */
+ }
+
sigaction(SIGILL, &oldsa, NULL);
if (cpu < 6)
@@ -924,15 +929,6 @@ static int is_geode()
}
#endif
-#if defined(__linux__) && defined(__powerpc__)
-static jmp_buf mfspr_jmpbuf;
-
-static void mfspr_ill(int notused)
-{
- longjmp(mfspr_jmpbuf, -1);
-}
-#endif
-
/**
*/
static void defaultMachine(const char ** arch,
@@ -1059,6 +1055,11 @@ static void defaultMachine(const char **
/* big endian */
strcpy(un.machine, "mips");
# endif
+ /* in linux, lets rename parisc to hppa */
+#if defined(__linux__)
+ if (!strcmp(un.machine,"parisc"))
+ strcpy(un.machine,"hppa");
+#endif
# if defined(__hpux) && defined(_SC_CPU_VERSION)
{
++++++ rpmsort ++++++
#! /usr/bin/perl -w
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
use Getopt::Long qw(:config gnu_getopt);
sub do_rpm_cmp_versions {
my ($evr1, $evr2) = @_;
sub _rpm_cmp {
my ($s1, $s2) = @_;
return defined $s1 <=> defined $s2
unless defined $s1 && defined $s2;
my ($r, $x1, $x2);
do {
$s1 =~ s/^[^a-zA-Z0-9]+//;
$s2 =~ s/^[^a-zA-Z0-9]+//;
if ($s1 =~ /^\d/ || $s2 =~ /^\d/) {
$s1 =~ s/^(0*(\d*))//; $x1 = $2;
return -1 if $1 eq '';
$s2 =~ s/^(0*(\d*))//; $x2 = $2;
return 1 if $1 eq '';
$r = length $x1 <=> length $x2 || $x1 cmp $x2;
} else {
$s1 =~ s/^([a-zA-Z]*)//; $x1 = $1;
$s2 =~ s/^([a-zA-Z]*)//; $x2 = $1;
return 0
if $x1 eq '' && $x2 eq '';
$r = $x1 cmp $x2;
}
} until $r;
return $r;
}
my ($e1, $v1, $r1) = $evr1 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my ($e2, $v2, $r2) = $evr2 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my $r = _rpm_cmp($e1 || 0, $e2 || 0);
$r = _rpm_cmp($v1, $v2)
unless $r;
$r = _rpm_cmp($r1, $r2)
unless $r;
return $r;
}
my $reorder = sub { return @_ };
my $key = 0;
my $test = 0;
sub rpm_cmp_versions {
my ($evr1, $evr2) = @_;
chomp($evr1, $evr2);
my $res1 = do_rpm_cmp_versions($evr1, $evr2);
if ($test) {
open(my $fd, '-|', 'zypper', '--terse', 'versioncmp',
$evr1, $evr2) or die "zypper: $!\n";
my $res2 = <$fd>;
close($fd) or die "zypper: $!\n";
chomp $res2;
if ($res1 != $res2) {
my @operators = qw(< == >);
my $op1 = $operators[$res1 + 1];
my $op2 = $operators[$res2 + 1];
print STDERR "BUG: $evr1 $op1 $evr2 vs. zypper: $evr1 $op2 $evr2\n";
}
}
return $res1;
}
GetOptions ("r|reverse" => sub { $reorder = sub { return reverse @_ } },
"k|key=i" => \$key,
"test" => \$test)
or do {
print STDERR "Usage $0 [-r, --reverse] [-k N, --key=N] [--test]\n";
exit 1;
};
if ($key == 0) {
# Sort by entire lines
map { print } &$reorder(sort { rpm_cmp_versions($a, $b) } <>);
} else {
# Sort by field $key
my @data = map { [(split)[$key-1], $_] } <>;
map { print } &$reorder(map { $_->[1] }
sort { rpm_cmp_versions($a->[0], $b->[0]) } @data);
}
++++++ safeugid.diff ++++++
Work around glibc/nscd caching problems when doing 'rpm --root'.
--- ./lib/rpmchroot.c.orig 2011-05-12 08:26:10.000000000 +0000
+++ ./lib/rpmchroot.c 2011-05-12 08:28:32.000000000 +0000
@@ -66,6 +66,7 @@ int rpmChrootIn(void)
} else if (rootState.chrootDone == 0) {
if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
rootState.chrootDone = 1;
+ rpmugChroot(1);
} else {
rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
rc = -1;
@@ -91,6 +92,7 @@ int rpmChrootOut(void)
} else if (rootState.chrootDone == 1) {
if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
rootState.chrootDone = 0;
+ rpmugChroot(0);
} else {
rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
rc = -1;
--- ./lib/rpmug.c.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.c 2011-05-12 08:33:28.000000000 +0000
@@ -35,6 +35,47 @@ const char * rpmugStashStr(const char *s
return ret;
}
+#if defined(__GLIBC__)
+
+static int inchroot;
+
+/*
+ * Unfortunatelly glibc caches nss/nscd data and there is no
+ * good way to flush those caches when we did a chroot(). Thus
+ * we need to parse /etc/passwd and /etc/group ourselfs.
+ */
+static int safe_lookup(const char * file, const char * name)
+{
+ FILE *fp;
+ int l;
+ char buf[4096], *p;
+
+ if (!name || !*name)
+ return -1;
+ l = strlen(name);
+ if ((fp = fopen(file, "r")) == 0)
+ return -1;
+ while ((p = fgets(buf, sizeof(buf), fp)) != 0) {
+ if (*p == '#')
+ continue;
+ while (*p && (*p == ' ' || *p == '\t'))
+ p++;
+ if (strncmp(p, name, l) != 0 || p[l] != ':')
+ continue;
+ p = strchr(p + l + 1, ':');
+ if (!p)
+ continue;
+ fclose(fp);
+ p++;
+ while (*p && (*p == ' ' || *p == '\t'))
+ p++;
+ return atoi(p);
+ }
+ fclose(fp);
+ return -1;
+}
+#endif
+
/*
* These really ought to use hash tables. I just made the
* guess that most files would be owned by root or the same person/group
@@ -68,17 +109,28 @@ int rpmugUid(const char * thisUname, uid
lastUnameAlloced = thisUnameLen + 10;
lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
}
- strcpy(lastUname, thisUname);
- pwent = getpwnam(thisUname);
- if (pwent == NULL) {
- /* FIX: shrug */
- endpwent();
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int uid = safe_lookup("/etc/passwd", thisUname);
+ if (uid < 0)
+ return -1;
+ lastUid = uid;
+ } else
+#endif
+ {
pwent = getpwnam(thisUname);
- if (pwent == NULL) return -1;
+ if (pwent == NULL) {
+ /* FIX: shrug */
+ endpwent();
+ pwent = getpwnam(thisUname);
+ if (pwent == NULL) return -1;
+ }
+ lastUid = pwent->pw_uid;
}
- lastUid = pwent->pw_uid;
+ strcpy(lastUname, thisUname);
+ lastUnameLen = thisUnameLen;
}
*uid = lastUid;
@@ -111,18 +163,29 @@ int rpmugGid(const char * thisGname, gid
lastGnameAlloced = thisGnameLen + 10;
lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
}
- strcpy(lastGname, thisGname);
- grent = getgrnam(thisGname);
- if (grent == NULL) {
- /* FIX: shrug */
- endgrent();
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int gid = safe_lookup("/etc/group", thisGname);
+ if (gid < 0)
+ return -1;
+ lastGid = gid;
+ } else
+#endif
+ {
grent = getgrnam(thisGname);
if (grent == NULL) {
- return -1;
+ /* FIX: shrug */
+ endgrent();
+ grent = getgrnam(thisGname);
+ if (grent == NULL) {
+ return -1;
+ }
}
+ lastGid = grent->gr_gid;
}
- lastGid = grent->gr_gid;
+ strcpy(lastGname, thisGname);
+ lastGnameLen = thisGnameLen;
}
*gid = lastGid;
@@ -134,7 +197,7 @@ const char * rpmugUname(uid_t uid)
{
static uid_t lastUid = (uid_t) -1;
static char * lastUname = NULL;
- static size_t lastUnameLen = 0;
+ static size_t lastUnameAlloced = 0;
if (uid == (uid_t) -1) {
lastUid = (uid_t) -1;
@@ -151,9 +214,9 @@ const char * rpmugUname(uid_t uid)
lastUid = uid;
len = strlen(pwent->pw_name);
- if (lastUnameLen < len + 1) {
- lastUnameLen = len + 20;
- lastUname = xrealloc(lastUname, lastUnameLen);
+ if (lastUnameAlloced < len + 1) {
+ lastUnameAlloced = len + 20;
+ lastUname = xrealloc(lastUname, lastUnameAlloced);
}
strcpy(lastUname, pwent->pw_name);
@@ -165,7 +228,7 @@ const char * rpmugGname(gid_t gid)
{
static gid_t lastGid = (gid_t) -1;
static char * lastGname = NULL;
- static size_t lastGnameLen = 0;
+ static size_t lastGnameAlloced = 0;
if (gid == (gid_t) -1) {
lastGid = (gid_t) -1;
@@ -182,9 +245,9 @@ const char * rpmugGname(gid_t gid)
lastGid = gid;
len = strlen(grent->gr_name);
- if (lastGnameLen < len + 1) {
- lastGnameLen = len + 20;
- lastGname = xrealloc(lastGname, lastGnameLen);
+ if (lastGnameAlloced < len + 1) {
+ lastGnameAlloced = len + 20;
+ lastGname = xrealloc(lastGname, lastGnameAlloced);
}
strcpy(lastGname, grent->gr_name);
@@ -200,3 +263,16 @@ void rpmugFree(void)
rpmugGname(-1);
strStash = strCacheFree(strStash);
}
+
+void rpmugChroot(int in)
+{
+ /* tell libc to drop caches / file descriptors */
+ endpwent();
+ endgrent();
+ /* drop our own caches */
+ rpmugUid(NULL, NULL);
+ rpmugGid(NULL, NULL);
+#if defined(__GLIBC__)
+ inchroot = in;
+#endif
+}
--- ./lib/rpmug.h.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.h 2011-05-12 08:26:56.000000000 +0000
@@ -15,4 +15,6 @@ const char * rpmugGname(gid_t gid);
void rpmugFree(void);
+void rpmugChroot(int in);
+
#endif /* _RPMUG_H */
++++++ specfilemacro.diff ++++++
--- ./build/parseSpec.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./build/parseSpec.c 2011-05-11 15:58:37.000000000 +0000
@@ -519,6 +519,7 @@ static rpmSpec parseSpec(const char *spe
spec = newSpec();
spec->specFile = rpmGetPath(specFile, NULL);
+ addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC);
spec->fileStack = newOpenFileInfo();
spec->fileStack->fileName = xstrdup(spec->specFile);
/* If buildRoot not specified, use default %{buildroot} */
++++++ suspendlock.diff ++++++
Suspend exclusive database lock when scriptlets get called, allowing
read access in scriptlets. Only needed for DB_PRIVATE (aka global)
locking.
--- ./lib/backend/db3.c.orig 2011-05-12 10:24:20.000000000 +0000
+++ ./lib/backend/db3.c 2011-05-12 10:26:14.000000000 +0000
@@ -640,3 +640,59 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
return rc;
}
+
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
+ int fdno = -1;
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_RDLCK;
+ rc = fcntl(fdno, F_SETLK, (void *)&l);
+ if (rc)
+ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n"));
+ return rc;
+}
+
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
+ int tries;
+ int fdno = -1;
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ for (tries = 0; tries < 2; tries++) {
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_WRLCK;
+ rc = fcntl(fdno, tries ? F_SETLKW : F_SETLK, (void *)&l);
+ if (!rc)
+ break;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n"));
+ }
+ return rc;
+}
+
--- ./lib/backend/dbi.h.orig 2010-12-21 09:48:21.000000000 +0000
+++ ./lib/backend/dbi.h 2011-05-12 10:24:57.000000000 +0000
@@ -263,6 +263,24 @@ int dbiFlags(dbiIndex dbi);
RPM_GNUC_INTERNAL
const char * dbiName(dbiIndex dbi);
+/** \ingroup dbi
+ * Suspend the exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags);
+
+/** \ingroup dbi
+ * Reacquire an exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags);
+
#ifdef __cplusplus
}
#endif
--- ./lib/psm.c.orig 2011-05-12 10:23:47.000000000 +0000
+++ ./lib/psm.c 2011-05-12 10:24:57.000000000 +0000
@@ -412,10 +412,12 @@ static rpmRC runScript(rpmpsm psm, ARGV_
script->tag != RPMTAG_VERIFYSCRIPT);
int selinux = !(rpmtsFlags(psm->ts) & RPMTRANS_FLAG_NOCONTEXTS);
+ rpmtsSuspendResumeDBLock(psm->ts, 0);
rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
rc = rpmScriptRun(script, arg1, arg2, rpmtsScriptFd(psm->ts),
prefixes, warn_only, selinux);
rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+ rpmtsSuspendResumeDBLock(psm->ts, 1);
/*
* Notify callback for all errors. "total" abused for warning/error,
--- ./lib/rpmdb.c.orig 2011-05-12 10:23:47.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-12 10:24:57.000000000 +0000
@@ -674,6 +674,12 @@ int rpmdbSync(rpmdb db)
return dbiForeach(db->_dbi, dbiSync, 0);
}
+int rpmdbSuspendResumeDBLock(rpmdb db, int mode)
+{
+ if (db == NULL) return 0;
+ return dbiForeach(db->_dbi, mode ? dbiResumeDBLock : dbiSuspendDBLock, 0);
+}
+
static rpmdb newRpmdb(const char * root, const char * home,
int mode, int perms, int flags)
{
--- ./lib/rpmts.c.orig 2010-12-22 11:17:20.000000000 +0000
+++ ./lib/rpmts.c 2011-05-12 10:24:57.000000000 +0000
@@ -95,6 +95,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
return rc;
}
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode)
+{
+ return rpmdbSuspendResumeDBLock(ts->rdb, mode);
+}
+
int rpmtsInitDB(rpmts ts, int dbmode)
{
rpmlock lock = rpmtsAcquireLock(ts);
--- ./lib/rpmts.h.orig 2010-12-21 09:50:50.000000000 +0000
+++ ./lib/rpmts.h 2011-05-12 10:24:57.000000000 +0000
@@ -423,6 +423,8 @@ rpmdb rpmtsGetRdb(rpmts ts);
void * rpmtsNotify(rpmts ts, rpmte te,
rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode);
+
/** \ingroup rpmts
* Return number of (ordered) transaction set elements.
* @param ts transaction set
++++++ symset-table ++++++
#! /bin/sh
# Create a table of all symbol sets defined in all /boot/symsets*.tar.gz
# files.
#
# Format:
# kernelrelease/modver/symbol <tab> symset <tab> symset_hash
#
# This table is needed for computing the appropriate Requires: tags for
# kernel module packages.
tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX)
trap "cd / ; rm -rf $tmpdir" EXIT
cd $tmpdir
shopt -s nullglob
for symsets in /boot/symsets-*.tar.gz; do
zcat $symsets \
| tar xf -
done
for symsets in *; do
krel=${symsets#symsets-}
for symset in $symsets/*; do
class=${symset##*/} ; class=${class%.*}
hash=${symset##*.}
awk '
BEGIN { FS = "\t" ; OFS = "\t" }
{ sub(/0x0*/, "", $1)
print krel "/" $1 "/" $2, class, hash }
' krel="$krel" class="$class" hash="$hash" $symset
done
done
# vim:shiftwidth=4 softtabstop=4
++++++ sysconfig.services-rpm ++++++
## Path: System/Services
## Type: yesno
## Default: no
#
# Do you want to disable the automatic restart of services when
# a new version gets installed?
#
DISABLE_RESTART_ON_UPDATE="no"
## Type: yesno
## Default: no
#
# Do you want to disable the automatic shutdown of services when
# the corresponding package gets erased?
#
DISABLE_STOP_ON_REMOVAL="no"
++++++ taggedfileindex.diff ++++++
This used to be the taggedfileindex patch, but it's gone.
The remaining part just strips off the tag.
--- ./lib/rpmdb.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-11 15:14:39.000000000 +0000
@@ -257,6 +257,9 @@ static int dbt2set(dbiIndex dbi, DBT * d
_DBSWAP(hdrNum);
_DBSWAP(tagNum);
}
+ /* remove tagged directory info */
+ if (tagNum.ui & 0x80000000)
+ tagNum.ui &= 0x0000ffff;
set->recs[i].hdrNum = hdrNum.ui;
set->recs[i].tagNum = tagNum.ui;
}
++++++ waitlock.diff ++++++
Fix global (DB_PRIVATE) lock code: fix recursion counter, retry
failed lock operations for up to 3 minutes.
--- ./lib/backend/db3.c.orig 2011-03-02 06:40:10.000000000 +0000
+++ ./lib/backend/db3.c 2011-05-12 10:24:20.000000000 +0000
@@ -432,6 +432,8 @@ int dbiVerify(dbiIndex dbi, unsigned int
return rc;
}
+static int _lockdbfd = 0;
+
int dbiClose(dbiIndex dbi, unsigned int flags)
{
rpmdb rdb = dbi->dbi_rpmdb;
@@ -451,6 +453,8 @@ int dbiClose(dbiIndex dbi, unsigned int
rpmlog(RPMLOG_DEBUG, "closed db index %s/%s\n",
dbhome, dbi->dbi_file);
+ if (dbi->dbi_lockdbfd && _lockdbfd)
+ _lockdbfd--;
}
xx = db_fini(rdb, dbhome ? dbhome : "");
@@ -490,6 +494,7 @@ static int dbiFlock(dbiIndex dbi, int mo
rc = 1;
} else {
const char *dbhome = rpmdbHome(dbi->dbi_rpmdb);
+ int tries;
struct flock l;
memset(&l, 0, sizeof(l));
l.l_whence = 0;
@@ -499,20 +504,38 @@ static int dbiFlock(dbiIndex dbi, int mo
? F_RDLCK : F_WRLCK;
l.l_pid = 0;
- rc = fcntl(fdno, F_SETLK, (void *) &l);
- if (rc) {
- uint32_t eflags = db_envflags(db);
- /* Warning iff using non-private CDB locking. */
- rc = (((eflags & DB_INIT_CDB) && !(eflags & DB_PRIVATE)) ? 0 : 1);
- rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
- _("cannot get %s lock on %s/%s\n"),
- ((mode & O_ACCMODE) == O_RDONLY)
- ? _("shared") : _("exclusive"),
- dbhome, dbi->dbi_file);
- } else {
- rpmlog(RPMLOG_DEBUG,
- "locked db index %s/%s\n",
- dbhome, dbi->dbi_file);
+ for (tries = 0; ; tries++) {
+ rc = fcntl(fdno, F_SETLK, (void *) &l);
+ if (rc) {
+ uint32_t eflags = db_envflags(db);
+ /* Warning iff using non-private CDB locking. */
+ rc = (((eflags & DB_INIT_CDB) && !(eflags & DB_PRIVATE)) ? 0 : 1);
+ if (errno == EAGAIN && rc) {
+ struct timespec ts;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING,
+ _("waiting for %s lock on %s/%s\n"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ ts.tv_sec = (time_t)0;
+ ts.tv_nsec = 100000000; /* .1 seconds */
+ if (tries < 10*60*3) { /* 3 minutes */
+ nanosleep(&ts, (struct timespec *)0);
+ continue;
+ }
+ }
+ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
+ _("cannot get %s lock on %s/%s\n"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ } else {
+ rpmlog(RPMLOG_DEBUG,
+ "locked db index %s/%s\n",
+ dbhome, dbi->dbi_file);
+ }
+ break;
}
}
return rc;
@@ -529,7 +552,6 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
DB * db = NULL;
DBTYPE dbtype = DB_UNKNOWN;
uint32_t oflags;
- static int _lockdbfd = 0;
if (dbip)
*dbip = NULL;
@@ -603,7 +625,10 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
dbi->dbi_db = db;
dbi->dbi_oflags = oflags;
- if (!verifyonly && rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
+ if (verifyonly)
+ dbi->dbi_lockdbfd = 0; /* disable locking in verify mode */
+
+ if (rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
rc = dbiFlock(dbi, rdb->db_mode);
}
++++++ weakdeps.diff ++++++
Add support for weak dependencies:
A) use RPMTAG_SUGGESTS and RPMTAG_ENHANCES to store them.
This is different to upstream, which uses RPMSENSE_MISSINGOK
and RPMTAG_REQUIRES/RPMTAG_PROVIDES instead. I chose different
tags because I wanted to be compatible. The point is that
applications that don't know about the new MISSINGOK semantics
will mis-interpret the provides/requires otherwise, which
I deemed to risky.
B) use RPMSENSE_STRONG to support a "strong" version, "Recommends"
instead of "Suggests" and "Supplements" instead of "Enhances".
Needs extcond.diff for query operations.
--- ./build/parsePreamble.c.orig 2011-01-25 13:52:28.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 14:09:07.000000000 +0000
@@ -310,6 +310,8 @@ static struct tokenBits_s const installS
{ "verify", RPMSENSE_SCRIPT_VERIFY },
{ "pretrans", RPMSENSE_PRETRANS },
{ "posttrans", RPMSENSE_POSTTRANS },
+ { "hint", RPMSENSE_MISSINGOK },
+ { "strong", RPMSENSE_STRONG },
{ NULL, 0 }
};
@@ -790,6 +792,18 @@ static int handlePreambleTag(rpmSpec spe
if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
return rc;
break;
+ case RPMTAG_SUGGESTSFLAGS:
+ case RPMTAG_ENHANCESFLAGS:
+ case RPMTAG_BUILDSUGGESTS:
+ case RPMTAG_BUILDENHANCES:
+ tagflags = RPMSENSE_MISSINGOK;
+ if (macro && (!strcmp(macro, "recommends") || !strcmp(macro, "buildrecommends")))
+ tagflags |= RPMSENSE_STRONG;
+ if (macro && (!strcmp(macro, "supplements") || !strcmp(macro, "buildsupplements")))
+ tagflags |= RPMSENSE_STRONG;
+ if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
+ return rc;
+ break;
case RPMTAG_EXCLUDEARCH:
case RPMTAG_EXCLUSIVEARCH:
case RPMTAG_EXCLUDEOS:
@@ -895,6 +909,14 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")},
{RPMTAG_COLLECTIONS, 0, 0, LEN_AND_STR("collections")},
{RPMTAG_ORDERFLAGS, 2, 0, LEN_AND_STR("orderwithrequires")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")},
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")},
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")},
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")},
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")},
{0, 0, 0, 0}
};
--- ./build/parseReqs.c.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./build/parseReqs.c 2011-05-11 14:16:43.000000000 +0000
@@ -95,6 +95,20 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
nametag = RPMTAG_CONFLICTNAME;
h = spec->buildRestrictions;
break;
+ case RPMTAG_SUGGESTSFLAGS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ break;
+ case RPMTAG_ENHANCESFLAGS:
+ nametag = RPMTAG_ENHANCESNAME;
+ break;
+ case RPMTAG_BUILDSUGGESTS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ h = spec->buildRestrictions;
+ break;
+ case RPMTAG_BUILDENHANCES:
+ nametag = RPMTAG_ENHANCESNAME;
+ h = spec->buildRestrictions;
+ break;
}
for (r = field; *r != '\0'; r = re) {
--- ./build/reqprov.c.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./build/reqprov.c 2011-05-11 14:15:02.000000000 +0000
@@ -75,6 +75,16 @@ int addReqProv(Header h, rpmTagVal tagN,
indextag = RPMTAG_TRIGGERINDEX;
extra = Flags & RPMSENSE_TRIGGER;
break;
+ case RPMTAG_SUGGESTSNAME:
+ versiontag = RPMTAG_SUGGESTSVERSION;
+ flagtag = RPMTAG_SUGGESTSFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
+ break;
+ case RPMTAG_ENHANCESNAME:
+ versiontag = RPMTAG_ENHANCESVERSION;
+ flagtag = RPMTAG_ENHANCESFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
+ break;
case RPMTAG_REQUIRENAME:
default:
tagN = RPMTAG_REQUIRENAME;
--- ./build/rpmfc.c.orig 2011-02-28 09:57:21.000000000 +0000
+++ ./build/rpmfc.c 2011-05-11 13:58:33.000000000 +0000
@@ -1075,6 +1075,12 @@ static struct DepMsg_s depMsgs[] = {
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
0, -1 },
+ { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL },
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
+ RPMSENSE_STRONG, RPMSENSE_STRONG },
+ { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL },
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
+ RPMSENSE_STRONG, 0 },
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
};
@@ -1160,6 +1166,14 @@ static rpmRC rpmfcGenerateDependsHelper(
failnonzero = 0;
tagflags = RPMSENSE_FIND_REQUIRES;
break;
+ case RPMTAG_ENHANCESFLAGS:
+ if (!pkg->autoProv)
+ continue;
+ failnonzero = 0;
+ tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK;
+ if (strcmp(dm->msg, "Supplements") == 0)
+ tagflags |= RPMSENSE_STRONG;
+ break;
default:
continue;
break;
--- ./lib/formats.c.orig 2011-01-25 13:52:28.000000000 +0000
+++ ./lib/formats.c 2011-05-11 14:02:09.000000000 +0000
@@ -560,6 +560,24 @@ static char * depflagsFormat(rpmtd td, c
return val;
}
+static char * depflag_strongFormat(rpmtd td, char * formatPrefix)
+{
+ char * val = NULL;
+
+ if (rpmtdClass(td) != RPM_NUMERIC_CLASS) {
+ val = xstrdup(_("(not a number)"));
+ } else {
+ uint64_t anint = rpmtdGetNumber(td);
+ char buf[10];
+ buf[0] = '\0';
+ if (anint & RPMSENSE_STRONG)
+ strcat(buf, "strong");
+ strcat(formatPrefix, "s");
+ rasprintf(&val, formatPrefix, buf);
+ }
+ return val;
+}
+
/**
* Return tag container array size.
* @param td tag data container
@@ -672,6 +690,7 @@ static const struct headerFormatFunc_s r
{ RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
{ RPMTD_FORMAT_EXPAND, "expand", expandFormat },
{ RPMTD_FORMAT_FSTATUS, "fstatus", fstatusFormat },
+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", depflag_strongFormat },
{ -1, NULL, NULL }
};
--- ./lib/rpmds.c.orig 2011-02-15 13:04:04.000000000 +0000
+++ ./lib/rpmds.c 2011-05-11 13:58:33.000000000 +0000
@@ -69,6 +69,10 @@ static int dsType(rpmTagVal tag,
t = "Trigger";
evr = RPMTAG_TRIGGERVERSION;
f = RPMTAG_TRIGGERFLAGS;
+ } else if (tag == RPMTAG_ENHANCESNAME) {
+ t = "Enhances";
+ evr = RPMTAG_ENHANCESVERSION;
+ f = RPMTAG_ENHANCESFLAGS;
} else {
rc = 1;
}
--- ./lib/rpmds.h.orig 2011-05-11 09:15:33.000000000 +0000
+++ ./lib/rpmds.h 2011-05-11 14:01:07.000000000 +0000
@@ -48,7 +48,7 @@ enum rpmsenseFlags_e {
RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */
RPMSENSE_KEYRING = (1 << 26),
- /* bit 27 unused */
+ RPMSENSE_STRONG = (1 << 27),
RPMSENSE_CONFIG = (1 << 28)
};
@@ -69,6 +69,7 @@ typedef rpmFlags rpmsenseFlags;
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_MISSINGOK | \
+ RPMSENSE_STRONG | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \
--- ./lib/rpmtag.h.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./lib/rpmtag.h 2011-05-11 13:58:33.000000000 +0000
@@ -217,14 +217,14 @@ typedef enum rpmTag_e {
RPMTAG_PRETRANSPROG = 1153, /* s */
RPMTAG_POSTTRANSPROG = 1154, /* s */
RPMTAG_DISTTAG = 1155, /* s */
- RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */
-#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */
- RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */
- RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */
- RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */
-#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */
- RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */
- RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */
+ RPMTAG_SUGGESTSNAME = 1156, /* s[] extension */
+#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] */
+ RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension */
+ RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension */
+ RPMTAG_ENHANCESNAME = 1159, /* s[] extension */
+#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] */
+ RPMTAG_ENHANCESVERSION = 1160, /* s[] extension */
+ RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension */
RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */
RPMTAG_CVSID = 1163, /* s (unimplemented) */
#define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */
--- ./lib/rpmtd.h.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/rpmtd.h 2011-05-11 14:00:06.000000000 +0000
@@ -220,6 +220,7 @@ typedef enum rpmtdFormats_e {
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
+ RPMTD_FORMAT_DEPFLAG_STRONG = 20, /* strong dependency (int types) */
} rpmtdFormats;
/** \ingroup rpmtd
--- ./python/rpmmodule.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./python/rpmmodule.c 2011-05-11 14:19:37.000000000 +0000
@@ -376,6 +376,7 @@ static int initModule(PyObject *m)
REGISTER_ENUM(RPMSENSE_RPMLIB);
REGISTER_ENUM(RPMSENSE_TRIGGERPREIN);
REGISTER_ENUM(RPMSENSE_KEYRING);
+ REGISTER_ENUM(RPMSENSE_STRONG);
REGISTER_ENUM(RPMSENSE_CONFIG);
REGISTER_ENUM(RPMTRANS_FLAG_TEST);
--- ./rpmpopt.in.orig 2011-01-11 07:04:51.000000000 +0000
+++ ./rpmpopt.in 2011-05-11 14:18:47.000000000 +0000
@@ -65,6 +65,22 @@ rpm alias --requires --qf \
--POPTdesc=$"list capabilities required by package(s)"
rpm alias -R --requires
+rpm alias --suggests --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package suggests"
+
+rpm alias --recommends --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package recommends"
+
+rpm alias --enhances --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package enhances"
+
+rpm alias --supplements --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package supplements"
+
rpm alias --info --qf '\
Name : %{NAME}\n\
%|EPOCH?{Epoch : %{EPOCH}\n}|\
++++++ whatrequires-doc.diff ++++++
--- ./doc/rpm.8.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/rpm.8 2011-05-11 15:36:18.000000000 +0000
@@ -564,6 +564,11 @@ Query all packages that provide the \fIC
.TP
\fB--whatrequires \fICAPABILITY\fB\fR
Query all packages that require \fICAPABILITY\fR for proper functioning.
+.br
+Note that this does not return what requires a given package.
+A package usually provides multiple capabilities and file-names on which
+other packages may depend. To see the complete dependencies
+for a package, use \fB-e --test \fIPACKAGE_NAME\fB\fR
.SS "PACKAGE QUERY OPTIONS:"
.PP
.TP
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org