Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > by-pkgid > a35732d620cfac4812adc8d6b2992f07 > files > 56

rpm-4.4.8-22.1mdv2008.0.src.rpm

# Do not change this spec directly but in the svn
# $Id: rpm.spec 134789 2007-03-27 15:13:43Z nanardon $

%define lib64arches	x86_64 ppc64 sparc64

%ifarch %lib64arches
    %define _lib lib64
%else
    %define _lib lib
%endif

%define _prefix /usr
%define _libdir %_prefix/%_lib
%define _bindir %_prefix/bin
%define _sysconfdir /etc
%define _datadir /usr/share
%define _defaultdocdir %_datadir/doc
%define _localstatedir /var
%define _infodir %_datadir/info

%define _host_vendor mandriva

# Define directory which holds rpm config files, and some binaries actually
# NOTE: it remains */lib even on lib64 platforms as only one version
#       of rpm is supported anyway, per architecture
%define rpmdir %{_prefix}/lib/rpm

%if %{?mklibname:0}%{?!mklibname:1}
%define mklibname(ds)  %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel}
%endif

%if %{?distsuffix:0}%{?!distsuffix:1}
%define distsuffix mdv
%endif

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

%if %{?pyver:0}%{?!pyver:1}
%define pyver %(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".")
%endif

%define __find_requires %{rpmdir}/mandriva/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}
%define __find_provides %{rpmdir}/mandriva/find-provides

%define rpmversion	4.4.8
%define poptver		1.10.8
%define perlmoduleversion	0.66
%define srcver		%rpmversion
%define libpoptver	0
%define libver		4.4
%define subrel 1
%define release			    %mkrel 22
%define perlmodulerelease   %mkrel 44
%define poptrelease		%{release}

%define libpoptname  %mklibname popt %{libpoptver}
%define librpmname   %mklibname rpm  %{libver}
%define libpoptnamedevel  %mklibname -d popt
%define librpmnamedevel   %mklibname -d rpm

%define buildpython 1

%define buildnptl 0

%if %{mdkversion} >= 200710
# MDV 2007.1 builds with --hash-style=gnu by default
%define rpmsetup_version 1.34
%endif

%define builddebug 0
%{?_with_debug:%define builddebug 1}

%{?_with_python:%define buildpython 1}
%{?_without_python:%define buildpython 0}

%{?_with_nptl:%define buildnptl 1}
%{?_without_nptl:%define buildnptl 0}

Summary:	The RPM package management system
Name:		rpm
Version:	%{rpmversion}
Release:	%{release}
Group:		System/Configuration/Packaging

Source:		ftp://ftp.jbj.org/pub/rpm-%{libver}.x/rpm-%{srcver}.tar.bz2

# Add some undocumented feature to gendiff
Patch17:	rpm-4.2-gendiff-improved.patch

# (gb) fix built-in zlib dependencies
Patch1:		rpm-4.4.6-deps.patch

# (gb) use shared libraries
Patch2:		rpm-4.4.6-no-static.patch

# (gb) force generation of PIC code for static libs that can be built into a DSO (zlib, file)
Patch3:		rpm-4.4.6-pic.patch

# (pixel) resurrected patch. useful when used together with "private" in macros.cdb
Patch13:	rpm-4.4.8-global-RPMLOCK.patch

# if %post of foo-2 fails,
# or if %preun of foo-1 fails,
# or if %postun of foo-1 fails,
# => foo-1 is not removed, so we end up with both packages in rpmdb
# this patch makes rpm ignore the error in those cases
# failing %pre must still make the rpm install fail (#23677)
#
# (nb: the exit code for pretrans/posttrans & trigger/triggerun/triggerpostun
#       scripts is ignored with or without this patch)
Patch22:        rpm-4.4.6-non-pre-scripts-dont-fail.patch

# (fredl) add loging facilities through syslog
Patch31:	rpm-4.4.3-syslog.patch

# Check amd64 vs x86_64, these arch are the same
Patch44:	rpm-4.4.1-amd64.patch

# Backport from 4.2.1 provides becoming obsoletes bug (fpons)
Patch49:	rpm-4.4.3-provides-obsoleted.patch

# Introduce new ppc32 arch. Fix ppc64 bi-arch builds. Fix ppc builds on newer CPUs.
Patch56:	rpm-4.4.6-ppc32.patch

# ok for this
Patch63:	rpm-4.4.6-dont-install-delta-rpms.patch

# This patch ask to read /usr/lib/rpm/vendor/rpmpopt too
Patch64:    rpm-4.4.1-morepopt.patch

# Being able to read old rpm (build with rpm v3)
# See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=127113#c12
Patch68:    rpm-4.4.1-region_trailer.patch

# In original rpm, -bb --short-circuit does not work and run all stage
# From popular request, we allow to do this
# http://qa.mandriva.com/show_bug.cgi?id=15896
Patch70:	rpm-4.4.1-bb-shortcircuit.patch

# http://www.redhat.com/archives/rpm-list/2005-April/msg00131.html
# http://www.redhat.com/archives/rpm-list/2005-April/msg00132.html
Patch71:    rpm-4.4.4-ordererase.patch

# File conflicts when rpm -i
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=151609
Patch72:    rpm-4.4.1-fileconflicts.patch

# Allow to set %_srcdefattr for src.rpm
Patch77:    rpm-source-defattr.patch

# Do not use futex, but fcntl
Patch78:    rpm-4.4.6-fcntl.patch

Patch82:    rpm-4.4.3-ordering.patch

# don't conflict for doc files from colored packages
# (to be able to install lib*-devel together with lib64*-devel even if they have conflicting manpages)
Patch83: rpm-4.2.3-no-doc-conflicts.patch

# Fix http://qa.mandriva.com/show_bug.cgi?id=19392
Patch84: rpm-4.4.4-rpmqv-ghost.patch

# Install perl module in vendor directory
Patch85: rpm-4.4.4-perldirs.patch

# Use temporary table for Depends DB (Olivier Thauvin upstream)
Patch86: rpm-4.4.6-depsdb.patch

# Currently we prefer to disable dependencies over parents directory
Patch87: rpm-4.4.6-no-dirnames-dep.patch

# rpm 4.4.6 killed SOURCEPACKAGE, but this was announce lately, and will
# break all older tools that was using it (mdv 2006, 2005) which need this
# tag to know it is possible to rebuild a src.rpm
# This patch readd the tag into src.rpm
Patch88: rpm-4.4.6-SOURCEPACKAGE.patch

# make rpmdb cpp compliant (sptutle)
# reported upstream, I hope to see this include
Patch89: rpm-4.4.6-rpmdb.h-cpp-fix.patch

# avoids taking into account duplicates in file list when checking
# for unpackaged files
Patch91: rpm-4.4.6-check-dupl-files.patch

# with tar >= 1.15.91, one needs the --wildcard option to list *.spec
# files (for rpm -ta)
Patch92: rpm-4.4.6-newtar.patch

# This patch adds again a workaround to allow rpm to read/install
# rpm v3 - Internal format is likely the same into rpm v4, data is
# just organised in another way

Patch94: rpm-4.4.6-rpmv3-support.patch

# fix free on invalid pointer after displaying "Unable to open temp file"
Patch98: rpm-4.4.6-fix-free-on-bad-pointer.patch

# without this patch, when pkg rpm-build is not installed,
# using rpm -bs t.spec returns: "t.spec: No such file or directory"
Patch100: rpm-4.4.6-fix-error-message-rpmb-not-installed.patch

# librpm uses bavail ie "free blocks avail to non-superuser"
# that's ok, it will help keeping some free space, even for root
# but when bavail == 0, librpm thinks statfs failed, and do not check
# so setting bavail to 1 when bavail it is 0
# (no package should fit in one block!)
Patch107: rpm-4.4.8-do-check-free-size-when-bavail-is-0.patch

