• Stars
    star
    459
  • Rank 95,377 (Top 2 %)
  • Language
    Ruby
  • License
    Other
  • Created about 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool for building software packages with fpm.

fpm-cookery - For building software

Build Status

A tool for building software packages with fpm.

The fpm project is really nice for building operating system packages like .deb and .rpm. But it only helps you to create the packages and doesn't help you with actually building the software.

fpm-cookery provides an infrastructure to automatically build software based on recipes. It's heavily inspired and borrows code from the great homebrew and brew2deb projects. The OpenBSD Ports System is probably another source of inspiration since I've been working with that for quite some time

It is using fpm to create the actual packages.

Documentation

Please find the documentation page here: https://fpm-cookery.readthedocs.org/

The documentation source is located in the docs/ folder. Pull requests welcome! :)

Hosting and building of the documentation is provided by the great Read the Docs project!

Why?

Building operating system packages for Debian/Ubuntu and RedHat using the official process and tools is pretty annoying if you just want some custom packages. Jordan's fpm removes the biggest hurdle by providing a simple command line tool to build packages for different operating systems.

Before you can use fpm to create the package, you have to build the software, though. In the past I've been using some shell scripts and Makefiles to automate this task.

Then I discovered Aman's brew2deb which is actually homebrew with some modifications to make it work on Linux. (only Debian/Ubuntu for now) Since homebrew was designed for Mac OS X, I thought it would be nice to have a "native" Linux tool for the job.

fpm-cookery is my attempt to build such a tool.

Features

  • Download of the source archives. (via curl(1))
  • Recipes to describe and execute the software build. (e.g. configure, make, make install)
  • Sandboxed builds.
  • Package creation via fpm.
  • Standalone recipe trees/books/you name it. No need to put the recipes into the fpm-cookery source tree.
  • Can build Omnibus style packages (allows you to embed many builds into the same package - used by the Opscode folks to build an embedded Ruby and the gems for Chef into a single package; also the Sensu guys do something similar.)

Upcoming Features

  • Recipe validation.
  • More source types. (hg, bzr, ...)
  • Progress output and logging.
  • Extend recipe features and build/install helpers.
  • Configuration file. (for stuff like vendor and maintainer)
  • Options for the fpm-cook command.
  • Manpage for the fpm-cook command.

Getting Started

fpm-cookery is available as a gem.

$ gem install fpm-cookery

Create a recipe directory or change into an existing recipe tree.

$ cd recipes/redis
$ fpm-cook clean
$ fpm-cook

You can install the development dependencies with bundle install and run the included test suite with rake test.

Status

It can build the included recipes/redis/recipe.rb and recipes/nodejs/recipe.rb recipes. (both imported from brew2deb) See CAVEATS for an incomplete list of missing stuff.

Example Recipe

The following is an example recipe. I have some more in my recipe collection over here.

    class Redis < FPM::Cookery::Recipe
      homepage 'http://redis.io'
      source   'http://redis.googlecode.com/files/redis-2.2.5.tar.gz'
      md5      'fe6395bbd2cadc45f4f20f6bbe05ed09'

      name     'redis-server'
      version  '2.2.5'
      revision '1'

      description 'An advanced key-value store.'

      conflicts 'redis-server'

      config_files '/etc/redis/redis.conf'

      def build
        make

        inline_replace 'redis.conf' do |s|
          s.gsub! 'daemonize no', 'daemonize yes'
        end
      end

      def install
        # make :install, 'DESTDIR' => destdir

        var('lib/redis').mkdir

        %w(run log/redis).each {|p| var(p).mkdir }

        bin.install ['src/redis-server', 'src/redis-cli']

        etc('redis').install 'redis.conf'
        etc('init.d').install 'redis-server.init.d' => 'redis-server'
      end
    end

CAVEATS

  • At the moment, there's only a small subset of the homebrew DSL implemented.
  • No recipe documentation and API documentation yet.
  • No recipe validation yet.
  • No dependency validation yet.
  • Pretty new and not well tested.

Credits

fpm-cookery borrows lots of ideas and also code from the homebrew and brew2deb projects.

License

The BSD 2-Clause License - See LICENSE for details

How To Contribute

  • I'd love to hear if you like it, hate it, use it and if you have suggestions and/or problems.
  • Send pull requests. (hugs for topic branches and tests)
  • Have fun!

More Repositories

1

statsd-influxdb-backend

A naive InfluxDB backend for StatsD
JavaScript
172
star
2

fpm-recipes

My collection of fpm-cookery recipes.
Ruby
145
star
3

cucumber-sinatra

Initialize a cucumber environment for sinatra.
Ruby
64
star
4

discourse-slack-plugin

Send notifications to slack for new topics in discourse
Ruby
41
star
5

nagios_parser

Ruby library for parsing Nagios status and config files
Ruby
31
star
6

librrd-ruby

Ruby bindings for librrd. Extracted from the RRDtool source.
C
18
star
7

spotify-backup

Backup Spotify saved tracks, artists and playlists
Ruby
12
star
8

webmachine-test

A testing API for webmachine-ruby.
Ruby
10
star
9

dcell-hazelcast

Hazelcast registry for DCell
Ruby
7
star
10

ruby-upstart

Ruby library to inspect and control the Ubuntu Upstart daemon.
Ruby
7
star
11

wunderlist-backup

Backup your Wunderlist data
Ruby
6
star
12

dropreact

Example Dropwizard & React application
JavaScript
4
star
13

smstraderb

Ruby client library for the smstrade.de HTTP API
Ruby
4
star
14

samsa

Pure Java port of the Kafka Log and LogManager
Java
3
star
15

as-notifications

extraction of ActiveSupport::Notifications from Ruby on Rails
Ruby
3
star
16

roboter

A robot framework. (WIP)
Ruby
2
star
17

dot.vim

My vim configuration
Vim Script
2
star
18

statsd-kairosdb-backend

KairosDB backend for StatsD
JavaScript
2
star
19

spinoff

Spinoff preloads your Ruby environment based on an initialization file.
Ruby
2
star
20

react-typescript-example

React + typescript
JavaScript
1
star
21

slides-rrdtool-rug-hh

Slides of my Rails User Group HH talk (german)
Ruby
1
star
22

guard-spinoff

Guard integration for Spinoff
Ruby
1
star
23

jsonserver

A simple server that accepts and prints pretty-printed JSON to STDOUT
Java
1
star