Unifying the spec files?

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: pgsql-pkg-yum <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Unifying the spec files?
Date: 2014-07-29 01:46:52
Message-ID: 53D6FD0C.5080903@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Hi

While looking over the spec files for the releases I noticed that the
_vast_ majority of content is the same for each spec.

Where differences exist it isn't always clear why. For example, EL-7
seems to generate an init script differently to EL-6, and the EL-7
packages have postgres_fdw and sepgsql but EL-6 doesn't.

I'm a little curious about why the spec files seem to be copied and
edited, rather than having a single spec for the package across all
supported versions and using conditionals. I'm sure you've thought of
that, so there'll be good reasons - did you try this and run into issues?

As I'm facing the need to do multi-distro patch releases (hotfixes,
basically) where I'll need to rapidly produce new RPMs for each
supported distro, these differences are not fun to deal with, so if
there's a way to use a single spec file and just use conditionals I'd be
pretty happy.

e.g. SuSE defines a %{suse_version} macro, RHEL defines %{rhel} for the
RHEL release, %{fedora} for the fedora release.

rpmbuild --showrc will report defined macros.

If used for builds, mock will define appropriate macros either in the
chroot or by calling rpmbuild.

If I prep a unified spec for postgresql would you be willing to review
and give it a go?

Useful info:

http://rpm5.org/docs/rpm-guide.html#id3039571
http://en.opensuse.org/openSUSE:RPM_conditional_builds

http://fedoraproject.org/wiki/Packaging:DistTag

https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros

http://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Devrim Gündüz 2014-07-29 05:06:42 Re: Unifying the spec files?
Previous Message Craig Ringer 2014-07-29 00:01:13 Re: Koji, mock, fedpkg, etc?