From 72f30f98de111e9f10a58829b78e51e80a5a52a5 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 23 Nov 2016 11:38:27 -0500 Subject: Adding a release RPM JIRA: APEX-351 Change-Id: I9b8b74073287005221a7a3f6dfe2d52a7d1cf667 Signed-off-by: Dan Radez --- build/Makefile | 26 ++++++++++++++++++++++++-- build/rpm_specs/opnfv-apex-release.spec | 30 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 build/rpm_specs/opnfv-apex-release.spec (limited to 'build') diff --git a/build/Makefile b/build/Makefile index a542279b..ee15db33 100644 --- a/build/Makefile +++ b/build/Makefile @@ -31,7 +31,9 @@ export NETVPP_REPO := $(shell awk -F\= '/^netvpp_repo/ {print $$2}' variables.sh export NETVPP_BRANCH := $(shell awk -F\= '/^netvpp_branch/ {print $$2}' variables.sh ) export NETVPP_COMMIT := $(shell git ls-remote $(NETVPP_REPO) $(NETVPP_BRANCH) | awk '{print substr($$1,1,7)}') +export RELRPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex-release.spec | head -n 1 | awk '{ print $$2 }') export RPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex.spec | head -n 1 | awk '{ print $$2 }') +export RPMREL = $(shell pwd)/noarch/opnfv-apex-release-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMCOM = $(shell pwd)/noarch/opnfv-apex-common-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMUDR = $(shell pwd)/noarch/opnfv-apex-undercloud-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMODL = $(shell pwd)/noarch/opnfv-apex-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm @@ -54,13 +56,33 @@ images-clean: undercloud-clean overcloud-full-clean overcloud-opendaylight-clean rpms: common-rpm undercloud-rpm opendaylight-rpm onos-rpm .PHONY: rpms-check -rpms-check: common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check +rpms-check: release-rpm-check common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check .PHONY: rpms-clean -rpms-clean: common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean +rpms-clean: release-rpm-clean common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean rm -rf noarch rm -rf BUILDROOT +opnfv-apex-release.tar.gz: + pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-release-$(RELRPMVERS)/ HEAD > build/opnfv-apex-release.tar.gz + +.PHONY: release-rpm-check +release-rpm-check: opnfv-apex-release.tar.gz + rpmbuild --clean -bi -bl rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm +release-rpm: opnfv-apex-release.tar.gz $(RPMREL) + +$(RPMREL): + @echo "Building the Apex Release RPM" + # build the release RPM + rpmbuild --clean -ba rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm-clean +release-rpm-clean: + rm -rf opnfv-apex-release-$(RPMVERS) + rm -rf opnfv-apex-release.tar.gz + opnfv-apex-common.tar.gz: pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-common-$(RPMVERS)/ HEAD > build/opnfv-apex-common.tar.gz diff --git a/build/rpm_specs/opnfv-apex-release.spec b/build/rpm_specs/opnfv-apex-release.spec new file mode 100644 index 00000000..7dd43d93 --- /dev/null +++ b/build/rpm_specs/opnfv-apex-release.spec @@ -0,0 +1,30 @@ +Name: opnfv-apex-release +Version: danube +Release: %{release} +Summary: RPM Release file + +Group: System Environment +License: Apache 2.0 +URL: https://gerrit.opnfv.org/gerrit/apex.git +Source0: opnfv-apex-release.tar.gz + +BuildArch: noarch +Requires: rdo-release = newton epel-release libvirt-python + +%description +RPM Release file that provides a yum repo file to install OPNFV Apex + +%prep +%setup -q + +%install +mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d/ +install config/yum.repos.d/opnfv-apex.repo %{buildroot}%{_sysconfdir}/yum.repos.d/ + +%files +%defattr(644, root, root, -) +%{_sysconfdir}/yum.repos.d/opnfv-apex.repo + +%changelog +* Wed Nov 23 2016 Dan Radez - 3.0-1 +- Initial Packaging -- cgit 1.2.3-korg