RPM Packaging

From PostgreSQL wiki
Jump to navigationJump to search

How are RPMs packaged?

This was written by Lamar Owen and Devrim Gündüz, 2006-10-16, rewritten 2014-09 by Craig Ringer.

A git repository is maintained at http://git.postgresql.org/gitweb/?p=pgrpms.git, which for each package contains:

  1. A set of patches to make certain portions of the sources conform more closely with how Red Hat packages its own matching RPMs, better integrate into multiarch installs, etc;
  2. The initscript / systemd service file;
  3. Any other ancillary scripts and files;
  4. A README.rpm-dist document that tries to adequately document both the differences between the RPM build and the WHY of the differences, as well as useful RPM environment operations (like, using syslog, upgrading, getting postmaster to start at OS boot, etc);
  5. The spec file that throws it all together, specifying what files are in what subpackages, the version, dependencies, and a lot more.

A given "package" like PostgreSQL will have many copies of the above, one for each distro release and PostgreSQL version. For example, the package for PostgreSQL 9.4 on Fedora 20 is in 9.4/postgresql/F-20

The PGDG RPM maintainer builds the SRPM, then executes RPM builds on a variety of build worker machines and pushes the resulting RPMs and SRPMs to http://yum.postgresql.org/srpms/$version/$distro/$distro-$release-$arch/ and http://yum.postgresql.org/$version/$distro/$distro-$release-$arch/ , e.g. http://yum.postgresql.org/srpms/9.4/fedora/fedora-20-x86_64/ and http://yum.postgresql.org/9.4/fedora/fedora-20-x86_64/ .

The Yum repository metadata is then updated so that yum can find the new packages.