rpm/rpm.spec

414 lines
14 KiB
RPMSpec

#
# spec file for package rpm (Version 4.4.2.3)
#
# Copyright (c) 2009 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
License: GPL v2 or later
Group: System/Packages
BuildRequires: libbz2-devel libelf-devel libselinux-devel ncurses-devel xz-devel zlib-devel
Provides: rpminst
%define popt_version 1.7
PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on
Summary: The RPM Package Manager
Version: 4.4.2.3
Release: 45
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
Patch1: beecrypt-4.1.2.diff
Patch2: db.diff
# quilt patches start here
Patch10: debugedit.diff
Patch11: findfplistexclude.diff
Patch12: localetag.diff
Patch13: missingok.diff
Patch14: nameversioncompare.diff
Patch15: chownwarn.diff
Patch16: dbfsync.diff
Patch17: dbrointerruptable.diff
Patch18: diskspace.diff
Patch19: extcond.diff
Patch20: globlstat.diff
Patch21: nodefattr.diff
Patch22: luaroot.diff
Patch23: refreshtestarch.diff
Patch24: rpmrctests.diff
Patch25: suspendlock.diff
Patch26: tagsbackport.diff
Patch27: waitlock.diff
Patch28: dbprivate.diff
Patch29: legacyprereq.diff
Patch30: weakdeps.diff
Patch31: autodeps.diff
Patch32: brp.diff
Patch33: brpcombress.diff
Patch34: checkfilesnoinfodir.diff
Patch35: finddebuginfo.diff
Patch36: findksyms.diff
Patch37: findlang.diff
Patch38: macrosin.diff
Patch39: modalias.diff
Patch40: platformin.diff
Patch41: rpmpopt.diff
Patch42: rpmrc.diff
Patch43: patchrpms.diff
Patch44: taggedfileindex.diff
Patch45: rpmqpack.diff
Patch46: convertdb1static.diff
Patch47: build.diff
Patch48: modalias-kernel_module.diff
Patch49: files.diff
Patch50: popt-to-lib.diff
Patch51: debugedit-comp-dir.diff
Patch52: perlprov.diff
Patch53: rpm-shorten-changelog.diff
Patch54: lzma-payload.diff
Patch55: lzma-payload-2.diff
Patch56: debugsource-package.diff
Patch57: whatrequires-doc.diff
Patch58: remove-brp-strips.diff
Patch59: requires-ge-macro.diff
Patch60: mimetype.diff
Patch61: debugedit-canon-fix.diff
Patch62: fingerprint.diff
Patch63: finddebuginfo-absolute-links.diff
Patch64: firmware.diff
Patch65: specfilemacro.diff
Patch66: rpm-filelist-bufferoverflow.diff
Patch67: modalias-encode.diff
Patch68: disttag-macro.diff
Patch69: buildidprov.diff
Patch70: xz.diff
Patch71: debugsubpkg.diff
Patch72: debuglink.diff
Patch73: elfflagreqprov.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 <ewt@redhat.com>
Marc Ewing <marc@redhat.com>
%package devel
Summary: Include Files and Libraries mandatory for Development
License: GPL v2 or later
Group: System/Packages
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 <ewt@redhat.com>
Marc Ewing <marc@redhat.com>
%package devel-static
Summary: Include Files and Libraries mandatory for Development
License: GPL v2 or later
Group: System/Packages
Requires: rpm-devel = %{version}
Requires: zlib-devel bzip2 libbz2-devel xz-devel libselinux-devel libebl-devel
%description devel-static
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 <ewt@redhat.com>
Marc Ewing <marc@redhat.com>
%prep
%setup -q -n rpm-%{version}
rm -rf sqlite
rm -rf beecrypt
tar xjf %{SOURCE10}
ln -s beecrypt-4.1.2 beecrypt
#tar xjf %{SOURCE12}
#ln -s neon-0.24.7 neon
# will get linked from db3
rm -f rpmdb/db.h
# separate popt source
# %setup -q -D -T -a 9
# mv popt popt.orig
# ln -s popt-%{popt_version} popt
%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
%patch71 -p1
%patch72 -p1
%patch73 -p1
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
%build
%{?suse_update_config:%{suse_update_config -f popt}}
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -ffunction-sections"
export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections"
%ifarch alpha
export CFLAGS="-g -O0 -fno-strict-aliasing"
%endif
#cp popt/autogen.sh zlib
rm -rf zlib
cp /usr/share/gettext/config.rpath .
cp popt/autogen.sh beecrypt
cp popt/autogen.sh file
# cp popt/autogen.sh neon
./autogen.sh --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} --libdir=/usr/lib --sysconfdir=/etc --localstatedir=/var --with-lua --with-selinux --enable-shared
rm po/de.gmo
make %{?jobs:-j%jobs}
%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
# remove .la file and the static variant of libpopt
# have to remove the dependency from other .la files as well
rm -f $RPM_BUILD_ROOT/%_lib/libpopt.a $RPM_BUILD_ROOT/%_lib/libpopt.la
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
mv $RPM_BUILD_ROOT/usr/src/* $RPM_BUILD_ROOT/usr/src/packages
mkdir -p $RPM_BUILD_ROOT/var/lib/rpm
mkdir -p $RPM_BUILD_ROOT/var/spool/repackage
rm -rf $RPM_BUILD_ROOT/usr/include/beecrypt $RPM_BUILD_ROOT/%{_libdir}/libbeecrypt*
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
find $RPM_BUILD_ROOT/usr/src/packages/* -type d | sed -e "s@$RPM_BUILD_ROOT@@" > $RPM_BUILD_ROOT/usr/lib/rpm/permlist
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
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 $RPM_BUILD_ROOT%{_libdir}/*.la
#rm $RPM_BUILD_ROOT%{_libdir}/*.a
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{fillup_only -an services}
%run_permissions
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
%postun
%{insserv_cleanup}
%verifyscript
%verify_permissions -f /usr/lib/rpm/permlist
%files
%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}/librpm*-*.so
%doc %{_mandir}/man[18]/*.[18]*
/usr/share/locale/*/LC_MESSAGES/rpm.mo
%dir /var/lib/rpm
%dir /var/spool/repackage
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/BUILD
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SPECS
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SOURCES
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SRPMS
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/RPMS
%verify(not mode) %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}/librpmdb.so
%{_libdir}/librpmio.so
%files devel-static
%defattr(644,root,root,755)
%{_libdir}/librpm*.a
%{_libdir}/librpm*.la
%package -n popt
Summary: A C library for parsing command line parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 493
# bug437293
%ifarch ppc64
Obsoletes: popt-64bit
%endif
#
#
%description -n popt
Popt is a C library for parsing command line parameters. Popt was
heavily influenced by the getopt() and getopt_long() functions. 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.
Authors:
--------
Erik Troan <ewt@redhat.com>
%package -n popt-devel
Summary: C Library for Parsing Command Line Parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 493
Requires: popt = 1.7
Requires: glibc-devel
# bug437293
%ifarch ppc64
Obsoletes: popt-devel-64bit
%endif
#
%description -n popt-devel
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.
Authors:
--------
Erik Troan <ewt@redhat.com>
%post -n popt -p /sbin/ldconfig
%postun -n popt -p /sbin/ldconfig
%files -n popt
%defattr(-,root,root)
/%{_lib}/libpopt.so.*
/usr/share/locale/*/LC_MESSAGES/popt.mo
%files -n popt-devel
%defattr(644,root,root,755)
/usr/include/popt.h
/%{_lib}/libpopt.so
%doc %{_mandir}/man3/popt.3*
%changelog