Patch108: rpm-4.4.6-use-dgettext-instead-of-gettext-to-allow-use-of-multilibs.patch

Patch109: rpm-build-expand-field-for-single-token.patch

Patch111: rpm-check-file-trim-double-slash-in-buildroot.patch

Patch112: rpm-dont-use-rpmio-to-read-file-for-script.patch

# Patch from cvs
# using _docdir_fmt for doc directory
Patch113: rpm-4.4.8-macro_doc_fmt.patch

Patch114: rpm-read-vendor-macros.patch

Patch115: rpm-4.4.8-dont-clean-buildroot-in-install.patch

# Fix #31287, rpm -V do not use same space count
Patch116: rpm-qv-use-same-indentation.patch

# if file exists and is not yet in db, rpm don't check and replace it
Patch117: rpm-dont-replace-config-not-in-db.patch

Patch118: rpm-4.4.8-lowercase-os-for-platform.patch

# HAVE_LOCALE_H is used by system.h, ensure it is defined properly
# (the issue only occurs when compiling without __OPTIMIZE__ (ie -O2)
#  otherwise libintl.h do include locale.h)
# nb: this issue is fixed in cvs HEAD
Patch119: rpm-4.4.8-fix-build-without-O2.patch

Patch120: rpm-4.4.8-fix-segfault-for-old-pkg-with-Postin-but-no-Postinprog.patch

# important patch fixing parse_hdlist (and so genhdlist2) on heavy loaded boxes
# (without this patch it timeouts after a read miss of 1 second (even a pipe),
# and there is no way we can retry since we would need to backtrack the fd)
Patch121: rpm-4.4.8-raise-read-timeout-to-60secs.patch

# this handles buggy rpm ftp://ftp.free.fr/mirrors/plf.zarb.org/mandriva/2007.1/free/release/binary/x86_64/lib64spectrum2-0.2.2-4plf.x86_64.rpm
# which has only 7 DIRNAMES/BASENAMES entries, but more FILELINKTOS entries (#32102)
# a better fix may be to cleanup the mess when reading the header?
Patch122: rpm-4.4.8-do-not-crash-when-FILELINKTOS-has-more-entries-than-DIRNAMES.patch

# from rpm.org 4.4.2.2: make find-lang --with-gnome picks up omf files (rhbz#251400)
Patch123: rpm-4.4.8-find-lang-omf-files.patch

# [pixel] without this patch, "rpm -e" or "rpm -U" will need to stat(2) every dirnames of
# files from the package (eg COPYING) in the db. This is quite costly when not in cache 
# (eg on a test here: >300 stats, and so 3 seconds after a "echo 3 > /proc/sys/vm/drop_caches")
# this breaks urpmi test case test_rpm_i_fail('gd') in superuser--file-conflicts.t,
# but this is bad design anyway
Patch124: rpm-4.4.8-speedup-by-not-checking-same-files-with-different-paths-through-symlink.patch

# patch from popt cvs (removes N_ from popt.h) (fixes #31397)
Patch125: popt-fix-N_.patch

# allow to use "linux32 rpm -bb" instead of "linux32 rpm -bb --target x86_64"
Patch126: rpm-4.4.8-use-etc-platform32-when-linux32.patch

# make "rpm -bb --quiet" quiet as should be 
# (without this patch, the option is simply ignored in rpmcliAllPoptTable)
Patch127: rpm-4.4.8-handle-rpmbuild--quiet.patch

# fix rpm -K segfaulting on corrupted header (#33735)
Patch128: rpm-4.4.8-fix-rpm-K-segfault-on-corrupted-header.patch

# if "a" suggests "b", rpm rightfully allows to remove "b"
# but rpm must not put in cache that "b" can be removed,
# because if "c" requires "b", rpm must not allow to remove "b"
# (#34342)
Patch129: rpm-4.4.8-do-not-cache-unsatisfied-suggest.patch

# mdv2009.0 has a few "rpmlib(PayloadIsLzma) <= 4.4.2.2-1" pkgs (#45227)
Patch130: rpm-4.4.8-compat-PayloadIsLzma.patch

License:	GPL
BuildRequires:	autoconf >= 2.57
BuildRequires:	doxygen
BuildRequires:	zlib-devel
BuildRequires:  bzip2-devel
BuildRequires:	automake >= 1.8
BuildRequires:	elfutils-devel
BuildRequires:	sed >= 4.0.3
BuildRequires:	libbeecrypt-devel
BuildRequires:	ed, gettext-devel
BuildRequires:  libsqlite3-devel
BuildRequires:  neon-devel >= 0.26
BuildRequires:  rpm-mandriva-setup-build %{?rpmsetup_version:>= %{rpmsetup_version}}
BuildRequires:  readline-devel
BuildRequires:	ncurses-devel
BuildRequires:  openssl-devel >= 0.9.8
BuildRequires:	perl-devel
BuildRequires:  liblua-devel
# Need for doc
BuildRequires:	graphviz
BuildRequires:	tetex
%if %buildpython
BuildRequires:	python-devel
%endif
%if %buildnptl
# BuildRequires:	nptl-devel
%endif

Requires:	bzip2 >= 0.9.0c-2
Requires:	lzma
Requires:	cpio
Requires:	gawk
Requires:	glibc >= 2.1.92
Requires:	mktemp
Requires:	popt = %{poptver}-%{poptrelease}
Requires:	setup >= 2.2.0-8mdk
Requires:	rpm-mandriva-setup >= 1.42
Requires:	update-alternatives
Requires:	%librpmname = %version-%release
Conflicts:	patch < 2.5
Conflicts:	menu < 2.1.5-29mdk
Conflicts:	locales < 2.3.1.1
Conflicts:	man-pages-fr < 0.9.7-16mdk
Conflicts:	man-pages-pl < 0.4-9mdk
Conflicts:	perl-URPM < 1.63-3mdv2008.0
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
URL:            http://rpm5.org/
Requires(pre):		rpm-helper >= 0.8
Requires(pre):		coreutils
Requires(postun):	rpm-helper >= 0.8

%description
RPM is a powerful command line driven package management system capable of
installing, uninstalling, verifying, querying, and updating software packages.
Each software package consists of an archive of files along with information
about the package like its version, a description, etc.

%package -n %librpmname
Summary: Library used by rpm
Group:		System/Libraries
Provides:   librpm = %version-%release

%description -n %librpmname
RPM is a powerful command line driven package management system capable of
installing, uninstalling, verifying, querying, and updating software packages.
This package contains common files to all applications based on rpm.

%package -n %librpmnamedevel
Summary:	Development files for applications which will manipulate RPM packages
Group:		Development/C
Requires:	rpm = %{version}-%{release}
Requires:	%libpoptnamedevel = %{poptver}-%{poptrelease}
Provides:	librpm-devel = %version-%release
Provides:   	rpm-devel = %version-%release
Obsoletes:  	rpm-devel < 4.4.1
Obsoletes:      %{_lib}rpm4.4-devel
Obsoletes:      %{_lib}rpm4.2-devel

%description -n %librpmnamedevel
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.

This package should be installed if you want to develop programs that
will manipulate RPM packages and databases.

%package build
Summary:	Scripts and executable programs used to build packages
Group:		System/Configuration/Packaging
Requires:	autoconf
Requires:	automake
Requires:	file
Requires:	gcc-c++
# We need cputoolize & amd64-* alias to x86_64-* in config.sub
Requires:	libtool-base >= 1.4.3-5mdk
Requires:	patch
Requires:	make
Requires:	unzip
Requires:	elfutils
Requires:	rpm = %{version}-%{release}
Requires:	rpm-mandriva-setup-build %{?rpmsetup_version:>= %{rpmsetup_version}}

