Skip to content

Commit

Permalink
Merge "Bug#1377326 Changes to add redhat support for server manager p…
Browse files Browse the repository at this point in the history
…ackaging" into R1.10
  • Loading branch information
Zuul authored and Gerrit Code Review committed Oct 7, 2014
2 parents adfc42e + 519c0c5 commit 13d7e8f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/debian/contrail-server-manager/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 8)
Package: contrail-server-manager
Architecture: all
Maintainer: tsurendra <tsurendra@juniper.net>
Depends: python , apache2, sqlite, cobbler, puppetmaster (>=2.7.25), xinetd, python-pip, dhcp3-server, ntp,autoconf, gcc, bind9, tftp, sendmail, dpkg-dev, syslinux, ipmitool
Depends: python , apache2, sqlite, cobbler, puppetmaster (>=2.7.25), xinetd, python-pip, dhcp3-server, ntp,autoconf, gcc, bind9, tftp, sendmail, dpkg-dev, syslinux, ipmitool, createrepo
Section: contrail-server-manager
Priority: extra
Description: Contrail Server Manager - Server Package
4 changes: 4 additions & 0 deletions common/debian/contrail-server-manager/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ -f /var/lib/cobbler/distro_signatures.json ]; then
fi
cp /etc/contrail_smgr/cobbler/distro_signatures.json-esxi55 /etc/cobbler/distro_signatures.json
cp /etc/contrail_smgr/cobbler/distro_signatures.json-esxi55 /var/lib/cobbler/distro_signatures.json
cd /etc/contrail_smgr/contrail-centos-repo
createrepo .
cd /etc/contrail_smgr/contrail-redhat-repo
createrepo .

# Copy cobbler boot.cfg template file for esxi5.5
cp -f /etc/contrail_smgr/cobbler/bootcfg_esxi55.template /etc/cobbler/pxe
Expand Down
22 changes: 21 additions & 1 deletion common/debian/contrail-server-manager/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ else
pkg_file := $(src_path)/../../../tools/packaging/tools/scripts/server-manager-thirdparty
endif

ifdef CENTOS_PKT_FILE
centos_pkg_file := $(_centosPkgFile)
else
centos_pkg_file := $(src_path)/../../../tools/packaging/tools/scripts/server-manager-centos
endif

ifdef REDHAT_PKT_FILE
redhat_pkg_file := $(_redhatPkgFile)
else
redhat_pkg_file := $(src_path)/../../../tools/packaging/tools/scripts/server-manager-redhat
endif

ifdef PKG_DIRS
pkg_sources := $(_pkgDirs)
Expand All @@ -61,6 +72,8 @@ override_dh_auto_install:
install -d -m 755 $(build_root)/opt/contrail/server_manager/
install -d -m 754 $(build_root)/etc/init.d/
install -d -m 754 $(build_root)/etc/contrail_smgr/
install -d -m 754 $(build_root)/etc/contrail_smgr/contrail-centos-repo/
install -d -m 754 $(build_root)/etc/contrail_smgr/contrail-redhat-repo/
install -d -m 754 $(build_root)/usr/sbin/
install -d -m 755 $(build_root)/usr/lib/$(python_dir)/dist-packages/cobbler/modules/
# Copy/install files
Expand Down Expand Up @@ -89,14 +102,21 @@ override_dh_auto_install:
cp -r $(src_path)/ntp.conf $(build_root)/etc/contrail_smgr/

cp -r $(src_path)/puppet $(build_root)/etc/contrail_smgr/
cp -r $(src_path)/repos/contrail-centos-repo $(build_root)/etc/contrail_smgr/
cp -r $(src_path)/cobbler $(build_root)/etc/contrail_smgr/
cp -r $(src_path)/kickstarts $(build_root)/etc/contrail_smgr/

$(src_path)/../../../tools/packaging/tools/scripts/copy_thirdparty_packages.py --package-file $(pkg_file) \
--destination-dir $(build_root)/var/www/html/thirdparty_packages \
--source-dirs $(pkg_sources) || (echo "Copying Built packages failed"; exit 1)

$(src_path)/../../../tools/packaging/tools/scripts/copy_thirdparty_packages.py --package-file $(centos_pkg_file) \
--destination-dir $(build_root)/etc/contrail_smgr/contrail-centos-repo \
--source-dirs $(pkg_sources) || (echo "Copying Built centos packages failed"; exit 1)

