PLDWWW: RPM5

baggins baggins at pld-linux.org
Mon Sep 17 13:15:39 CEST 2012


Author: baggins   Date: Mon Sep 17 11:15:39 2012 GMT
Module: PLDWWW   URL: http://www.pld-linux.org/RPM5
---- Log message:


---- Page affected: RPM5

---- Diffs:

================================================================
New page:
= RPM 5.x quick guide =

== General information ==

Changes in rpm operation that should interest both users and developers.

=== Fixing database problems ===

You can't just do '''''"rm -rf /var/lib/rpm/_ _db*"''''' to fix problems anymore, also '''''--rebuilddb''''' is largely obsolete in rpm-5.3.x and isn't likely to "fix" anything. Instead:
{{{
cd /var/lib/rpm
dbX.Y_recover -ev
}}}

=== Querying database ===

The semantics of rpm query option '''''-f''''' ('''''--file''''') has changed in rpm 5.x;
'''''rpm -q -f <file-with-path>''''' will '''not''' resolve all symlinks in queried file's path.
So the query (assuming ''/usr/src/linux'' is a symlink to ''/usr/src/linux-A.B.C-R''):
{{{
rpm -q -f /usr/src/linux/include/linux/fs.h
}}}
That returned ''kernel-headers-A.B.C-R.arch.rpm'' with old rpm, will return nothing with rpm 5.x.
Yo have to do '''readlink -f''' first, or change to symlinked directory and do relative path query.

== Packaging changes ==

Below is a list of changes in build system that should interest PLD developers.

=== Build options ===

 * /var/tmp is now used when TMPDIR environment variable is not set, the reason for this change is to avoid future problems if/when systemd forces it's way of /tmp as tmpfs
 * '''''-Wformat -Werror=format-security''''' options are added to compiler flags, more information about it can be found on [http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments Mandriva Wiki]
 * '''Stack Smashing Protector''' is also enabled by default, if you really MUST disable SSP then undefine '''_ssp_cflags''' macro

=== Loading additional macros in .spec files ===

With old rpm 4.x several macro files were loaded on .spec files via '''#include''' directive:

{{{
%include /usr/lib/rpm/macros.perl
}}}

In rpm 5.x those macro files have been moved to /usr/lib/rpm/macros.d/ directory,
and must be loaded using %{load:} directive:

{{{
%{load:/usr/lib/rpm/macros.d/perl}
}}}


More information about the pld-cvs-commit mailing list