%description build
This package contains scripts and executable programs that are used to
build packages using RPM.

%if %buildpython
%package -n python-rpm
Summary:	Python bindings for apps which will manipulate RPM packages
Group:		Development/Python
Requires:	python >= %{pyver}
Requires:	rpm = %{version}-%{release}
Obsoletes:  rpm-python < %version-%release
Provides:   rpm-python = %version-%release

%description -n python-rpm
The rpm-python package contains a module which permits applications
written in the Python programming language to use the interface
supplied by RPM (RPM Package Manager) libraries.

This package should be installed if you want to develop Python
programs that will manipulate RPM packages and databases.
%endif

%package -n popt-data
Summary: popt static data
Group:		System/Libraries
Version:	%{poptver}
Release:    %{poptrelease}

%description -n popt-data
This package contains popt data files like locales.

%package -n %libpoptname
Summary:	A C library for parsing command line parameters
Group:		System/Libraries
Version:	%{poptver}
Release:	%{poptrelease}
Requires:   popt-data >= %{poptver}
Provides:   lib%{name} = %{poptver}-%{poptrelease}
Provides:   popt = %{poptver}-%{poptrelease}
Obsoletes:  popt <= 1.8.3

%description -n %libpoptname
Popt is a C library for parsing command line parameters.  Popt was
heavily influenced by the getopt() and getopt_long() functions, but it
improves on them by allowing more powerful argument expansion.  Popt
can parse arbitrary argv[] style arrays and automatically set
variables based on command line arguments.  Popt allows command line
arguments to be aliased via configuration files and includes utility
functions for parsing arbitrary strings into argv[] arrays using
shell-like rules.

%package -n %libpoptnamedevel
Summary:	A C library for parsing command line parameters
Group:		Development/C
Version:	%{poptver}
Release:	%{poptrelease}
Requires:	%libpoptname = %{poptver}-%{poptrelease}
Provides:   popt-devel = %{poptver}-%{poptrelease}
Provides:   libpopt-devel = %{poptver}-%{poptrelease}
Obsoletes:  popt-devel <= 1.8.3
Obsoletes:  %{_lib}popt0-devel

%description -n %libpoptnamedevel
Popt is a C library for parsing command line parameters.  Popt was
heavily influenced by the getopt() and getopt_long() functions, but it
improves on them by allowing more powerful argument expansion.  Popt
can parse arbitrary argv[] style arrays and automatically set
variables based on command line arguments.  Popt allows command line
arguments to be aliased via configuration files and includes utility
functions for parsing arbitrary strings into argv[] arrays using
shell-like rules.

Install popt-devel if you're a C programmer and you'd like to use its
capabilities.

%define		perlmodule	RPM
%package -n perl-%perlmodule
Summary:	Perl bindings for RPM
Group:		Development/Perl
Version:	%perlmoduleversion
Release:	%perlmodulerelease

%description -n perl-%perlmodule
The RPM Perl module provides an object-oriented interface to querying both
the installed RPM database as well as files on the filesystem.

%prep
%setup -q -n %name-%srcver

%patch1 -p1 -b .deps

%patch2 -p1 -b .no-static

%patch3 -p1 -b .pic

#%patch13 -p1 -b .lock

%patch17 -p0 -b .improved

%patch22 -p1 -b .fail

%patch31 -p0 -b .syslog

%patch44 -p1 -b .amd64

%patch49 -p0 -b .provides

%patch56 -p0 -b .ppc32

%patch63 -p0 -b .dont-install-delta-rpms

%patch64 -p0 -b .morepopt

%patch68 -p0 -b .region_trailer

#%patch69 -p0 -b .trans

%patch70 -p0 -b .shortcircuit

%patch71 -p0  -b .ordererase

%patch72 -p0  -b .fileconflicts

%patch77 -p0  -b .srcdefattr

%if %buildnptl
%else
%patch78 -p0  -b .fcntl
%endif

%patch82 -p0 -b .ordering

%patch83 -p1 -b .no-doc-conflicts

%patch84 -p0 -b .poptQVghost

%patch85 -p0 -b .perldirs

%patch86 -p0 -b .depsdb

%patch87 -p0 -b .no-dirname-dep

%patch88 -p0 -b .sourcepackage

%patch89 -p0 -b .cpp-compliant

%patch91 -p0 -b .check-dupl-files

%patch92 -p0 -b .newtar

%patch94 -p1 -b .rpmv3-support

%patch98 -p1 -b .free

%patch100 -p1 -b .rpmb-missing

%patch107 -p1

%patch108 -p1

# rpm now check there is only one token per field
# too bad, the check is performed before macro expansion...
%patch109 -p0 -b .singletoken

# Fix diff issue when buildroot contains some "//"
%patch111 -p0 -b .trim-slash

# Fix strange issue making %pre/post/... -f not working
%patch112 -p0 -b .build-no-rpmio

%patch113 -p0 -b .docdir-macros

%patch114 -p0 -b .read-our-macros

%patch115 -p0 -b .noclean

%patch116 -p0 -b .rpmVspace

%patch117 -p0 -b .rpmnew

%patch118 -p0 -b .lowercaseos

%patch119 -p1
%patch120 -p1
%patch121 -p1 -b .timeout
%patch122 -p1

%patch123 -p1
%patch124 -p1

cd popt
%patch125 -p0 -b .N_
cd ..

%patch126 -p1 -b .linux32

%patch127 -p1 -b .quiet

%patch128 -p1
%patch129 -p1
%patch130 -p1

%build

for dir in . popt file zlib db/dist; do
    (
    cd $dir
    libtoolize --force
    aclocal
    automake -a
    autoconf
    )
done

# rpm takes care of --libdir but explicitelly setting --libdir on
# configure breaks make install, but this does not matter.
# --build, we explictly set 'mandriva' as our config subdir and 
# _host_vendor are 'mandriva'
%if %builddebug
RPM_OPT_FLAGS=-g
%endif
CFLAGS="$RPM_OPT_FLAGS -fPIC" CXXFLAGS="$RPM_OPT_FLAGS -fPIC" \
    ./configure \
        --build=%{_target_cpu}-%{_host_vendor}-%{_target_os}%{?_gnu} \
        --prefix=%{_prefix} \
        --sysconfdir=%{_sysconfdir} \
        --localstatedir=%{_localstatedir} \
        --mandir=%{_mandir} \
        --infodir=%{_infodir} \
        --enable-nls \
        --without-javaglue \
%if %builddebug
        --enable-debug \
%endif
%if %buildnptl
        --enable-posixmutexes \
%else
        --with-mutex=UNIX/fcntl \
%endif
%if %buildpython
        --with-python=%{pyver} \
%else
        --without-python \
%endif
        --with-glob \
        --without-selinux \
        --with-apidocs 

# We should use the zlib provided with rpm:
# 21:17 < Nanar> why using ../../zlib in file/ instead system library ?
# 21:38 < jbj> Nanar: zlib modified to make *.rpm packages rsync friendly.
#              See https://svn.uhulinux.hu/packages/dev/zlib/patches/02-rsync.patch
# 21:38 < jbj> rip if you don't want to be rsync friendly. <shrug>
%make -C zlib AM_CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-fPIC"

%make

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=%buildroot install

# We put a popt copy in /%_lib for application in /bin
# This is not for rpm itself as it requires all rpmlib
# from /usr/%_lib
mkdir -p $RPM_BUILD_ROOT/%{_lib}
mv $RPM_BUILD_ROOT%{_libdir}/libpopt.so.* $RPM_BUILD_ROOT/%{_lib}
ln -s ../../%{_lib}/libpopt.so.0 $RPM_BUILD_ROOT%{_libdir}
ln -sf libpopt.so.0 $RPM_BUILD_ROOT%{_libdir}/libpopt.so

