[Scons-users] scons making a package in a sub directory [SEC=UNCLASSIFIED]

Hoyles Matthew Matthew.Hoyles at ga.gov.au
Wed Jan 24 20:18:38 EST 2018


Jason,

I am working on a similar problem at the moment. I have not had much luck in the past either using the built in rpm builder, or writing my own. Part of the problem is that SCons default approach does not fit well with RPMs. SCons likes to rebuild files as necessary, but RPMs should ideally never be rebuilt with the same name - you should bump either the version or release number and rebuild with a different name.

I can suggest the following:

1)      Set up an empty rpmbuild tree under your top level.

2)      Have SCons generate spec files and install them in the rpmbuild tree. You could use Jinja2 templates for this and have SCons fill in the variable info like the version number or release number. The spec files would have to know how to get the software installed in the BUILDROOT, but you could have SCons called by the spec file to do this if needed.

3)      Use external logic, such as a Python or shell script, to actually build the rpms from the spec files. I am planning to use 'rpm -q --specfile <specfile>' to find out the name of the rpm that would be built, and then checking  to see if it already exists before building. To make this work you have to bump the version number or release number in the spec file when something changes in the subproject, but that is the way RPMs are supposed to work.

If you want SCons to orchestrate the whole thing, you could even wrap the step 3 logic into a SCons action, associate it with a dummy target, and make it dependant on all the spec files (so it gets done last).

I realise that this is complicated, but it is the best I can come up with at the moment. I hope it helps, or at least gives you some ideas.

Cheers,
Matthew

From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Jason Currey
Sent: Tuesday, 23 January 2018 10:12 PM
To: scons-users at scons.org
Subject: [DKIM] [Scons-users] scons making a package in a sub directory


I have recently setup an scons build plan building a number of custom projects in sub-directories with a single SConstruct with a common environment at the top level. I want to build rpm(s) at the lower levels. I have read a number of posts that indicate this doesn't work. It seems this problem has been around for a while but I havent found anything indicating a PR has been raised or is near completion or even if there might be a branch that has yet to been merged.



If anyone has any helpful information that might assist it would be appreciated.



Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is intended only for the person or entity to which it is addressed. If you are not the intended recipient, then you have received this e-mail by mistake and any use, dissemination, forwarding, printing or copying of this e-mail and its file attachments is prohibited. The security of emails transmitted cannot be guaranteed; by forwarding or replying to this email, you acknowledge and accept these risks.
-------------------------------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180125/4537cd5f/attachment.html>


More information about the Scons-users mailing list