Skip to content

Commit

Permalink
Create Contrail Installer Packages for SLES12
Browse files Browse the repository at this point in the history
Initial adjustments for creating a useable installer package
on SLES12. Other RPM based distros should be unaffected.

Partial-Bug: #1488627
Change-Id: I0b49e02187e17c8b0492d97ec7700213e526f06a
  • Loading branch information
dirkmueller committed Aug 27, 2015
1 parent 162acec commit 148176f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
7 changes: 6 additions & 1 deletion build/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

repopath=/etc/yum.repos.d/
if [ -d /etc/zypp/repos.d ]; then
repopath=/etc/zypp/repos.d/
fi

# create contrail installer repo
cat << __EOT__ > /etc/yum.repos.d/contrail-install.repo
cat << __EOT__ > $repopath/contrail-install.repo
[contrail_install_repo]
name=contrail_install_repo
baseurl=file:///opt/contrail/contrail_install_repo/
Expand Down
2 changes: 1 addition & 1 deletion common/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BUILD_SRC := $(BUILD_BASE)/SOURCES
PKGBLDDIR := $(BUILD_BASE)/BUILD
DISTRO_PACKAGING := $(CPLANE_GIT_ROOT)/../distro/python-venv-packaging
THIRDPARTY_DIR := $(CPLANE_GIT_ROOT)/../third_party
DISTRO := $(shell egrep -o "Fedora|CentOS|Red Hat" /etc/redhat-release)
DISTRO := $(shell egrep -ho "Fedora|CentOS|Red Hat|SUSE" /etc/*-release | sort -u | head -n 1)
RPMBLDOPTS := --define '_topdir $(BUILD_BASE)' --define '_builddir $(CPLANE_GIT_ROOT)' -bb
SB_TOP := $(CPLANE_GIT_ROOT)/..
SB_TOPDIR := --define '_sbtop $(SB_TOP)'
Expand Down
15 changes: 14 additions & 1 deletion common/rpm/contrail-installer-packages.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ Contrail Installer Packages - Contains packages to install contrail-fabric
rm -rf %{buildroot}
install -d -m 755 %{buildroot}%{_contrailopt}
install -d -m 755 %{buildroot}/etc/
install -d -m 755 %{buildroot}/etc/yum.repos.d/
install -d -m 755 %{buildroot}%{_contrailopt}/contrail_installer_packages
install -d -m 755 %{buildroot}%{_contrailopt}/contrail_installer_repo
install -d -m 755 %{buildroot}%{_contrailopt}/python-packages
Expand All @@ -63,7 +62,15 @@ install -p -m 755 %{_builddir}/../distro/third_party/pycrypto-*.tar.gz %{buildro
install -p -m 755 %{_builddir}/../distro/third_party/Fabric-*.tar.gz %{buildroot}%{_contrailopt}/python-packages/

install -p -m 755 %{SETUP_FILE} %{buildroot}%{_contrailopt}/contrail_installer_packages/setup.sh
%if 0%{?rhel}
install -d -m 755 %{buildroot}/etc/yum.repos.d/
install -p -m 755 %{_builddir}/../tools/packaging/build/contrail-installer.repo %{buildroot}/etc/yum.repos.d/contrail-installer.repo
%endif
%if 0%{?suse_version}
install -d -m 755 %{buildroot}/etc/zypp/repos.d/
install -p -m 755 %{_builddir}/../tools/packaging/build/contrail-installer.repo %{buildroot}/etc/zypp/repos.d/contrail-installer.repo
%endif


if [ -f %{_flist} ]; then \
echo "Using TGZ FILE = %{_flist}"; \
Expand All @@ -77,7 +84,13 @@ fi
%files
%defattr(-, root, root)
/opt/*
%if 0%{?rhel}
/etc/yum.repos.d/*
%endif
%if 0%{?suse_version}
etc/zypp/repos.d/*
%endif


%changelog
* Wed Apr 22 2015 - npchandran@juniper.net
Expand Down
7 changes: 5 additions & 2 deletions common/rpm/contrail-nova-networkapi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ Group: Applications/System
License: Commercial
URL: http://www.juniper.net/
Vendor: Juniper Network Inc

BuildRequires: python2-devel
%if 0%{?rhel}
BuildRequires: python2-devel
%else
BuildRequires: python-devel
%endif
BuildRequires: python-setuptools
#Requires:

Expand Down
6 changes: 3 additions & 3 deletions common/rpm/contrail-setup.spec
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ ln -sbf %{_contrailopt}/bin/* %{_bindir}
%{_contrailopt}/contrail_packages/README
%{_contrailopt}/cfgm_utils.tgz
%{_contrailopt}/dns_scripts.tgz
%{_contrailopt}/python_packages/paramiko-*.tar.gz
%{_contrailopt}/python_packages/Fabric-*.tar.gz
%{_contrailopt}/python_packages/pycrypto-*.tar.gz
%{python_sitelib}/ContrailProvisioning-*.egg-info
%{python_sitelib}/contrail_provisioning
%if 0%{?rhel}
%{_contrailopt}/python_packages/zope.interface-3.7.0.tar.gz
%{_contrailopt}/python_packages/paramiko-*.tar.gz
%{_contrailopt}/python_packages/Fabric-*.tar.gz
%{_contrailopt}/python_packages/pycrypto-*.tar.gz
%endif
%if 0%{?_fileList:1}
/etc/contrail/rpm_list.txt
Expand Down

0 comments on commit 148176f

Please sign in to comment.