RPM Changes

Donnie Barnes, djb@redhat.com V2.0, April 8, 1997

Contents

1 Introduction 2

2 Background 2

3 Changes 2 3.1 2.2.11 to 2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3.2 2.3 to 2.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3.3 2.3.1 to 2.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.4 2.3.2 to 2.3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.5 2.3.3 to 2.3.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.6 2.3.4 to 2.3.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.7 2.3.5 to 2.3.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.8 2.3.6 to 2.3.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.9 2.3.7 to 2.3.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.10 2.3.8 to 2.3.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.11 2.3.9 to 2.3.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.12 2.3.10 to 2.3.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.13 2.3.11 to 2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.14 2.4 to 2.4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.15 2.4.1 to 2.4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Macros 8 4.1 Defining a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.2 Using a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3 Predefined Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 Conflicts 8 6 Copyright Notice 9

1 Introduction

This document is intended to outline changes that occur in RPM^{TM}. We will assume that information is complete until RPM 2.3. Anything prior to that is covered in the book by Ed Bailey, Maximum RPM . That book is available for download or purchase at www.redhat.com <http://www.redhat.com>. This document covers changes after that book was released.

Most information on RPM can be found at the official RPM web site, www.rpm.org <http://www.rpm.org>.

2 Background

RPM is the Red Hat Package Manager. While it does contain Red Hat in the name, it is completely intended to be an open packaging system available for anyone to use. It allows users to take source code for new software and package it into source and binary form such that binaries can be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages and their files that can be used for verifying packages and querying for information about files and/or packages.

Red Hat Software encourages other distribution vendors to take the time to look at RPM and use it for their own distributions. RPM is quite flexible and easy to use, though it provides the base for a very extensive system. It is also completely open and available, though we would appreciate bug reports and fixes. Permission is granted to use and distribute RPM royalty free under the GPL.

3 Changes

In this section we will outline all changes in RPM from version 2.3 until the second edition of Maximum RPM is released.

3.1 2.2.11 to 2.3

This is mostly an internal cleanup release.

• are memory leaks, but the functions are only used between a fork() and exec() so it doesn’t matter

• created directories are stamped with mtime from the file list

3.2 2.3 to 2.3.1

This release is mainly an internal cleanup release for i18n efforts and for some internal functions that didn’t behave with serial numbers.

• changed --help routing to have intelligent line wrapping to make i18n efforts easier

• treat RPM CHAR TYPE as RPM INT8 TYPE for queries
• made rpmEnsureOlder() internal to lib/install.c

• added rpmVersionCompare() to compare version/release/serial numbers for packages – returns like

  strcmp()

• stdout/stderr were getting closed after running a verify script

• relocting packages didn’t work with the packages contained the directory which was it’s prefix

3.3 2.3.1 to 2.3.2

• fixed bug in new rpmVersionCompare() which made it worse then useless (thanks to Norbert Kiesel)

3.4 2.3.2 to 2.3.3

• Ripped out header internals and redid them. Any compatibility problems this causes are bugs as it should be completley transparent. If this works the devil better buy some Prestone^{TM}.

• Use cp -pr instead of cp -ar for %doc expansion

• look for non-POSIX (broken) chmod

• include local copies of glob/fnmatch

• switched to popt from getopt, which allows command line aliasing

• read initial aliases from /usr/lib/rpmpopt then /etc/popt and $HOME/.popt

• cleanup up rdev verification (only verifies device files, checks device related mode bits as well)

• made tools/dumpdb read the rpmrc so it can find the database

• added --nomd5 for -V and -K

• bunch of minor cleanups to avoid warnings on other OS’s

3.5 2.3.3 to 2.3.4

• %changelog processing

• fixed broken requires/conflicts parsing for spec file

• vastly improved --rebuilddb’s robustness

• added conflicts documentation to docs/dependencies (see section 5 for more detailed documentation).

• using multiple query formats has them all concatenated • removed stdin based query and verify selectors

• installs rpmpopt in libdir
• moved --provides and --scripts to rpmpopt
• added --setperms, --setugids

• --resign/--addsign was broken in 2.3.3 from popt conversion

3.6 2.3.4 to 2.3.5

