Overview
Starting with RightLink 6.1, full source packages are available in deb Debian/Ubuntu compatible) and RPM (Red Hat Enterprise Linux, Oracle Linux, CentOS, SUSE, etc) formats. The following guide will detail how to build or rebuild these packages. This would be useful to porting packages to new operating system variants, or tweaking/modifying aspects of the packages.
RightLink currently consists of three packages:
- The RightLink sandbox package. Named something like 'rightlink6-sandbox'. This package consists of ruby and rubygems. This package provides a stable ruby environment segregated from the system environment that is installed into /opt/rightscale/sandbox. This package must be built and/or installed before the RightLink package can be built.
- The RightLink package. Named like 'rightlink6'. This package consists of all executable code for rightlink. The code itself is a bundle of rubygems centered around the right_link gem. Supporting init scripts (sysvinit, upstart, systemd) are also included in this package.
- RightLink cloud packages. Named like rightlink6-cloud-ec2, rightlink6-cloud-openstack, etc. See the install guides below for lists of cloud package names. RightLink always needs to be installed in tandem with a cloud package to satisfy its package dependencies. Although source packages exist for these files they are architecture neutral packages which only lay down configuration files, so it's easier just to download them.
Building .deb packages
The following guide was developed on an Ubuntu system, though it should be applicable to Debian as well.
- Set up rightlink repositories according to http://support.rightscale.com/12-Guides/RightLink/RightLink_6.0/Install_RightLink/Ubuntu in order to pull down the source code.
- Install prerequisites
-
apt-get install -y devscripts fakeroot gdebi-core
- Install source packages for rightlink and rightlink-sandbox. Also download the appropriate cloud package, such as rightlink6-cloud-ec2. Available clouds are listed in the guide in Step 1 above.
-
apt-get source rightlink6
apt-get source rightlink6-sandbox
apt-get download rightlink6-cloud-<cloudname>
-
Build the sandbox source package, if needed. The sandbox package contains ruby and rubygems. If you're not rebuilding for an alternate system or upgrading ruby you also use the existing package. Assuming rebuild of package version of 6.1.5 in this case.
-
apt-get build-dep -y rightlink6-sandbox
pushd rightlink6-sandbox-6.1.5
# debuild used here, though many methods will do
debuild -us -uc -b
popd
- Build the rightlink package, if needed. The rightlink package needs the sandbox to be installed to build first. You may need to manually install dependencies of the sandbox package as well if they're not already installed on the system. gdebi is an alternate to dpkg that will also install dependencies for a package on disk. This saves the need to place the sandbox package in a repository so that apt may use dependency solving on it.
-
gdebi -n rightllink6-sandbox_6.1.5-0~precise_amd64.deb
pushd rightlink6-6.1.5
debuild -us -uc -b
popd
- Packages will be placed in root directory.
Building RPM packages CentOS/RHEL
The following guide was developed on CentOS, though any RHEL compatible variant should work as well. Examples are given using rpmbuild though mock may be used as well.
- Set up repositories according to http://support.rightscale.com/12-Guides/RightLink/RightLink_6.0/Install_RightLink/Red_Hat_Enterprise_Linux_and_CentOS in order to pull down source code.
-
Install prerequisite packages:
-
yum install yum-utils rpm-build
-
Download and install source packages for rightlink and rightlink-sandbox. Also download the appropriate cloud package, such as rightlink6-cloud-ec2. Available clouds are listed in the guide in Step 1 above.
-
yumdownloader --source rightlink6
yumdownloader --source rightlink6-sandbox
rpm -i rightlink6*.src.rpm
yumdownloader rightlink6-cloud-<cloudname>
- Build the sandbox source package, if needed. The sandbox package contains ruby and rubygems. If you're not rebuilding for an alternate system you also use the existing package.
-
yum-builddep -y rightlink6-sandbox*.src.rpm
rpmbuild -bb /root/rpmbuild/SPECS/rightlink-sandbox.spec
- Build the rightlink package. The rightlink package needs the sandbox to be installed to build first.
-
yum install /root/rpmbuild/RPMS/x86_64/rightlink6-sandbox*.rpm
yum-builddep -y rightlink6-6*.src.rpm
rpmbuild -bb /root/rpmbuild/SPECS/rightlink.spec
- Packages will be placed in /root/rpmbuild/RPMS/x86_64.
RPM packages on SUSE
- Set up repositories according to http://support.rightscale.com/12-Guides/RightLink/RightLink_6.0/Install_RightLink/SUSE_Linux_Enterprise_Server in order to pull down source code.
- Get rightlink and rightlink-sandbox source packages. Download appropriate cloud package as well. Zypper will download packages to/var/cache/zypp/packages/rightlink and
/var/cache/zypp/packages/rightlink-SRPMS
-
zypper refresh
zypper install -y -d -t package rightlink6-cloud-<cloudname>
cp /var/cache/zypp/packages/rightlink*/*.
-
Download and build the sandbox package
-
zypper source-install rightlink6-sandbox
rpmbuild -bb /usr/src/packages/SPECS/rightlink-sandbox.spec
-
Download and build rightlink package. The rightlink package needs the sandbox to be installed to build first.
-
zypper install /usr/src/packages/RPMS/x86_64/rightlink6-sandbox*
zypper source-install rightlink6
rpmbuild -bb /usr/src/packages/SPECS/rightlink.spec