Re: New and unified 9.5 spec file is in git

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Cc: pgsql-pkg-yum <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Re: New and unified 9.5 spec file is in git
Date: 2016-01-20 04:22:57
Message-ID: CAMsr+YHbLPO4XthDTmpWrNpJJZ8LN=eh8OiR7WOn6uPr=GbvpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

I've uploaded a branch with a couple of small improvements. See
https://github.com/2ndQuadrant/pgdg-pgrpms .

git remote add 2ndq https://github.com/2ndQuadrant/pgdg-pgrpms.git
git fetch 2ndq
# view it
git log -p remotes/2ndq/add-builddepends
# merge it
git merge remotes/2ndq/add-builddepends

This is the main patch of interest:

https://github.com/2ndQuadrant/pgdg-pgrpms/commit/60524156129b27b9cf3836621a0d05afb658d60e

A further suggested improvement, which I haven't put in that tree but
wanted to flag as an idea - detect the target based on the directory name
so there's no need to have a different Makefile for each target dir and
they can all just be symlinks.

For each dist's Makefile:

-DIST=.rhel5
SPECFILE="postgresql-9.5.spec"
+# This gibberish gets the immediate parent directory's name, prepends
RPMDIST_
+# and looks it up as a Make variable lazily on first evaluation. That way
we
+# don't require a new Makefile for each build directory.
+#
+# The RPMDIST_ vars are defined in Makefile.global
+#
+DIST=$(RPMDIST_$(shell basename $(dir $(abspath $(lastword
$(MAKEFILE_LIST))))))

then in Makefile.global:

+# These mappings could be automated with $(foreach ...) and $(eval ...)
+# but there hardly seems any point.
+RPMDIST_EL-5=.rhel5
+RPMDIST_EL-6=.rhel6
+RPMDIST_EL-7=.rhel7
+RPMDIST_F-21=.fc21
+RPMDIST_F-22=.fc22
+RPMDIST_F-23=.fc23

Then EL-5, EL-6, EL-7, F-22 and F-23 can be deleted and replaced with
common/ which is symlinks to each of them. That shouldn't upset the build
system; otherwise I'd suggest switching moving all files up a level,
removing the dist subtrees, and using "make DIST=EL-5" or whatever to
control the target.

Less duplication in the source tree, no need to remember to copy files
around, easier to track history.

In response to

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Jeff Frost 2016-01-20 04:33:23 Re: New and unified 9.5 spec file is in git
Previous Message Craig Ringer 2016-01-20 03:52:17 Re: New and unified 9.5 spec file is in git