RPM Changes Donnie Barnes, djb@redhat.com V2.0, April 8, 1997 ____________________________________________________________ Table of Contents: 1. Introduction 2. Background 3. Changes 3.1. 2.2.11 to 2.3 3.2. 2.3 to 2.3.1 3.3. 2.3.1 to 2.3.2 3.4. 2.3.2 to 2.3.3 3.5. 2.3.3 to 2.3.4 3.6. 2.3.4 to 2.3.5 3.7. 2.3.5 to 2.3.6 3.8. 2.3.6 to 2.3.7 3.9. 2.3.7 to 2.3.8 3.10. 2.3.8 to 2.3.9 3.11. 2.3.9 to 2.3.10 3.12. 2.3.10 to 2.3.11 3.13. 2.3.11 to 2.4 3.14. 2.4 to 2.4.1 3.15. 2.4.1 to 2.4.2 4. Macros 4.1. Defining a Macro 4.2. Using a Macro 4.3. Predefined Macros 5. Conflicts 6. Copyright Notice ______________________________________________________________________ 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 . 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 . 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. o are memory leaks, but the functions are only used between a fork() and exec() so it doesn't matter o 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. o changed --help routing to have intelligent line wrapping to make i18n efforts easier o treat RPM_CHAR_TYPE as RPM_INT8_TYPE for queries o made rpmEnsureOlder() internal to lib/install.c o added rpmVersionCompare() to compare version/release/serial numbers for packages -- returns like strcmp() o stdout/stderr were getting closed after running a verify script o 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 o fixed bug in new rpmVersionCompare() which made it worse then useless (thanks to Norbert Kiesel) 3.4. 2.3.2 to 2.3.3 o 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]. o Use cp -pr instead of cp -ar for %doc expansion o look for non-POSIX (broken) chmod o include local copies of glob/fnmatch o switched to popt from getopt, which allows command line aliasing o read initial aliases from /usr/lib/rpmpopt then /etc/popt and $HOME/.popt o cleanup up rdev verification (only verifies device files, checks device related mode bits as well) o made tools/dumpdb read the rpmrc so it can find the database o added --nomd5 for -V and -K o bunch of minor cleanups to avoid warnings on other OS's 3.5. 2.3.3 to 2.3.4 o %changelog processing o fixed broken requires/conflicts parsing for spec file o vastly improved --rebuilddb's robustness o added conflicts documentation to docs/dependencies (see section ``Conflicts'' for more detailed documentation). o using multiple query formats has them all concatenated o removed stdin based query and verify selectors o installs rpmpopt in libdir o moved --provides and --scripts to rpmpopt o added --setperms, --setugids o --resign/--addsign was broken in 2.3.3 from popt conversion 3.6. 2.3.4 to 2.3.5 o %{#TAG} in query format prints the array length o cleanup up protoypes in rpmlib.h o let -Vp work on URLs o don't set umask(0) anymore -- that confused programs which link against rpmlib quite badly o moved print out in rpm -v -i to occur after any warnings to pretty up the output a bit o added default optflags for powerpc o run shell for post/pre scripts in debug mode with -sx for some silly shells o installing source packages with --root checked for the sources/specs directory to exist outside of the root -- fixed o modified toplevel Makefile to run dependency generation only against referenced sources o array size mismatches in --qf should send error to stderr o 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 o -Vf uses realpath() now o -Vp lets you use --ftpproxy, --ftpport o changed popt format, breaking all popt alises :-( o added ability to alias character arguments to popt o moved --requires, --info to /usr/lib/rpmpopt o RPM is more forgiving of blank user names (dumb) o popt searches for aliases in the correct order now o cleanup query code to handle missing uid lists better o cleanup up configure.in a tad 3.8. 2.3.6 to 2.3.7 o fixed nasty memory link in -Va o configure checks for -lnsl explicitly rather then linking it to -lsocket (for NCR SysVR4) o configure checks for dirent.h o modified glob.c to include config.h and use HAVE_DIRENT_H o cleanup of LIBS/LIBPATH mess a bit more 3.9. 2.3.7 to 2.3.8 o added -t? options to build packages from tarballs which contain o added Makefile rule for building rpmconvert (which is almost never needed) -- this isolated gdbm dependence to this target o --requires shouldn't imply -q o fixed but in changelog processing which made it hang on '*' in a changelog entry o rpm --erase wasn't returning proper error codes with package removal failed 3.10. 2.3.8 to 2.3.9 o reworked %setup to allow multiple -a and -b options, which should noticeably ease the task of unapcking multiple tar files o 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 o added --allmatches to allow erasing multiple versions/releases of a package o changed ftp URL's to use \r\n, not just \n (this should let RPM work with some picky (but rfc compliant) ftp servers o simple spec file macros (see section ``Macros'' for detailed documentation) o should now process entire file list before failing /message HELP ME 3.11. 2.3.9 to 2.3.10 o new predefined macros: %SOURCEn %PATCHn %percnt;SOURCEURLn %PATCHURLn o fix anomoly with %files -f and %doc o ignore config bit when it's set on directories (which allows users to replace directories with symlinks) o don't set config bit on directories o %tags are now case sensitive (macros too) 3.12. 2.3.10 to 2.3.11 o fixed newlines in --scripts output o fix handling of source files with bad owners/groups 3.13. 2.3.11 to 2.4 o set RPM_INSTALL_PREFIX environment variable when running verify scripts o switched to CVS and updated some Makefile rules o made many strings in rpm program (though not yet in the various libraries) translatable o eight character user names could break -qlv o requirements which begin with a leading / require files (in the database!) instead of packages o get path to gzip from /usr/lib/rpmrc rather then just hoping it's in the path o don't set owner/group if binaries installed by ``make install'' o don't use cpio when installing packages o fixed bug which affected dependencies on the Alpha o complain if critical rpmrc variables (cpiobin, gzipbin, etc) aren't set anywhere o 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. o added packager and url to default -qi output 3.14. 2.4 to 2.4.1 o take advantage of lchown() if it's available o fixed configure script to assume chown() doesn't follow symlinks if lchown() isn't available and configure is not being run as root o added :shescape query format type for strings, which prints strings which will survive a single level of shell expansion o fixed --setperms and --setugids to handle empty packages and packages with odd filenames o created noarch architecture which everything is compatible with o fixed group verification (Benedict Lofstedt) o don't backup config files on netsharedpaths o added info on --build{arch|os} to --help and usage messages 3.15. 2.4.1 to 2.4.2 o added fsnames and fssizes virtual query tags o added rpmdbFindByHeader() and rpmdbFindByTag() public functions o added rpmfilename tag to rpmrc to define the filename format to use for binary packages (note the rpmdir is prepended to it) o updated man pages o netsharedpath entries shouldn't match partial directory names anymore (a netsharedpath of /usr/lib shouldn't affect /usr/libexec) o don't backup config files on netsharedpaths (take 2) o added day query format which is like date, but doesn't print any time o added --changelog alias to query a packages changelog entry o fflags query type displays s for specfiles, m for missingok files, and n for noreplace files o implemented %config(missingok) flag in install o added --allfiles flag for -i and -U, which forces all files (even missingok files) to be installed o implemented %config(noreplace) for the install, but it hasn't been tested in any way o added ppc/rs6000 differntiation for AIX o IP is considered the same as mips (not sgi) o 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 ). 4.1. Defining a Macro To define a macro use: %define All whitespace surrounding is removed. Name may be composed of alphanumeric characters, and the character `_' (the underscore). Macro expansion is performed on so that my reference other macros that have already been defined. 4.2. Using a Macro To use a macro, write: % or %{} 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: o PACKAGE_VERSION o 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. (c) 1997