rm -f $RPM_BUILD_ROOT%{_prefix}/lib/rpmpopt
ln -s rpm/rpmpopt-%{rpmversion} $RPM_BUILD_ROOT%{_prefix}/lib/rpmpopt

%ifarch ppc powerpc
ln -sf ppc-mandriva-linux $RPM_BUILD_ROOT%{rpmdir}/powerpc-mandriva-linux
%endif

#mv -f $RPM_BUILD_ROOT/%{rpmdir}/rpmdiff $RPM_BUILD_ROOT/%{_bindir}

# Save list of packages through cron
mkdir -p ${RPM_BUILD_ROOT}/etc/cron.daily
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}/etc/cron.daily/rpm

mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}/etc/logrotate.d/rpm

mkdir -p $RPM_BUILD_ROOT/etc/rpm/
cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.cdb
%%__dbi_cdb      %%{nil}
%%__dbi_other    %%{?_tmppath:tmpdir=%%{_tmppath}} usedbenv create \
                 mpool mp_mmapsize=8Mb mp_size=512kb verify
E_O_F

mkdir -p $RPM_BUILD_ROOT/var/lib/rpm
for dbi in \
	Basenames Conflictname Dirnames Group Installtid Name Providename \
	Provideversion Removetid Requirename Requireversion Triggername \
	Packages __db.001 __db.002 __db.003 __db.004
do
    touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi
done

find apidocs -type f | xargs perl -p -i -e "s@$RPM_BUILD_DIR/%{name}-%{rpmversion}@@g"

test -d doc-copy || mkdir doc-copy
rm -rf doc-copy/*
ln -f doc/manual/* doc-copy/
rm -f doc-copy/Makefile*

mkdir -p $RPM_BUILD_ROOT/var/spool/repackage

mkdir -p %buildroot%_sysconfdir/rpm/macros.d
cat > %buildroot%_sysconfdir/rpm/macros <<EOF
# Put your own system macros here
# useally contains 

# Set this one according your locales
# %_install_langs

EOF

# Get rid of unpackaged files
(cd $RPM_BUILD_ROOT;
  rm -rf .%{_includedir}/beecrypt/
  rm -f  .%{_libdir}/libbeecrypt.{a,la,so*}
  rm -f  .%{_libdir}/python*/site-packages/poptmodule.{a,la}
  rm -f  .%{_libdir}/python*/site-packages/rpmmodule.{a,la}
  rm -f  .%{rpmdir}/{Specfile.pm,cpanflute2,cpanflute,sql.prov,sql.req,tcl.req}
  rm -f  .%{rpmdir}/{config.site,cross-build,rpmdiff.cgi}
  rm -f  .%{rpmdir}/trpm
  rm -f  .%{_bindir}/rpmdiff
)

%{rpmdir}/%{_host_vendor}/find-lang.pl $RPM_BUILD_ROOT %{name}
%{rpmdir}/%{_host_vendor}/find-lang.pl $RPM_BUILD_ROOT popt

%check

#make -C popt check-TESTS

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then
    echo "
You have both
	/var/lib/rpm/packages.rpm	db1 format installed package headers
	/var/lib/rpm/Packages		db3 format installed package headers
Please remove (or at least rename) one of those files, and re-install.
"
    exit 1
fi

/usr/share/rpm-helper/add-user rpm $1 rpm /var/lib/rpm /bin/false

