summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/Makefile26
-rw-r--r--build/rpm_specs/opnfv-apex-release.spec30
2 files changed, 54 insertions, 2 deletions
diff --git a/build/Makefile b/build/Makefile
index ff615a47..88a6e962 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -32,7 +32,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
@@ -55,13 +57,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 <dradez@redhat.com> - 3.0-1
+- Initial Packaging