#
# TODO:
-# - update patches
-# - build popt from rpm.spec? (no separate popt-1.10.x tarballs available)
-# - consider using system libmagic not internal libfmagic
-# (but internal has different method of passing output)
-# - after ac drop amd64 patch and make x86_64 generic arch + subarchs amd64 and ia32e
+# - python(abi) cap is not provided automatically (because /usr/bin/python matches
+# ELF first; it should be provided by python-libs not binary anyway)
#
# Conditional build:
-%bcond_with distver # build with distversion field
-%bcond_with static # build static rpmi (not supported at the moment)
-%bcond_without apidocs # don't generate documentation with doxygen
-%bcond_without pkgnameinautoreq # don't put package name in autogenerated dependancy
-%bcond_without python # don't build python bindings
-%bcond_without selinux # dont enable selinux support
+%bcond_with static # build static rpmi (not supported at the moment)
+%bcond_without apidocs # don't generate documentation with doxygen
+%bcond_with autoreqdep # autogenerate package name deps in addition to sonames/perl(X)
+%bcond_without python # don't build python bindings
+%bcond_without selinux # build without selinux support
+%bcond_without system_libmagic # don't use system libmagic
+%bcond_with neon # build with HTTP/WebDAV support (neon library)
# force_cc - force using __cc other than "%{_target_cpu}-pld-linux-gcc"
# force_cxx - force using __cxx other than "%{_target_cpu}-pld-linux-g++"
# force_cpp - force using __cpp other than "%{_target_cpu}-pld-linux-gcc -E"
-%define snap 20041121
# versions of required libraries
-%define reqdb_ver 4.2.50-1
-%define reqpopt_ver 1.9
-%define beecrypt_ver 2:4.1.0
-%define rpm_macros_rev 1.183
+%define reqdb_ver 4.3.27-1
+%define reqpopt_ver 1.10.2
+%define beecrypt_ver 2:4.1.2-4
+%define rpm_macros_rev 1.238
Summary: RPM Package Manager
Summary(de): RPM Packet-Manager
Summary(es): Gestor de paquetes RPM
Summary(uk): íÅÎÅÄÖÅÒ ÐÁËÅÔ¦× ×¦Ä RPM
Name: rpm
%define sover 4.4
-Version: 4.4.1
-Release: 0.1
+Version: 4.4.2
+Release: 4
License: GPL
Group: Base
-#Source0: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.2.x/%{name}-%{version}.%{snap}.tar.gz
-# Snap tarball is generated from rpm-4_4 branch
Source0: ftp://jbj.org/pub/rpm-4.4.x/%{name}-%{version}.tar.gz
-# Source0-md5: 90ded9047b1b69d918c6c7c7b56fd7a9
+# Source0-md5: e24ce468082479fe850c9d6563f56db5
Source1: %{name}.groups
Source2: %{name}.platform
Source3: %{name}-install-tree
Patch16: %{name}-php-deps.patch
Patch17: %{name}-ldconfig-always.patch
Patch18: %{name}-perl_req.patch
-Patch19: %{name}-no-bin-env.patch
+
Patch20: %{name}-magic-usesystem.patch
Patch21: %{name}-dontneedutils.patch
Patch22: %{name}-provides-dont-obsolete.patch
Patch23: %{name}-examplesaredoc.patch
Patch24: %{name}-po.patch
-Patch25: %{name}-amd64.patch
+Patch25: %{name}-getcwd.patch
Patch26: %{name}-notsc.patch
Patch27: %{name}-hack-norpmlibdep.patch
Patch28: %{name}-makefile-no_myLDADD_deps.patch
Patch35: %{name}-perl_req-INC_dirs.patch
Patch36: %{name}-debuginfo.patch
Patch37: %{name}-doxygen_hack.patch
-Patch38: %{name}-distver.patch
-Patch39: %{name}-gcc4.patch
-URL: http://www.rpm.org/
+
+Patch39: %{name}-pythondeps.patch
+Patch40: %{name}-print-requires.patch
+Patch41: %{name}-reduce-stack-usage.patch
+Patch42: %{name}-glob.patch
+Patch43: %{name}-patch-quote.patch
+Patch44: %{name}-no-neon.patch
+Patch45: %{name}-no-sqlite.patch
+Patch46: %{name}-mono.patch
+Patch47: %{name}-posttrans.patch
+URL: http://wraptastic.org/
Icon: rpm.gif
BuildRequires: autoconf >= 2.52
BuildRequires: automake
BuildRequires: beecrypt-devel >= %{beecrypt_ver}
-BuildRequires: bzip2-devel >= 1.0.1
+BuildRequires: bzip2-devel >= 1.0.2-17
BuildRequires: db-devel >= %{reqdb_ver}
%{?with_apidocs:BuildRequires: doxygen}
-BuildRequires: elfutils-devel
+BuildRequires: elfutils-devel >= 0.108
BuildRequires: findutils
BuildRequires: gettext-devel >= 0.11.4-2
-#BuildRequires: libmagic-devel
+%{?with_system_libmagic:BuildRequires: libmagic-devel}
%{?with_selinux:BuildRequires: libselinux-devel >= 1.18}
# needed only for AM_PROG_CXX used for CXX substitution in rpm.macros
BuildRequires: libstdc++-devel
BuildRequires: libtool
+%if %{with neon}
BuildRequires: libxml2-devel
BuildRequires: neon-devel >= 0.24.7-3
+%endif
BuildRequires: patch >= 2.2
BuildRequires: popt-devel >= %{reqpopt_ver}
-%{?with_python:BuildRequires: python-devel >= 2.2}
-BuildRequires: python-modules >= 2.2
+%{?with_python:BuildRequires: python-devel >= 1:2.3}
+BuildRequires: python-modules >= 1:2.3
BuildRequires: readline-devel
BuildRequires: rpm-perlprov
-BuildRequires: rpm-pythonprov
+%{?with_python:BuildRequires: rpm-pythonprov}
BuildRequires: zlib-devel
%if %{with static}
# Require static library only for static build
BuildRequires: beecrypt-static >= %{beecrypt_ver}
-BuildRequires: bzip2-static >= 1.0.2-5
+BuildRequires: bzip2-static >= 1.0.2-17
BuildRequires: db-static >= %{reqdb_ver}
BuildRequires: glibc-static >= 2.2.94
BuildRequires: elfutils-static
-#BuildRequires: libmagic-static
+%{with_system_libmagic:BuildRequires: libmagic-static}
%{?with_selinux:BuildRequires: libselinux-static >= 1.18}
BuildRequires: popt-static >= %{reqpopt_ver}
BuildRequires: zlib-static
# don't require very fresh rpm.macros to build
%define __gettextize gettextize --copy --force --intl ; cp -f po/Makevars{.template,}
-%define ix86 i386 i486 i586 i686 athlon pentium3 pentium4
+%define ix86 i386 i486 i586 i686 athlon pentium3 pentium4
+%define x8664 amd64 ia32e x86_64
# stabilize new build environment
%define __newcc %{?force_cc}%{!?force_cc:%{_target_cpu}-pld-linux-gcc}
Summary: RPMs library
Summary(pl): Biblioteki RPM-a
Group: Libraries
+Requires: beecrypt >= %{beecrypt_ver}
Requires: db >= %{reqdb_ver}
-%{?with_selinux:BuildRequires: libselinux >= 1.18}
+%{?with_selinux:Requires: libselinux >= 1.18}
+%{?with_system_libmagic:Requires: libmagic >= 1.15-2}
Requires: popt >= %{reqpopt_ver}
-%{?with_distver:Provides: rpm-lib(distver)}
+Obsoletes: rpm-libs
# avoid SEGV caused by mixed db versions
Conflicts: poldek < 0.18.1-16
Requires: db-devel >= %{reqdb_ver}
Requires: elfutils-devel
%{?with_selinux:Requires: libselinux-devel}
+%{?with_system_libmagic:Requires: libmagic-devel}
Requires: popt-devel >= %{reqpopt_ver}
Requires: zlib-devel
Requires: bzip2-static
Requires: db-static >= %{reqdb_ver}
Requires: elfutils-static
+%{?with_system_libmagic:Requires: libmagic-static}
Requires: popt-static >= %{reqpopt_ver}
Requires: zlib-static
Requires: cpio
Requires: diffutils
Requires: elfutils
-Requires: file >= 4.01
+Requires: file >= 4.14-1
Requires: fileutils
Requires: findutils
-%ifarch athlon
-Requires: gcc >= 3.0.3
-%else
-%ifarch i686
-# because of -mtune in rpmrc
Requires: gcc >= 5:3.4
-%else
-Requires: gcc
-%endif
-%endif
Requires: glibc-devel
Requires: grep
Requires: gzip
Requires: tar
Requires: textutils
Provides: rpmbuild(macros) = %{rpm_macros_rev}
+Provides: rpmbuild(monoautodeps)
Provides: rpmbuild(noauto) = 3
-# because of -fvisibility-inlines-hidden in rpm.macros
-Conflicts: gcc-c++ < 5:3.4
-%ifarch amd64
+%ifarch %{x8664}
Conflicts: automake < 1:1.7.9-2
Conflicts: libtool < 2:1.5-13
%endif
+Obsoletes: rpmbuild(macros) < %{rpm_macros_rev}
%description build
Scripts for building binary RPM packages.
Summary(pl): Makra u³atwiaj±ce tworzenie pakietów rpm z programami napisanymi w Pythonie
Group: Applications/File
Requires: %{name} = %{version}-%{release}
+Requires: python
Requires: python-modules
%description pythonprov
ze ¼rode³ RPM-a przez doxygen.
%prep
-%setup -q -n %{name}
+%setup -q
%patch1 -p1
%patch2 -p1
# temporarily moved after patch0 - messes too much in pl.po
%patch11 -p1
%patch12 -p1
%patch13 -p1
-# home-etc FIXME
-#%patch14 -p1
+%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
-%patch19 -p1
sed -e 's/^/@pld@/' %{SOURCE2} >>platform.in
cp -f platform.in macros.pld.in
echo '%%define __perl_provides %%{__perl} /usr/lib/rpm/perl.prov' > macros.perl
echo '# obsoleted file' > macros.python
echo '%%define __php_provides /usr/lib/rpm/php.prov' > macros.php
echo '%%define __php_requires /usr/lib/rpm/php.req' >> macros.php
+echo '%%define __mono_provides /usr/lib/rpm/mono-find-provides' > macros.mono
+echo '%%define __mono_requires /usr/lib/rpm/mono-find-requires' >> macros.mono
install %{SOURCE5} scripts/find-lang.sh
install %{SOURCE9} scripts/php.prov.in
install %{SOURCE10} scripts/php.req.in
%patch35 -p0
%patch36 -p1
%patch37 -p1
-%{?with_distver:%patch38 -p1}
%patch39 -p1
+%patch40 -p1
+%patch41 -p1
+%patch42 -p1
+%patch43 -p1
+%{!?with_neon:%patch44 -p1}
+%patch45 -p1
+%patch46 -p1
+%patch47 -p1
%patch0 -p1
%patch3 -p1
-cd scripts;
+cd scripts
mv -f perl.req perl.req.in
mv -f perl.prov perl.prov.in
cd ..
mv -f po/{no,nb}.po
mv -f po/{sr,sr@Latn}.po
-rm -rf neon zlib libelf db db3 popt rpmdb/db.h
+rm -rf sqlite zlib db db3 popt rpmdb/db.h
# generate Group translations to *.po
awk -f %{SOURCE6} %{SOURCE1}
mv -f ${f}.tmp $f
done
-# ... and make some cleanings
-rm -fr $(find ./ -type d -name CVS )
-rm -f $(find ./ -type f -name ".cvsignore" )
-
%build
+%if %{with system_libmagic}
+rm -rf file
+%else
cd file
%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__automake}
cd ..
+%endif
%{__libtoolize}
%{__gettextize}
-e 's|@host_cpu@|%{_target_cpu}|' macros.in > macros.tmp
mv -f macros.tmp macros.in
+CPPFLAGS="-Dglob=rpm_glob -Dglobfree=rpm_globfree"; export CPPFLAGS
+
# pass CC and CXX too in case of building with some older configure macro
%configure \
CC="%{__newcc}" \
CXX="%{__newcxx}" \
CPP="%{__newcpp}" \
+ %{?with_autoreqdep:--enable-adding-packages-names-in-autogenerated-dependancies} \
--enable-shared \
--enable-static \
- %{?with_apidoc:--with-apidocs} \
- %{?with_pkgnameinautoreq:--enable-adding-packages-names-in-autogenerated-dependancies} \
+ %{?with_apidocs:--with-apidocs} \
%{?with_python:--with-python=auto} \
%{!?with_python:--without-python} \
%{!?with_selinux:--without-selinux} \
+ --with-glob \
--without-db
# file_LDFLAGS, debugedit_LDADD - no need to link "file" and "debugedit" statically
debugedit_LDADD="\$(WITH_LIBELF_LIB) -lpopt"
# %{!?with_static:rpm_LDFLAGS="\$(myLDFLAGS)"} \
+
%{?with_apidocs:%{__make} doxygen}
%install
install macros.perl $RPM_BUILD_ROOT%{_rpmlibdir}/macros.perl
install macros.python $RPM_BUILD_ROOT%{_rpmlibdir}/macros.python
install macros.php $RPM_BUILD_ROOT%{_rpmlibdir}/macros.php
+install macros.mono $RPM_BUILD_ROOT%{_rpmlibdir}/macros.mono
install %{SOURCE1} doc/manual/groups
install %{SOURCE3} $RPM_BUILD_ROOT%{_rpmlibdir}/install-build-tree
# global list of capabilities (SONAME, perl(module), php(module) regexps)
# which don't generate dependencies on package NAMES
# -- OpenGL implementation
-^libGL.so.1$
-^libGLU.so.1$
+^libGL.so.1
+^libGLU.so.1
^libOSMesa.so
# -- Glide
-^libglide3.so.3$
+^libglide3.so.3
# -- mozilla
-^libgtkmozembed.so$
-^libgtksuperwin.so$
-^libxpcom.so$
+^libgtkmozembed.so
+^libgtksuperwin.so
+^libxpcom.so
# -- X11 implementation
^libFS.so
^libI810XvMC.so
^libpsres.so
^libxkbfile.so
^libxkbui.so
+# -- fam / gamin
+^libfam.so.0
EOF
cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautocompressdoc <<EOF
# global list of file masks not to be compressed in DOCDIR
ln -s /%{_lib}/$a $RPM_BUILD_ROOT%{_libdir}/$a
done
+# remove arch dependant macros which have no use on noarch
+sed -i -e '
+/{__spec_install_post_strip}/d
+/{__spec_install_post_chrpath}/d
+/{__spec_install_post_compress_modules}/d
+' $RPM_BUILD_ROOT%{_rpmlibdir}/noarch-linux/macros
+
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%attr(755,root,root) %{_bindir}/rpmcache
%attr(755,root,root) %{_bindir}/rpmdeps
%attr(755,root,root) %{_bindir}/rpmgraph
-%attr(755,root,root) %{_bindir}/rpmfile
+%{!?with_system_libmagic:%attr(755,root,root) %{_bindir}/rpmfile}
%attr(755,root,root) %{_rpmlibdir}/find-debuginfo.sh
%attr(755,root,root) %{_rpmlibdir}/rpm2cpio.sh
%attr(755,root,root) %{_rpmlibdir}/tgpg
%ifarch alpha
%{_rpmlibdir}/alpha*
%endif
-%ifarch amd64
-%{_rpmlibdir}/amd64*
-%endif
%ifarch ia64
%{_rpmlibdir}/ia64*
%endif
%ifarch sparc sparc64
%{_rpmlibdir}/sparc*
%endif
+%ifarch %{x8664}
+%{_rpmlibdir}/x86_64*
+%endif
# must be here for "Requires: rpm-*prov" to work
+%{_rpmlibdir}/macros.mono
%{_rpmlibdir}/macros.perl
%{_rpmlibdir}/macros.php
# not used yet ... these six depend on perl
%files pythonprov
%defattr(644,root,root,755)
%{_rpmlibdir}/macros.python
+%attr(755,root,root) %{_rpmlibdir}/pythondeps.sh
%files php-pearprov
%defattr(644,root,root,755)
%if %{with python}
%files -n python-rpm
%defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/*.so
+%dir %{py_sitedir}/rpm
%attr(755,root,root) %{py_sitedir}/rpm/*.so
%attr(755,root,root) %{py_sitedir}/rpm/*.py[co]
-%attr(755,root,root) %{py_sitedir}/rpmdb/*.so
-%{py_sitedir}/rpmdb/*.py*
%endif
%if %{with apidocs}