Skip to content

Instantly share code, notes, and snippets.

@aglarond
Last active July 18, 2016 10:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aglarond/5320940 to your computer and use it in GitHub Desktop.
Save aglarond/5320940 to your computer and use it in GitHub Desktop.
Compiling Omnibus-Chef on FreeBSD 9.1

Create a build user

# adduser

(I like to call mine 'builder')

All '$' prompts below will be as this user.

All '#' prompts are as root.

Install RVM (you need a Ruby to build with)

$ curl -L https://get.rvm.io | bash -s stable --ruby

This will error out while building, so do

$ rvm requirements

and install the additional packages (using pkgng here):

# pkg install gcc curl readline libxml2 libxslt git autoconf automake diffutils gmake libtool bison subversion
  
$ rvm install 1.9.3

Download Omnibus sources

Using @jssjr`s forks until they're integrated upstream.

$ mkdir jssjr
$ cd jssjr
$ git clone -b freebsd https://github.com/jssjr/omnibus-ruby.git
$ git clone -b freebsd https://github.com/jssjr/omnibus-software.git
$ git clone -b freebsd https://github.com/jssjr/omnibus-chef.git

Install gem dependencies

$ rvm use --create default@omnibus
$ cd ~/jssjr/omnibus-chef
$ bundle install 2>&1| tee -a ~/logs/omnibus-chef-bundle.log

Configure Omnibus

$ cat >omnibus.rb<<EOF
Omnibus.configure do |o|
  o.use_s3_caching = false
  o.cache_dir = "/home/builder/cache"
  o.source_dir = "/home/builder/src"
  o.build_dir = "/home/builder/build"
  o.package_dir = "/home/builder/pkg"
end
$ EOF

Build Chef

Create what shouldn't exist under BSD...

# mkdir -p /opt/chef
# chown builder /opt/chef

Here I show how to create a specific version. If you want the latest, just leave off the 'CHEF_GIT_REV' part before 'rake'.

$ cd ~/jssjr/omnibus-chef
$ rvm use default@omnibus
$ CHEF_GIT_REV=10.24.0 rake projects:chef 2>&1| tee -a ~/logs/chef-client-build.log

That's it!

Now you've got Omnibus-Chef built for FreeBSD. See the following thread for background information: http://lists.opscode.com/sympa/arc/chef-dev/2013-03/msg00027.html

A huge thanks to Scott Sanders (@jssjr) for providing the patches that made this so easy to install on FreeBSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment