Refactor RPM build to use YAML+Py+Jinja2 templates 35/27235/14
authorDaniel Farrell <dfarrell@redhat.com>
Mon, 21 Sep 2015 20:13:37 +0000 (16:13 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 22 Oct 2015 22:24:15 +0000 (22:24 +0000)
commit419435ddddc2452ff6a57ada4722e09f20a37a05
treebec1744c6e785780abc91227a3056add050583ae
parent5b2b91bef2cae99c24656d87c0ed3e63dd19b7f6
Refactor RPM build to use YAML+Py+Jinja2 templates

While this is a natural iteration on the RPM building logic, it's nearly
a total re-write of the artifacts that embody that logic, which is why
it's so large. Painful, but necessary for it to actually work at all.

The previous approach used RPM macros, read in from .sh vars files and
passed to the .spec file via rpmbuild, to customize the build per-RPM.

This worked well, but turned out be drastically more complex on a remote
build system like the CentOS CBS. Koji requires the macros to be defined
in a painful way (via a second RPM to install the macro default file).

This method reads build variables from a YAML config file, then uses
Jinja2 templates to create static ODL .spec files for each RPM build.
This moves the variable handling logic to Python, before the RPM's
building logic is invoked, avoiding the need to define macros in Koji.

Change-Id: Id12b32c14cab1df3d1580be9c77e1eca25113094
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
22 files changed:
rpm/Vagrantfile
rpm/build.py [new file with mode: 0755]
rpm/build.sh [deleted file]
rpm/build_vars.yaml [new file with mode: 0644]
rpm/build_vars/default_vars.sh [deleted file]
rpm/build_vars/vars_2.4.0-1.sh [deleted file]
rpm/build_vars/vars_3.0.0-2.sh [deleted file]
rpm/build_vars/vars_3.1.0-1.sh [deleted file]
rpm/cache/.gitignore [new file with mode: 0644]
rpm/cache/__init__.py [new file with mode: 0644]
rpm/cache/cache.py [new file with mode: 0755]
rpm/connect.sh
rpm/install.sh [deleted file]
rpm/opendaylight.spec [deleted file]
rpm/requirements.txt [new file with mode: 0644]
rpm/specs/__init__.py [new file with mode: 0644]
rpm/specs/build_specs.py [new file with mode: 0755]
rpm/specs/opendaylight-2.4.0-1.spec [new file with mode: 0644]
rpm/specs/opendaylight-3.0.0-2.spec [new file with mode: 0644]
rpm/specs/opendaylight-3.1.0-1.spec [new file with mode: 0644]
rpm/specs/opendaylight.spec [new file with mode: 0644]
rpm/uninstall.sh [deleted file]