rm -rf /usr/lib/rpm/*-mandrake-*

%post
# nuke __db.00? when updating to this rpm
rm -f /var/lib/rpm/__db.00?

if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f %{rpmdir}/convertrpmrc.sh ] 
then
	sh %{rpmdir}/convertrpmrc.sh 2>&1 > /dev/null
fi

if [ -f /var/lib/rpm/packages.rpm ]; then
    /bin/chown rpm.rpm /var/lib/rpm/*.rpm
elif [ ! -f /var/lib/rpm/Packages ]; then
    /bin/rpm --initdb
fi

%postun
/usr/share/rpm-helper/del-user rpm $1 rpm

%post -n %librpmname -p /sbin/ldconfig
%postun -n %librpmname -p /sbin/ldconfig

%post -n %libpoptname -p /sbin/ldconfig
%postun -n %libpoptname -p /sbin/ldconfig

%define	rpmattr		%attr(0755, rpm, rpm)

%files -f %{name}.lang
%defattr(-,root,root)
%doc GROUPS CHANGES doc/manual/[a-z]*
%attr(0755,rpm,rpm) /bin/rpm
%attr(0755, rpm, rpm) %{_bindir}/rpm2cpio
%attr(0755, rpm, rpm) %{_bindir}/gendiff
%attr(0755, rpm, rpm) %{_bindir}/rpmdb
%attr(0755, rpm, rpm) %{_bindir}/rpm[eiukqv]
%attr(0755, rpm, rpm) %{_bindir}/rpmsign
%attr(0755, rpm, rpm) %{_bindir}/rpmquery
%attr(0755, rpm, rpm) %{_bindir}/rpmverify

%dir %{_localstatedir}/spool/repackage
%dir %{rpmdir}
%dir /etc/rpm
%config(noreplace) /etc/rpm/macros
%config(noreplace) /etc/rpm/macros.cdb
%dir /etc/rpm/macros.d
%attr(0755, rpm, rpm) %{rpmdir}/config.guess
%attr(0755, rpm, rpm) %{rpmdir}/config.sub
#%attr(0755, rpm, rpm) %{rpmdir}/convertrpmrc.sh
%attr(0755, rpm, rpm) %{rpmdir}/rpmdb_*
%attr(0644, rpm, rpm) %{rpmdir}/macros
%attr(0755, rpm, rpm) %{rpmdir}/mkinstalldirs
%attr(0755, rpm, rpm) %{rpmdir}/rpm.*
%attr(0755, rpm, rpm) %{rpmdir}/rpm[deiukqv]
%attr(0644, rpm, rpm) %{rpmdir}/rpmpopt*
%attr(0644, rpm, rpm) %{rpmdir}/rpmrc

%{_prefix}/lib/rpmpopt
%rpmattr	%{rpmdir}/rpm2cpio.sh
%rpmattr	%{rpmdir}/tgpg

%ifarch %{ix86}
%attr(   -, rpm, rpm) %{rpmdir}/i*86-*
#%attr(   -, rpm, rpm) %{rpmdir}/k6*
%attr(   -, rpm, rpm) %{rpmdir}/athlon*
%attr(   -, rpm, rpm) %{rpmdir}/pentium*
%endif
%ifarch alpha
%attr(   -, rpm, rpm) %{rpmdir}/alpha*
%endif
%ifarch %{sunsparc}
%attr(   -, rpm, rpm) %{rpmdir}/sparc*
%endif
%ifarch ppc powerpc
%attr(   -, rpm, rpm) %{rpmdir}/ppc-*
%attr(   -, rpm, rpm) %{rpmdir}/ppc32-*
%attr(   -, rpm, rpm) %{rpmdir}/ppc64-*
%attr(   -, rpm, rpm) %{rpmdir}/powerpc-*
%endif
%ifarch ppc powerpc ppc64
%attr(   -, rpm, rpm) %{rpmdir}/ppc*series-*
%endif
%ifarch ppc64
%attr(   -, rpm, rpm) %{rpmdir}/ppc-*
%attr(   -, rpm, rpm) %{rpmdir}/ppc32-*
%attr(   -, rpm, rpm) %{rpmdir}/ppc64-*
%endif
%ifarch ia64
%attr(   -, rpm, rpm) %{rpmdir}/ia64-*
%endif
%ifarch x86_64
%attr(   -, rpm, rpm) %{rpmdir}/amd64-*
#%attr(   -, rpm, rpm) %{rpmdir}/x86_64-*
%attr(   -, rpm, rpm) %{rpmdir}/ia32e-*
%endif
%attr(   -, rpm, rpm) %{rpmdir}/noarch*

%{_prefix}/src/rpm/RPMS/*
%{_mandir}/man[18]/*.[18]*
%lang(pl) %{_mandir}/pl/man[18]/*.[18]*
%lang(ru) %{_mandir}/ru/man[18]/*.[18]*
%lang(ja) %{_mandir}/ja/man[18]/*.[18]*
%lang(sk) %{_mandir}/sk/man[18]/*.[18]*
%lang(fr) %{_mandir}/fr/man[18]/*.[18]*
%lang(ko) %{_mandir}/ko/man[18]/*.[18]*

%config(noreplace,missingok)	/etc/cron.daily/rpm
%config(noreplace,missingok)	/etc/logrotate.d/rpm

%attr(0755, rpm, rpm)	%dir %_localstatedir/lib/rpm

%define	rpmdbattr %attr(0644, rpm, rpm) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)

%rpmdbattr	/var/lib/rpm/Basenames
%rpmdbattr	/var/lib/rpm/Conflictname
%rpmdbattr	/var/lib/rpm/__db.0*
%rpmdbattr	/var/lib/rpm/Dirnames
%rpmdbattr	/var/lib/rpm/Group
%rpmdbattr	/var/lib/rpm/Installtid
%rpmdbattr	/var/lib/rpm/Name
%rpmdbattr	/var/lib/rpm/Packages
%rpmdbattr	/var/lib/rpm/Providename
%rpmdbattr	/var/lib/rpm/Provideversion
%rpmdbattr	/var/lib/rpm/Removetid
%rpmdbattr	/var/lib/rpm/Requirename
%rpmdbattr	/var/lib/rpm/Requireversion
%rpmdbattr	/var/lib/rpm/Triggername

%files build
%defattr(-,root,root)
%doc CHANGES
%doc doc-copy/*
%dir %{_prefix}/src/rpm
%dir %{_prefix}/src/rpm/BUILD
%dir %{_prefix}/src/rpm/SPECS
%dir %{_prefix}/src/rpm/SOURCES
%dir %{_prefix}/src/rpm/SRPMS
%dir %{_prefix}/src/rpm/RPMS
%rpmattr	%{_bindir}/rpmbuild
%rpmattr	%{_prefix}/lib/rpm/brp-*
%rpmattr	%{_prefix}/lib/rpm/check-files
%rpmattr	%{_prefix}/lib/rpm/debugedit
%rpmattr	%{_prefix}/lib/rpm/executabledeps.sh
%rpmattr	%{_prefix}/lib/rpm/find-debuginfo.sh
%rpmattr	%{_prefix}/lib/rpm/find-lang.sh
%rpmattr	%{_prefix}/lib/rpm/find-prov.pl
%rpmattr	%{_prefix}/lib/rpm/find-provides
%rpmattr	%{_prefix}/lib/rpm/find-provides.perl
%rpmattr	%{_prefix}/lib/rpm/find-req.pl
%rpmattr	%{_prefix}/lib/rpm/find-requires
%rpmattr	%{_prefix}/lib/rpm/find-requires.perl
%rpmattr	%{_prefix}/lib/rpm/getpo.sh
%rpmattr	%{_prefix}/lib/rpm/http.req
%rpmattr	%{_prefix}/lib/rpm/javadeps.sh
%rpmattr	%{_prefix}/lib/rpm/libtooldeps.sh
%rpmattr	%{_prefix}/lib/rpm/magic
%rpmattr	%{_prefix}/lib/rpm/magic.mgc
%rpmattr	%{_prefix}/lib/rpm/magic.mime
%rpmattr	%{_prefix}/lib/rpm/magic.mime.mgc
%rpmattr	%{_prefix}/lib/rpm/perldeps.pl
%rpmattr	%{_prefix}/lib/rpm/perl.prov
%rpmattr	%{_prefix}/lib/rpm/perl.req
%rpmattr	%{_prefix}/lib/rpm/pkgconfigdeps.sh
%rpmattr    %{_prefix}//lib/rpm/php.prov
%rpmattr    %{_prefix}//lib/rpm/php.req
%rpmattr    %{_prefix}//lib/rpm/symclash.py
%rpmattr    %{_prefix}//lib/rpm/symclash.sh

%rpmattr	%{_prefix}/lib/rpm/rpm[bt]
%rpmattr	%{_prefix}/lib/rpm/rpmdeps
#%rpmattr	%{_prefix}/lib/rpm/trpm
%rpmattr	%{_prefix}/lib/rpm/u_pkg.sh
%rpmattr	%{_prefix}/lib/rpm/vpkg-provides.sh
%rpmattr	%{_prefix}/lib/rpm/vpkg-provides2.sh
%rpmattr    %{_prefix}/lib/rpm/pythondeps.sh

%{_mandir}/man8/rpmbuild.8*
%{_mandir}/man8/rpmdeps.8*

%if %buildpython
%files -n python-rpm
%defattr(-,root,root)
%{_libdir}/python*/site-packages/rpm
%endif

%files -n %librpmname
%defattr(-,root,root)
%{_libdir}/librpm-%{libver}.so
%{_libdir}/librpmdb-%{libver}.so
%{_libdir}/librpmio-%{libver}.so
%{_libdir}/librpmbuild-%{libver}.so

%files -n %librpmnamedevel
%defattr(-,root,root)
#%doc apidocs/html
%{_includedir}/rpm
%{_libdir}/librpm.a
%{_libdir}/librpm.la
%{_libdir}/librpm.so
%{_libdir}/librpmdb.a
%{_libdir}/librpmdb.la
%{_libdir}/librpmdb.so
%{_libdir}/librpmio.a
%{_libdir}/librpmio.la
%{_libdir}/librpmio.so
%{_libdir}/librpmbuild.a
%{_libdir}/librpmbuild.la
%{_libdir}/librpmbuild.so
%{_mandir}/man3/RPM*

%files -n popt-data -f popt.lang
%defattr(-,root,root)

%files -n %libpoptname
%defattr(-,root,root)
/%{_lib}/libpopt.so.*
%{_libdir}/libpopt.so.*

%files -n %libpoptnamedevel
%defattr(-,root,root)
%{_libdir}/libpopt.a
%{_libdir}/libpopt.la
%{_libdir}/libpopt.so
%{_includedir}/popt.h
%{_mandir}/man3/popt.3*

%files -n perl-%perlmodule
%defattr(-,root,root)
%{perl_vendorarch}/%{perlmodule}.pm
%{perl_vendorarch}/auto/%{perlmodule}
%doc perl/Changes