• %{#TAG} in query format prints the array length

• cleanup up protoypes in rpmlib.h

• let -Vp work on URLs

• don’t set umask(0) anymore – that confused programs which link against rpmlib quite badly

• moved print out in rpm -v -i to occur after any warnings to pretty up the output a bit

• added default optflags for powerpc

• run shell for post/pre scripts in debug mode with -sx for some silly shells

• installing source packages with --root checked for the sources/specs directory to exist outside of the root – fixed

• modified toplevel Makefile to run dependency generation only against referenced sources

• array size mismatches in --qf should send error to stderr

• made verify verify owner and groups by name rather then by id – if the symbolic names aren’t available use the uids

3.7 2.3.5 to 2.3.6

• -Vf uses realpath() now
• -Vp lets you use --ftpproxy, --ftpport

• changed popt format, breaking all popt alises :-(

• added ability to alias character arguments to popt

• moved --requires, --info to /usr/lib/rpmpopt

• RPM is more forgiving of blank user names (dumb)

• popt searches for aliases in the correct order now

• cleanup query code to handle missing uid lists better

• cleanup up configure.in a tad

3.8 2.3.6 to 2.3.7

• fixed nasty memory link in -Va

• configure checks for -lnsl explicitly rather then linking it to -lsocket (for NCR SysVR4)

• configure checks for dirent.h

• modified glob.c to include config.h and use HAVE DIRENT H

• cleanup of LIBS/LIBPATH mess a bit more

3.9 2.3.7 to 2.3.8

• added -t? options to build packages from tarballs which contain .spec files instead of from the .spec files directly

• added Makefile rule for building rpmconvert (which is almost never needed) – this isolated gdbm dependence to this target

• --requires shouldn’t imply -q

• fixed but in changelog processing which made it hang on ’*’ in a changelog entry

• rpm --erase wasn’t returning proper error codes with package removal failed

3.10 2.3.8 to 2.3.9

• reworked %setup to allow multiple -a and -b options, which should noticeably ease the task of unapcking multiple tar files

• md5 sum’s were calculated incorrectly on big endian machines from 2.3.2 through 2.3.8 – this was fixed and some hacks were done to keep verification working

• added --allmatches to allow erasing multiple versions/releases of a package

• changed ftp URL’s to use \r\n, not just \n (this should let RPM work with some picky (but rfc compliant) ftp servers

• simple spec file macros (see section 4 for detailed documentation)

• should now process entire file list before failing

/message HELP ME

3.11 2.3.9 to 2.3.10

• new predefined macros: %SOURCEn %PATCHn %percnt;SOURCEURLn %PATCHURLn

• fix anomoly with %files -f <file> and %doc

• ignore config bit when it’s set on directories (which allows users to replace directories with symlinks)

• don’t set config bit on directories

• %tags are now case sensitive (macros too)

3.12 2.3.10 to 2.3.11

• fixed newlines in --scripts output

• fix handling of source files with bad owners/groups

3.13 2.3.11 to 2.4

• set RPM INSTALL PREFIX environment variable when running verify scripts

• switched to CVS and updated some Makefile rules

• made many strings in rpm program (though not yet in the various libraries) translatable

• eight character user names could break -qlv

• requirements which begin with a leading / require files (in the database!) instead of packages

• get path to gzip from /usr/lib/rpmrc rather then just hoping it’s in the path

• don’t set owner/group if binaries installed by “make install”

• don’t use cpio when installing packages

• fixed bug which affected dependencies on the Alpha

• complain if critical rpmrc variables (cpiobin, gzipbin, etc) aren’t set anywhere

• added check for systems whose chown() follows symlinks. If configure is run as root, this should get it right, otherwise it assumes chown() does not follow symlinks. You can use --enable-broken-chown to force configure to think chown does indeed follow symlinks.

• added packager and url to default -qi output

3.14 2.4 to 2.4.1

• take advantage of lchown() if it’s available

• fixed configure script to assume chown() doesn’t follow symlinks if lchown() isn’t available and configure is not being run as root

• added :shescape query format type for strings, which prints strings which will survive a single level of shell expansion

• fixed --setperms and --setugids to handle empty packages and packages with odd filenames

• created noarch architecture which everything is compatible with

• fixed group verification (Benedict Lofstedt)

• don’t backup config files on netsharedpaths

• added info on --build{arch|os} to --help and usage messages

3.15 2.4.1 to 2.4.2

• added fsnames and fssizes virtual query tags

• added rpmdbFindByHeader() and rpmdbFindByTag() public functions

• added rpmfilename tag to rpmrc to define the filename format to use for binary packages (note the rpmdir is prepended to it)

• updated man pages

• netsharedpath entries shouldn’t match partial directory names anymore (a netsharedpath of

  /usr/lib shouldn’t affect /usr/libexec)

• don’t backup config files on netsharedpaths (take 2)

• added day query format which is like date, but doesn’t print any time

• added --changelog alias to query a packages changelog entry

• fflags query type displays s for specfiles, m for missingok files, and n for noreplace files

• implemented %config(missingok) flag in install

• added --allfiles flag for -i and -U, which forces all files (even missingok files) to be installed

• implemented %config(noreplace) for the install, but it hasn’t been tested in any way

• added ppc/rs6000 differntiation for AIX

• IP is considered the same as mips (not sgi)

• added IRIX64 OS, it’s compatible w/ IRIX

4 Macros

This is the contents of /usr/doc/rpm*/macros only nicely formatted. Macros in RPM are used in the spec file for building RPMs only (ie this is not an end user item). RPM 2.3.9 introduces simple spec file macros. The macros can do straight text substitution only. Macros can be used anywhere in a spec file, and in “included file lists” (those read in using %files -f <file>).

4.1 Defining a Macro

To define a macro use:

     %define <name> <expansion>

All whitespace surrounding <expansion> is removed. Name may be composed of alphanumeric characters, and the character ‘ ’ (the underscore). Macro expansion is performed on <expansion> so that <expansion> my reference other macros that have already been defined.

4.2 Using a Macro

To use a macro, write:

     %<name>

or

     %\{<name>\}

The latter allows you to place the expansion adjacent to other text.

4.3 Predefined Macros

The following macros are defined as the values they reference are specified in the spec file:

   • PACKAGE VERSION
   • PACKAGE RELEASE

5 Conflicts

While conflicts were implemented in earlier versions of RPM they never worked properly until RPM 2.3.4 (well, we hope they work properly now anyway).

Conflicts allow a package to say it won’t work with another package (or virtual package) installed on the system. For example, qmail doesn’t work (without custom setup) on machines with sendmail installed. The qmail spec file may codify this with a line like:

     Conflicts: sendmail

The syntax of the “Conflicts” tag is identical to the syntax of the “Requires” tag and conflict checking may be overridden by using the --nodeps flag.

6 Copyright Notice

This document and its contents are copyright protected. Redistribution of this document is permitted as long as the content remains completely intact and unchanged. In other words, you may reformat and reprint or redistribute only.

\begin{matrix}c \\ ◯ \end{matrix} 1997