3.4.1. Environment Preparation¶
3.4.1.1. Getting Started¶
Note
You can skip setting up mock
if you are generating an ISO from a release tarball!
3.4.1.1.1. Required Packages¶
Before we proceed, you’ll want to make sure that you have a few RPM packages installed on your system and that your build system has access to the Internet. If you’re using Enterprise Linux as your build system, you will need to enable EPEL for your system prior to proceeding.
3.4.1.1.1.1. Required RPMs¶
# Installing from EL 6:
$ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
$ sudo yum install -y augeas-devel createrepo genisoimage git gnupg2 \
libicu-devel libxml2 libxml2-devel libxslt libxslt-devel \
mock rpm-sign rpmdevtools clamav gcc gcc-c++ ruby-devel
# Installing from EL 7:
$ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum install -y augeas-devel createrepo genisoimage git gnupg2 \
libicu-devel libxml2 libxml2-devel libxslt libxslt-devel \
mock rpm-sign rpmdevtools clamav-update gcc gcc-c++ ruby-devel
# Installing from Fedora 23/24:
$ sudo dnf install -y augeas-devel createrepo genisoimage git gnupg \
libicu-devel libxml2 libxml2-devel libxslt libxslt-devel \
mock rpm-sign rpmdevtools clamav-update gcc gcc-c++ ruby-devel
Warning
Please use a non-root user for building SIMP!
Note
The SIMP build generates various keys and does quite a bit of package
signing. As such, your system must be able to keep its entropy pool
full at all times. If you check /proc/sys/kernel/random/entropy_avail
and it shows a number below 1024, then you should either make sure that
rngd
is running and pointed to a hardware source (preferred) or install
and use haveged.
3.4.1.2. Set Up Ruby¶
We highly recommend using RVM to make it easy to develop and test against several versions of Ruby at once without damaging your underlying Operating System.
3.4.1.2.1. RVM Installation¶
The following commands, taken from the RVM Installation Page can be used to install RVM for your user.
$ gpg2 --keyserver hkp://keys.gnupg.net --recv-keys \
409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.9
$ source ~/.rvm/scripts/rvm
3.4.1.2.2. Set the Default Ruby¶
You’ll want to use Ruby 2.1.9 as your default RVM for SIMP development.
$ rvm use --default 2.1.9
Note
Once this is done, you can simply type rvm use 2.1.9
.
3.4.1.2.3. Bundler¶
The next important tool is Bundler. Bundler makes it easy to install Gems and their dependencies. It gets this information from the Gemfile found in the root of each repo. The Gemfile contains all of the gems required for working with the repo. More info on Bundler can be found on the Bundler Rationale Page and more information on Rubygems can be found at Rubygems.org.
$ rvm all do gem install bundler
3.4.1.3. Configure Mock¶
Note
If you plan on just building from a tarball, you can skip this section.
Building SIMP from scratch makes heavy use of Mock to create clean packages. As such, you need to ensure that your system is ready.
3.4.1.3.1. Add Your User to the Mock Group¶
$ getent group mock > /dev/null || sudo newgrp mock
$ sudo usermod -a -G mock $USER
You may need to run newgrp
or logout and back in for the group settings to
take effect.
3.4.1.4. Prepare to Work¶
You are now ready to begin development!
Clone simp-core:
$ git clone https://github.com/simp/simp-core
$ cd simp-core
At this point, the master branch (latest 6.X) has been checked out. If this is the version of SIMP you want to build, you can move on to install gem dependencies.
If you need to build a specific version of SIMP:
- To check out a stable SIMP release, check out a tag:
$ git fetch --tags
$ git checkout tags/6.0.0-0
- To check out an unstable SIMP release, check out the latest HEAD:
$ git checkout master
$ git checkout 5.X
Note
SIMP >= 6.X (and future development) is maintained on the master
branch.
SIMP >= 5.2.X (legacy) is maintained on the 5.1.X
branch.
Warning
Any branch that is not tagged with a git tag should be treated as unstable.
Install gem dependencies:
$ bundle install