Unifying the spec files? - Mailing list pgsql-pkg-yum

From Craig Ringer
Subject Unifying the spec files?
Date
Msg-id 53D6FD0C.5080903@2ndquadrant.com
Whole thread Raw
Responses Re: Unifying the spec files?  (Devrim Gündüz <devrim@gunduz.org>)
List 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


pgsql-pkg-yum by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Koji, mock, fedpkg, etc?
Next
From: Devrim Gündüz
Date:
Subject: Re: Unifying the spec files?