$(src_path)/../../../tools/packaging/tools/scripts/copy_thirdparty_packages.py --package-file $(redhat_pkg_file) \
--destination-dir $(build_root)/etc/contrail_smgr/contrail-redhat-repo \
--source-dirs $(pkg_sources) || (echo "Copying Built redhat packages failed"; exit 1)

override_dh_shlibdeps:

override_dh_usrlocal:
30 changes: 29 additions & 1 deletion common/rpm/contrail-server-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
%define _pkg_file %{_builddir}/../tools/packaging/tools/scripts/server-manager-thirdparty
%endif

%if 0%{?_centospkgFile:1}
%define _centos_pkg_file %{_centospkgFile}
%else
%define _centos_pkg_file %{_builddir}/../tools/packaging/tools/scripts/server-manager-centos
%endif

%if 0%{?_redhatpkgFile:1}
%define _redhat_pkg_file %{_redhatpkgFile}
%else
%define _redhat_pkg_file %{_builddir}/../tools/packaging/tools/scripts/server-manager-redhat
%endif

%if 0%{?_pkgDirs:1}
%define _pkg_sources %{_pkgDirs}
Expand Down Expand Up @@ -147,6 +158,13 @@ easy_install pycrypto
easy_install ordereddict

mkdir -p %{_contrailetc}/images/

cd %{_contrailetc}/contrail-centos-repo
createrepo .

cd %{_contrailetc}/contrail-redhat-repo
createrepo .

service httpd start
service xinetd restart
service sqlite start
Expand Down Expand Up @@ -185,6 +203,8 @@ install -d -m 755 %{buildroot}%{_contrailopt}
install -d -m 755 %{buildroot}%{_contrailetc}
install -d -m 755 %{buildroot}%{_initdetc}
install -d -m 755 %{buildroot}%{_contrailopt}%{_contrail_smgr}
install -d -m 755 %{buildroot}%{_contrailetc}/contrail-centos-repo
install -d -m 755 %{buildroot}%{_contrailetc}/contrail-redhat-repo
#install -d -m 755 %{buildroot}%{_cobbleretc}
#install -d -m 755 %{buildroot}%{_puppetetc}

Expand Down Expand Up @@ -213,7 +233,7 @@ cp %{_contrail_smgr_src}third_party/bottle.py %{buildroot}%{_contrailopt}%{_cont

cp %{_contrail_smgr_src}contrail-server-manager %{buildroot}%{_initdetc}
cp -r %{_contrail_smgr_src}/puppet %{buildroot}%{_contrailetc}
cp -r %{_contrail_smgr_src}repos/contrail-centos-repo %{buildroot}%{_contrailetc}
#cp -r %{_contrail_smgr_src}repos/contrail-centos-repo %{buildroot}%{_contrailetc}
cp -r %{_contrail_smgr_src}cobbler %{buildroot}%{_contrailetc}
cp -r %{_contrail_smgr_src}kickstarts %{buildroot}%{_contrailetc}
cp %{_contrail_smgr_src}contrail-server-manager.start %{buildroot}%{_sbinusr}contrail-server-manager
Expand All @@ -230,6 +250,14 @@ cp %{_contrail_smgr_src}third_party/server_pre_install.py %{buildroot}%{_pysitep
--destination-dir %{buildroot}/var/www/html/thirdparty_packages \
--source-dirs %{_pkg_sources} || (echo "Copying Built packages failed"; exit 1)

%{_builddir}/../tools/packaging/tools/scripts/copy_thirdparty_packages.py --package-file %{_centos_pkg_file} \
--destination-dir %{buildroot}%{_contrailetc}/contrail-centos-repo \
--source-dirs %{_pkg_sources} || (echo "Copying Built centos packages failed"; exit 1)

%{_builddir}/../tools/packaging/tools/scripts/copy_thirdparty_packages.py --package-file %{_redhat_pkg_file} \
--destination-dir %{buildroot}%{_contrailetc}/contrail-redhat-repo \
--source-dirs %{_pkg_sources} || (echo "Copying Built redhat packages failed"; exit 1)

%clean
rm -rf %{buildroot}

Expand Down

0 comments on commit 13d7e8f

Please sign in to comment.