%changelog
* Thu Oct 23 2008 Pixel <pixel@mandriva.com> 4.4.8-22.1mdv2008.0
+ Revision: 296732
- handle "rpmlib(PayloadIsLzma) <= 4.4.2.2-1" pkgs (mdv2009.0 has a few such pkgs) (#45227)

* Tue Oct 02 2007 Pixel <pixel@mandriva.com> 4.4.8-22mdv2008.0
+ Revision: 94448
- fix rpm allowing to remove a package which is both suggested and required (#34342)

* Fri Sep 28 2007 Pixel <pixel@mandriva.com> 4.4.8-21mdv2008.0
+ Revision: 93603
- remove global RPMLOCK, it doesn't seem to fix rpmdb issues, and may cause
  installer to crash

* Thu Sep 27 2007 Pixel <pixel@mandriva.com> 4.4.8-20mdv2008.0
+ Revision: 93272
- patch global-RPMLOCK:
  o fix rebuilddb (#34181)
  o don't lock when querying the db as non-superuser
  o fix locking in shared mode (ie fix typo)
  o remove message "RPMLOCK_NOWAIT should have been set!"
    which can't be done reliably
  o more debug messages about RPMLOCK

* Wed Sep 26 2007 Pixel <pixel@mandriva.com> 4.4.8-19mdv2008.0
+ Revision: 93120
- patch global-RPMLOCK:
  o allow rpm to not wait on lock when RPMLOCK_NOWAIT is set
  o ensure we don't have a dead-lock in package scriptlets which call "rpm -q"
    (eg: dkms). but it will die with an error
  o do create /var/lib/rpm directory when needed (as done in rpmdb/db3.c)
  o use flock instead of fcntl+F_SETLK
    (so that we really ensure the same process doesn't open twice the db)
  (still need not to lock when accessing in shared mode with not enough rights
  to write RPMLOCK)
- fix creating /RPMLOCK instead of /var/lib/rpm/RPMLOCK

* Mon Sep 24 2007 Pixel <pixel@mandriva.com> 4.4.8-18mdv2008.0
+ Revision: 92580
- do not use __db* files anymore, make them private
- (re-)add a global lock to ensure everything is correct
  (to ensure doing "rpm -qa" is always correct even if an upgrade is in
  progress)
- fix rpm -K segfaulting on corrupted header (#33735)

* Mon Sep 10 2007 Pixel <pixel@mandriva.com> 4.4.8-17mdv2008.0
+ Revision: 84150
- make "rpm -bb --quiet" quiet as should be

* Thu Sep 06 2007 Pixel <pixel@mandriva.com> 4.4.8-16mdv2008.0
+ Revision: 81086
- bug fix release, fix stupid typo in /etc/platform32 reading patch

* Thu Sep 06 2007 Pixel <pixel@mandriva.com> 4.4.8-15mdv2008.0
+ Revision: 80965
- really allow to use "linux32 rpm -bb" instead of "linux32 rpm -bb --target x86_64"
  (it uses /etc/rpm/platform32)

* Wed Sep 05 2007 Pixel <pixel@mandriva.com> 4.4.8-13mdv2008.0
+ Revision: 79852
- allow to use "linux32 rpm -bb" instead of "linux32 rpm -bb --target x86_64"
  (for this to work, %%{_host_cpu32} must be set in rpm-mandriva-setup)

* Thu Aug 30 2007 Pixel <pixel@mandriva.com> 4.4.8-12mdv2008.0
+ Revision: 75298
- fix popt.h (remove N_) (#31397)

* Wed Aug 29 2007 Pixel <pixel@mandriva.com> 4.4.8-11mdv2008.0
+ Revision: 74355
- add patch to speedup simple "rpm -e" or "rpm -U"
- make find-lang --with-gnome picks up omf files (rhbz#251400) (rpm.org patch)
- add the bug number fixed

* Tue Aug 21 2007 Pixel <pixel@mandriva.com> 4.4.8-10mdv2008.0
+ Revision: 68566
- patch fixing parse_hdlist (and so genhdlist2) on heavy loaded boxes
- fix segfault on weird rpm that used to work (#32102)
- remove recursive %%_mandir (and don't keep it, it's not needed anymore)

  + Thierry Vignaud <tvignaud@mandriva.com>
    - replace %%{_datadir}/man by %%{_mandir}!
    - replace %%_datadir/man by %%_mandir!

* Sat Aug 18 2007 Oden Eriksson <oeriksson@mandriva.com> 4.4.8-9mdv2008.0
+ Revision: 65549
- don't provide these files twice:
 /usr/lib/rpm/rpmdb_deadlock
 /usr/lib/rpm/rpmdb_dump
 /usr/lib/rpm/rpmdb_load
 /usr/lib/rpm/rpmdb_loadcvt
 /usr/lib/rpm/rpmdb_stat
 /usr/lib/rpm/rpmdb_svc
 /usr/lib/rpm/rpmdb_verify
 they are now only provided in the main rpm package, and not
 also in the devel package. that is the way to go according to
 jbj.

  + Thierry Vignaud <tvignaud@mandriva.com>
    - fix URL

* Mon Aug 06 2007 Pixel <pixel@mandriva.com> 4.4.8-8mdv2008.0
+ Revision: 59505
- do not use nptl on any arch (since x86_64 specific issues seem to disappear
  when using same locking mechanism as x86) (may fix #32102)
- fix segfault occuring with some old rpm v3 from urpmi test cases
- allow building --with debug
- restore do-check-free-size-when-bavail-is-0 patch (after rediff)

* Wed Jul 25 2007 Olivier Thauvin <nanardon@mandriva.org> 4.4.8-7mdv2008.0
+ Revision: 55450
- fix #31535: lowercase OS tag to compare against platform
- use upstream patch

  + Per Øyvind Karlsen <peroyvind@mandriva.org>
    - add requires on lzma

* Fri Jul 06 2007 Olivier Thauvin <nanardon@mandriva.org> 4.4.8-6mdv2008.0
+ Revision: 48984
- fix config file replace when not yet in db
- kill not bad macros definition
- find-lang is now a perl script

* Fri Jun 22 2007 Anssi Hannula <anssi@mandriva.org> 4.4.8-5mdv2008.0
+ Revision: 42672
- require arch-specific libpopt and libpopt-devel
- add back dropped librpm-devel and libpopt-devel provides

* Wed Jun 20 2007 Olivier Thauvin <nanardon@mandriva.org> 4.4.8-4mdv2008.0
+ Revision: 41943
- fix buildreq for autoconf/automake
- apply new devel policy

* Tue Jun 19 2007 Olivier Thauvin <nanardon@mandriva.org> 4.4.8-3mdv2008.0
+ Revision: 41414
- kill coloring patch, buggy, and not so usefull
- patch116: fix rpm -V output (#31287)

* Sun Jun 10 2007 Olivier Thauvin <nanardon@mandriva.org> 4.4.8-2mdv2008.0
+ Revision: 37847
- patch115: avoid breakage of conectiva --without bm feature
- remove patch 110, add patch114: do no longer use rpmrc, using only macros instead, so requiring latest rpm-mandriva-setup to have /etc/rpm/platform
- fix perl module release
- patch to backport _docdir_fmt macro
- 4.4.8
  o rediff patch 72, 87, 49, 62, 17, 56, 64
  o kill patch (merge or fix upstream, woot):
    57, 80, 90, 93, 193, 95, 96, 97, 99, 103, 104, 105, 109, 110, 111,
    112, 114, 115, 101, 102, 107
  o kill patch 69, hard to maintain, will be merge upstream
  o Patch109: workaround specfile parsing check,
    http://rpm5.org/cvs/tktview?tn=6
  o Patch110: still read rpmrc (this should die one day)
  o Patch111: trim twice / in buildroot, making unpackaged files check failing
  o Patch112: avoid a very issue regarding Fopen()

  + Per Øyvind Karlsen <peroyvind@mandriva.org>
    - use %%{ix86} & %%{sunsparc} macros for x86 & sparc
    - use %%{sunsparc} macro to ensure sparcv9 gets included too

  + Pixel <pixel@mandriva.com>
    - make it explicit that older perl-URPM are not compatible with 4.4.8
    - add patches 112 113 114 115 from both rpm 4.4.9 and hg.rpm.org
    - cleanup provides-obsoleted.patch, moving other fixes into rebuilddb-with-root.patch
    - more complete fix-segfault-on-header-without-RPMTAG_NAME patch (from upstream)
    - don't segfault on header without RPMTAG_NAME
    - add requires pkgconfig in rpm-build (#30632)
      (it is needed for performing automatic computation of pkgconfig files
      dependencies, see /usr/lib/rpm/mandriva/pkgconfigdeps.sh)
    - add patch (ensure-uninst-callback-is-called-for-empty-packages)
      to allow urpmi to display "remove package foo" when removing an empty package

* Wed Apr 25 2007 Adam Williamson <awilliamson@mandriva.com> 4.4.6-22mdv2008.0
+ Revision: 18290
- rebuild against new beecrypt


* Wed Feb 14 2007 Pixel <pixel@mandriva.com> 4.4.6-21mdv2007.1
+ Revision: 120751
- fix parsing ")" (for if statements in spec files for example)
- rpm handles nicely failing %%pre, but it doesn't handle the rest
- patch to use dgettext instead of gettext to allow progs like urpmi to use
  their own textdomain and still have rpm translations
- fix checking available free space when "non-superuser free space" is 0

  + Gwenole Beauchesne <gbeauchesne@mandriva.com>
    - requires newer rpm-mandriva-setup for rtld(GNU_HASH) notes

* Fri Jan 12 2007 Pixel <pixel@mandriva.com> 4.4.6-19mdv2007.1
+ Revision: 108072
- P98: security fix for CVE-2006-5466
-mv8 which is deprecated and no longer valid (Per Oyvind, #26501)

  + Thierry Vignaud <tvignaud@mandriva.com>
    - provides with unexpanded macros aren't that nice

* Mon Jan 08 2007 Pixel <pixel@mandriva.com> 4.4.6-18mdv2007.1
+ Revision: 105990
- fix bug 27987 where sslexplorer rpm has "Source RPM: (none)" and so rpm
  thought it is a src.rpm. the fix is only done for old v3 rpms
- "rpm -i --root" as user can't work, don't silently ignore the failing chroot()
- fix --root rpm option failing for non-root users (Christiaan Welvaart)
- really commit the patch
- fix segfault on weird buggy rpm header
- fix query format xml on rpm header with tag 265 which has no name (#27108)

* Fri Dec 08 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 4.4.6-12mdv2007.1
+ Revision: 93842
- generate PIC code for static objects that can be built into a DSO
- remove (obsolete) arch-dependent flags
- don't build statically linked executables
- Fix zlib tree to parallel build, propagate optflags to there too.
- Introduce new ppc32 arch, fix ppc64 bi-arch builds, fix ppc builds on newer CPUs.
- fix build on ppc64

  + Pixel <pixel@mandriva.com>
    - fix segfault on some old format rpms (#27263)

* Thu Nov 30 2006 Pixel <pixel@mandriva.com> 4.4.6-11mdv2007.1
+ Revision: 88894
- rebuild for python  2.5
- add patches fixing #26545:
  o don't leave behind /usr/X11R6/lib/X11/app-defaults;456ac510 on error
  o fix segfault
- ignore getcwd failing (db_abshome will not be set,
  it may affect db/log/log_archive.c, but that should be ok) (#20897)
- fix "rpm -bs t.spec" returning buggy error message
  "t.spec: No such file or directory" when rpm-build is not installed
- fix free on invalid pointer after displaying "Unable to open temp file" (#27260)
- have a nice error message when chroot fails
  (instead of the dreaded: "enterChroot: Assertion `xx == 0' failed.")

  + Gwenole Beauchesne <gbeauchesne@mandriva.com>
    - Extend #27260 fix to its root cause as there are other instances of a
      similar bug in other sources (yet, unexposed/reported).

* Fri Sep 15 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.6-10mdv2007.0
+ Revision: 61429
- Bump release number
- Improve previous patch: make it conditional on the environment variable RPM_IGNORE_SCRIPTLETS_FAILURE
- Allow preinstall scriptlets to fail and not interrupting the installation.
  This is a workaround for bug 25598.

* Sat Aug 19 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-9mdv2007.0
+ Revision: 56766
- bump release
- revert to my own chroot patch, thee second one is broken

* Sun Aug 13 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-8mdv2007.0
+ Revision: 55706
- bump release
- buildrequires lua-devel
- import mailscanner
- update patch with C. Welvaart fixes

  + Rafael Garcia-Suarez <rgarciasuarez@mandriva.com>
    - Fix typos

* Sat Jul 29 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-7mdv2007.0
+ Revision: 42481
- bump release
- add upstream patch97: fix dbenv
- patch96: fix #23774

* Thu Jul 27 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-6mdv2007.0
+ Revision: 42186
- fix rpmv3 patch: rpm version in the lead in 3 for both rpm 3 and 4
- fix #23075: patch 95, use tee -a

* Wed Jul 26 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-5mdv2007.0
+ Revision: 42052
- patch93: support rpm v3
- bump release
- ensure leaveChroot can't be run by another function which is not the the caller of enterChroot
- remove changelog from spec
- add patch 93 (disable by default, need tests) to fix issue in rpmdb when mixing 'rpm --root' and 'chroot rpm'
- update macros in the spec
- provide some /etc/rpm files
- -3mdv release
- fix patch in patch
- better rpmdb.h c++ fix
- Patch90: fix unchecked end of line in macro expand
- patch 89: make rpmdb.h compliant
- file in /etc are %%config
- patch 88: readd SOURCEPACKAGE tag to source rpm
- make no_dirname_dep patch configurable with a macro
- bunzip patch, merge rpm 4.4.6
- initial import of rpm
- initial import of rpm

  + Rafael Garcia-Suarez <rgarciasuarez@mandriva.com>
    - 4.4.6-4mdk
    - Patch by Pixel to use --wildcards when using tar to list all specfiles in a tar
      ball (this fixes rpm -t).
    - Add patch 91: avoids taking into account duplicates in file list
      when checking for unpackaged files

* Wed Jul 12 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.6-4mdv2007.0
- Fix rpm -ta (Pixel)

* Thu Jun 22 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-3mdv2007.0
- patchs:
  - fix rpmdb.h c++ compilation (C. Welvaart)
  - fix unchecked end of string in macro expand (O. Thauvin)
  - fix check unpackaged files script (R. Garcia-Suarez)
- update macros provide by the spec used for bootstraping
- set some /etc/rpm/macros.* as config(noreplace)

* Mon Jun 12 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-2mdv2007.0
- Patch88: readd SOURCEPACKAGE tag into src.rpm

* Fri May 26 2006 Olivier Thauvin <nanardon@mandriva.org> 4.4.6-1mdv2007.0
- 4.4.6
- rediff patches
- add patch to disable dirnames dependencies for now

* Tue Mar 21 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.5-2mdk
- Require latest rpm-mandriva-setup

* Tue Mar 14 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.5-1mdk
- 4.4.5
- Remove patches 41 and 87, merged upstream
- Rediff patches 69 and 78
- Make rpm-build require libtool-base instead of libtool (bug #21162)
- Turn the triggerun in post scriptlet

* Tue Mar 07 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.4-4mdk
- Patch 87

* Tue Feb 07 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.4-3mdk
- Move popt(3) man page into libpopt-devel (bug 18161)
- Add coreutils in prerequisites (bug 19144)
- Fix dangling symlink (bug 6788)

* Tue Jan 17 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.4-2mdk
- Patch 86: don't cache Depends DB (Olivier Thauvin)
- Bump requires on rpm-mandriva-setup

* Thu Jan 05 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.4-1mdk
- New version 4.4.4
- Rediff patches 31, 49, 62, 69, 71, 78, 82, 84
- Remove patch 66 (fixed upstream)
- Remove patch 74 (no longer necessary, no legacy prereqs anymore)
- Remove patch 76 (should be unnecessary now that RH bug 151255 is fixed)
- Remove patch 79 (applied upstream)
- Remove patch 81 (does nothing)
- New subpackage perl-RPM, and patch 85 to install it in vendor dir
- Use static libneon, libsqlite3 and libopenssl
- Update condition for triggerun
- Add conditional BuildRequires on nptl-devel
- Disable popt tests
- Remove selinux
- Requires recent rpm-mandriva-setup for _rpmlock_path macro

* Sun Nov 13 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.2-6mdk
- rebuild for openssl (ask by Oden)

* Sun Oct 23 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.2-5mdk
- Fix #19392

* Fri Sep 16 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 4.4.2-4mdk
- buildrequires: rpm-mandriva-setup-build
- fix simple coloring patch, aka merge it correctly
- re-add the no-doc-conflicts patch for colored packages

* Tue Aug 30 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.2-3mdk
- patch 80: fix #17774
- patch 81, 82: should fix ordering issue
- BuildRequires: bzip2-devel (thanks Christian)

* Sat Aug 20 2005 Frederic Lepied <flepied@mandriva.com> 4.4.2-2mdk
- 79: fix deadlock from RedHat bug #146549.

* Fri Jul 22 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.2-1mdk
- 4.4.2
- remove patch:
    52: merged upstream
    67: fixed upstream
    73: merged upstream
    78: merged upstream
    79: merged upstream
    32, 33, 36: no more need hack
- rename rpm-python to python-rpm    
- use fnctl when not using futex
- use nptl only on few arches (ppc* x86_64 pentium3,4/Athlon)

* Thu Jun 23 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-10mdk
- add requires to rpm-build after the rpm-mandriva-setup split

* Tue Jun 21 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-9mdk
- Enable NPTL and co
- rework patch77: allow %%_srcdefattr as macro for src.rpm
- Patch78: reread few macro between build
- Patch79: fix rpm --eval '%%' overflow

* Fri Jun 17 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.1-8mdk
- Move dependencies on unzip, make and elfutils from rpm to rpm-build

* Sun Jun 05 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-7mdk
- patch77: allow to set root/root as owner of files in src.rpm
- rebuild with neon 0.24 as it moved in main instead 0.25

* Thu Jun 02 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.1-6mdk
- Patch 76 : allow to rebuild db with --root option

* Wed May 18 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-5mdk
- update french translation
- disable NPTL system + --with to enable it
- --w/o pyhton switch
- remove db_private patch as it breaks concurrent access

* Mon May 16 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-4mdk
- really apply patch (I sucks)
- some cleaning

* Mon May 16 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-3mdk
- Patch71: Ordering transaction on erasure
- Patch72: rpm -[Ui] check files conflicts
- Patch73,74: Fedora patch, fixing bug

* Fri May 13 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-2mdk
- patch70: allow rpm -bb --short-circuit
- conflicts man-pages-pl < 0.4-9mdk
- move spec mode for emacs into rpm-mandriva-setup
- buildrequires
- remove locales files from libpopt

* Wed May 11 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 4.4.1-1mdk
- Adapt part of the coloring patch (patch 62)
- Fix a few French translations (patch 69)
- Require libneon 0.25

* Mon May 09 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-0.7mdk
- BuildRequires readline-devel (P.O. Karlsen)
- --disable-{posixmutexes,pthreadsmutexes} on sparc (P.O. Karlsen)
- patch68: being able to read old rpms
- update source url
- fix file list for ppc (C. Welvaart)

* Fri May 06 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-0.6mdk
- use system sqlite
- force -fPIC on amd64 (for popt)
- perform test for popt
- patch67 fix build with gcc4

* Wed May 04 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-0.5mdk
- workaround make -j

* Wed May 04 2005 Olivier Thauvin <nanardon@mandriva.org> 4.4.1-0.4mdk
- 4.4.1
- remove biarch, use mklibname (see 4.2.3-10mdk)
- do no longer patch the config, use /usr/lib/rpm/VENDOR/rpmrc instead
- require rpm-mandriva-setup
- remove many obsoletes patch
- do not longer provide update-alternative
- more defined macros in the spec, less hardcode patch

* Tue May 03 2005 Pixel <pixel@mandriva.com> 4.2.3-11mdk
- emacs spec mode:
  - use rpm-find-spec-version-with-shell by default, and enhance it
  - handle release built using mkrel macro (in rpm-increase-release-tag)

* Thu Apr 28 2005 Olivier Thauvin <nanardon@mandriva.org> 4.2.3-10mdk
- split libs into separated package to make rpm update easier for URPM

* Thu Mar 10 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-9mdk
- bump multiarch-utils requires
- ignore conflicts in gnome-doc html files, install the latest files

* Wed Mar 09 2005 Frederic Lepied <flepied@mandrakesoft.com> 4.2.3-8mdk
- fix tr call in mono patch (bug #14449)
- fix bzip2 call (bug #7663)
- encode ru man pages in KOI8-R (bug #10219 and #12613)

* Fri Feb 25 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-8mdk
- hack to always install the latest arch-independent gtk-doc html
  files and man pages, aka. don't conflict on biarch platforms

* Fri Feb 25 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-7mdk
- popt is now a biarch package

* Thu Feb 24 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-6mdk
- requires multiarch-utils >= 1.0.7-1mdk
- RPM_INSTALL_LANG support is obsolete for MDK >= 10.2 (rafael)

* Tue Feb 08 2005 Frederic Lepied <flepied@mandrakesoft.com> 4.2.3-5mdk
- added mkrel macro (Buchan)
- changed group System/X11 from System/XFree86

* Thu Jan 27 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-4mdk
- newer multiarch-utils requires
- generate package script autoreqs only if requested (#13268)
- don't install .delta.rpm directly, use applydeltarpm first (SuSE)

* Mon Jan 24 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-3mdk
- minor cleanups
- check for files that ought to be marked as %%multiarch

* Thu Jan 20 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-2mdk
- newer multiarch-utils requires
- enable and improve file coloring
  * use file colors even if still using the external dependencies generator
  * assign a color to *.so symlinks to mix -devel packages
  * assign a color to *.a archives to mix -{static,}-devel packages

* Fri Jan 14 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-1mdk
- multiarch-utils autoreq
- allow build of 32-bit RPMs on x86-64
- ppc64 fixes
- update from 4.2-branch
  * auto-relocation fixes on ia64
  * change default behavior to resolve file conflicts as LIFO
  * generate debuginfo for setuid binaries

* Fri Jan 07 2005 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-19mdk
- compile --with-glob to avoid a problem with the internal glob code.

* Thu Jan 06 2005 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 4.2.2-18mdk
- Add patch 60 (Guillaume Rousse): make find-requires ignore dependencies on
  linux-incompatible perl modules. (bug #12695)

* Mon Dec 06 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 4.2.2-17mdk
- Add patch 59, necessary for the smart package manager (new function
  rpmSingleHeaderFromFD() in the python bindings)

* Sat Dec 04 2004 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-16mdk
- rebuild for python 2.4

* Fri Aug 06 2004 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-15mdk
- use system zlib

* Thu Jul 29 2004 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-14mdk
- fix mono patch (bug #7201)

* Wed Jul 28 2004 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-13mdk
- use mono-find-requires and mono-find-provides if present (Götz Waschk) (bug #7201)

* Wed Jul 28 2004 Frederic Lepied <flepied@mandrakesoft.com> 4.2.2-12mdk
- use a correct implementation of cpuid (Gwenole)
- return None instead of [] in rpm-python (Paul Nasrat)
- add /var/spool/repackage (bug #9874)
- handle /usr/lib/gcc/ directories for devel() deps too (Gwenole)

* Thu May 20 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.2-10mdk
- switch back to x86_64 packages on 64-bit extended platforms

* Fri May 14 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.2-9mdk
- fix /usr/lib/rpmpopt symlink
- use -mtune=pentiumpro on any MDK >= 10.0

* Fri Apr 16 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 4.2.2-8mdk
- When unlocking the RPMLOCK file, don't forget to close(2) it too.