Git Product home page Git Product logo

fpm-cookery's Introduction

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!

fpm-cookery's People

Contributors

andytinycat avatar aussielunix avatar beddari avatar bernd avatar brandonmartin avatar davewongillies avatar deanwilson avatar devkid avatar djhaskin987 avatar foobarquaxx avatar glensc avatar gmathes avatar jjuarez avatar jordansissel avatar joschi avatar lloydpick avatar lukasz-e avatar lusis avatar mic92 avatar mlafeldt avatar mrprimate avatar nukemberg avatar phyber avatar piavlo avatar ryansch avatar sfzylad avatar skiold avatar smasset avatar thedrow avatar tomeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fpm-cookery's Issues

Import additional facts?

Would it be possible to have "operatingsystemmajrelease" available as a fact - maybe "osmajor"?

Some rpm names changed between CentOS 6 and 7 - specifically db4 vs. libdb4. Also systemd vs. upstart, etc. etc.

builddir being set wrong with multiple directories in source

This is my first time using fpm-cookery so feel free to smack me if this is user error.

I'm trying to package up Sonatype Nexus for internal deployment. The install file is at http://www.sonatype.org/downloads/nexus-latest-bundle.tar.gz. Unlike many sources, this one contains two directories at the top level, "nexus-2.11.3-01" and "sonatype-work".

What I'm finding is that "builddir" ends up set to tmp-build/sonatype-work which doesn't actually contain anything important. As a result I'm having to reference things with ".." in order to do what I need. It's a workaround but seems incorrect.

If nothing else, is there a way to manually set builddir within the recipe?

How do I install in /opt instead of /usr/share?

'destdir' doesn't work.

I have this:

(etc/'kafka').install Dir['config/*.properties']

bin.install Dir['bin/kafka-*.sh']

(opt/'kafka').mkdir

%w(bin contrib lib project core).each do |dir|
  opt('kafka').install dir
end

Probably completely wrong, because listing the contents of the rpm only talks about /usr/share.

How do I do it?

cleaning up empty directories after rpm uninstall

Hello,

Is there any way to specify fpm's --rpm-auto-add-directories (or even just --directories) option from a recipe?

For now, I have been using post-uninstall scripts to clean up empty dirs, but it would be nice if there were a simpler solution.

Thanks!

Allow to skip/delegate package building

While fpm-cookery has the ability to skip package building altogether, it is currently not possible to set it from a recipe or the command line.

I found the need for such a switch when trying to build a package with debuild. fpm-cookery would clone the repo just fine, and I defined the build method to shell out to debuild for package building. But then fpm was called to build another set of (empty) packages.

I know that using a different build tool is probably not intended (at least at the moment). But it might still be useful to delegate building to other tools that are better suited for the job at hand.

To give you an example: If I have a Git repo with a debian folder, I don't need to rewrite debian/rules in Ruby just so that fpm-cookery could build it. Instead, I'd like fpm-cookery to do the cloning and then shell out to, e.g., debuild.

I'd love to hear your thoughts on this.

Ignoring build_depends?

Does the fpm-cookery lib use the build_depends directive? I noticed that the YAML is broken in ruby package that I built using fpm-recipes. When I require 'yaml' in the irb build by fpm-cookery, it breaks.

Upon closer inspection, I noticed that libyaml-dev is not installed even though it is mentioned as a part of build_depends in the Ruby 1.9.3 recipe.

In the FPM::Cookery::Packager class, I noticed that these two lines:

RecipeInspector.verify!(recipe)
DependencyInspector.verify!(recipe.depends, recipe.build_depends)

are ignored, and that the DependencyInspector class does not exist.

Define dependencies per distro

I'm currently building packages as both .deb and .rpm variants. As Debian and RHEL based distros can't seem to agree on package/library naming standards, I believe the only option is to resort to two recipes per package, one for each package manager.

Is there currently a way, or would it be possible to define distro specific dependencies in a single recipe?

E.g.

deb-depends: 'lsb-release'
rpm-depends: 'redhat-lsb'

Thanks in advanced!

Can't specify build dir locations.

There doesn't appear to be a way to specify the build location for the temp directories and packaging output. Normally, building in the recipe directory is perfectly fine, but in some cases like shared drives, slow drives and other reasons, you might prefer your build directories to be on a separate disk or file path. Looking at the recipe.rb ruby source, this appears to be hard coded.

Exporting cflags

Is it possible or do you have an example of how to export cflags in the build method to use the hardening wrapper in debian? I have tried to export CFLAGS but fpm-cookery seems to have issues with that.

If you can be of any assistance or point me in the right direction I'd be greatful.

Thanks

Prevent vendor/release from being appended to version

I'd like to create RPMs that use a version string that matches the upstream version number exactly, and a release string that uses a format of <release-num>.el<rhel-version>.<repo-name>, e.g. 1.el6.myrepo. Similar conventions are used by popular RPM repos like EPEL, RepoForge, IUS, and so on.

However, it appears that fpm-cookery appends the vendor name and release string to the end of the version, and always keeps the package release number as "1". From reading #42 it seems this is intentional.

Is there any way to force fpm-cookery to use the EXACT version and release strings I specify?

Generate shlibs files for .deb packages

This request may we wildly off-beam, so feel free to shoot it down.

I have a cookery recipe to build a library. I am trying to do an old-school dpkg-buildpackage build of another library which depends on that library. The dpkg-buildpackage build fails because there is no dependency information for the first library. This is because the first library does not include a shlibs control file, without which dpkg cannot record the relevant information when it installs it.

There's some info about the whole sordid business here:

http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s8.6.4.3

is there a way to use fpm-cookery to generate a shlibs file when packaging a library? If not, could we have one?

Can't see how to set a minimum (or even exact) version dependency

it's possible I've just missed something, but how would i specify i need a particular version of some debian package? Have tried "depends 'somepackage-version'" and "depends 'somepackage=version'" without luck.

if it could have comparison too that'd just be gravy :)

target specific dependencies

Thinking about the issue where I have an application like ActiveMQ or Cassandra where I need a JDK installed. The problem is that hard coding a dep there doesn't work thanks to the clusterfuck that is distro package naming.

Right now I plan on managing this with Chef in my Brisk cookbook but a general dependency conditional based on target would be neat.

Permission error on cleanup when not root

Something like this:

-bash-4.1$ fpm-cook 
===> Starting package creation for teamcity-server-8.0.5 (centos, rpm)
===> 
===> Verifying build_depends and depends with Puppet
===> Verifying package: jdk
===> All build_depends and depends packages installed
===> Fetching source: 
===> Using cached file /opt/teamcity-agent/work/fpm-recipes/teamcity-server/cache/TeamCity-8.0.5.tar.gz
===> Building in /opt/teamcity-agent/work/fpm-recipes/teamcity-server/tmp-build/TeamCity
===> Installing into /opt/teamcity-agent/work/fpm-recipes/teamcity-server/tmp-dest
===> [FPM] Converting dir to rpm {}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> [FPM] Reading template {"path":"/usr/lib/ruby/gems/1.8/gems/fpm-0.4.42/templates/rpm.erb"}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
/usr/lib/ruby/1.8/fileutils.rb:1178:in `open': Permission denied - /tmp/package-dir-staging20131208-28170-1jkcjhp/var/lib/teamcity-server (Errno::EACCES)
    from /usr/lib/ruby/1.8/fileutils.rb:1178:in `entries'
    from /usr/lib/ruby/1.8/fileutils.rb:1178:in `entries'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1341:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `each'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1341:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `each'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1341:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `each'
    from /usr/lib/ruby/1.8/fileutils.rb:1340:in `postorder_traverse'
    from /usr/lib/ruby/1.8/fileutils.rb:760:in `remove_entry'
    from /usr/lib/ruby/1.8/fileutils.rb:613:in `rm_r'
    from /usr/lib/ruby/1.8/fileutils.rb:609:in `each'
    from /usr/lib/ruby/1.8/fileutils.rb:609:in `rm_r'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.42/lib/fpm/package.rb:274:in `cleanup_staging'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.42/lib/fpm/package.rb:267:in `cleanup'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/package/package.rb:69:in `cleanup'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:171:in `build_package'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:146:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:146:in `build_package'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:133:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:104:in `exec'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:68:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/book.rb:16:in `call'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/book.rb:16:in `load_recipe'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:64:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.16.2/bin/fpm-cook:7
    from /usr/bin/fpm-cook:19:in `load'
    from /usr/bin/fpm-cook:19

Crash on clean installation

bash-4.2$ gem install fpm-cookery
Fetching: systemu-2.6.5.gem (100%)
Successfully installed systemu-2.6.5
Fetching: addressable-2.3.7.gem (100%)
Successfully installed addressable-2.3.7
Fetching: json_pure-1.8.2.gem (100%)
Successfully installed json_pure-1.8.2
Fetching: hiera-1.3.4.gem (100%)
Successfully installed hiera-1.3.4
Fetching: facter-2.4.1.gem (100%)
Successfully installed facter-2.4.1
Fetching: puppet-3.7.5.gem (100%)
Successfully installed puppet-3.7.5
Fetching: fpm-cookery-0.26.1.gem (100%)
Successfully installed fpm-cookery-0.26.1
7 gems installed
bash-4.2$ fpm cook
Missing required -s flag. What package source did you want? {:level=>:warn}
Missing required -t flag. What package output did you want? {:level=>:warn}
Fix the above problems, and you'll be rolling packages in no time! {:level=>:fatal}
bash-4.2$ ^C
bash-4.2$ fpm
fpm       fpm-cook
bash-4.2$ fpm-cook
/home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/defaults.rb:488: warning: duplicated key at line 489 ignored: :queue_type
/home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb:42:in `<top (required)>': uninitialized constant Syck (NameError)
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:197:in `<module:YAML>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:132:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor/require_vendored.rb:4:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor.rb:40:in `require_libs'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet/vendor.rb:53:in `load_vendored'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet.rb:172:in `<module:Puppet>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/puppet-3.7.5/lib/puppet.rb:29:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/fpm-cookery-0.26.1/lib/fpm/cookery/dependency_inspector.rb:1:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/fpm-cookery-0.26.1/lib/fpm/cookery/packager.rb:3:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/backports-3.6.4/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/fpm-cookery-0.26.1/lib/fpm/cookery/cli.rb:4:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/builder/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/fpm-cookery-0.26.1/bin/fpm-cook:5:in `<top (required)>'
    from /home/builder/.rbenv/versions/2.2.1/bin/fpm-cook:23:in `load'
    from /home/builder/.rbenv/versions/2.2.1/bin/fpm-cook:23:in `<main>'

Picking up all files in a directory

Hi,

I'm trying to get it to pick up ALL files in the tmp-build folder. How do I do that?

(opt/'eventstore').install Dir['*'] only picks up a single subfolder:

===> Using cached file /opt/teamcity-agent/work/d29baefbba8cb0b/eventstore/cache/eventstore-mono-2.0.1.tgz
===> Building in /opt/teamcity-agent/work/d29baefbba8cb0b/eventstore/tmp-build/singlenode-web
===> Installing into /opt/teamcity-agent/work/d29baefbba8cb0b/eventstore/tmp-dest

https://github.com/haf/fpm-recipes/blob/master/eventstore/recipe.rb

Always exists with 0

E.g.

[16:38:05][Execute build] ######################################################################## 100.0%
[16:38:10][Execute build] /opt/teamcity-agent/work/8d6339da32842a9d/teamcity-server/recipe.rb:31:in `install': undefined method `mkdir' for "lib/teamcity-server":String (NoMethodError)
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:122:in `block (2 levels) in dispense'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:104:in `chdir'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:104:in `block in dispense'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:101:in `chdir'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/packager.rb:101:in `dispense'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:104:in `exec'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:68:in `block in execute'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/book.rb:16:in `call'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/book.rb:16:in `load_recipe'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/lib/fpm/cookery/cli.rb:64:in `execute'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.16.2/bin/fpm-cook:7:in `<top (required)>'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/bin/fpm-cook:23:in `load'
[16:38:10][Execute build] from /opt/teamcity-agent/.rbenv/versions/1.9.3-p484/bin/fpm-cook:23:in `<main>'
[16:38:10][Execute build] ===> Building in /opt/teamcity-agent/work/8d6339da32842a9d/teamcity-server/tmp-build/TeamCity
[16:38:10][Execute build] ===> Installing into /opt/teamcity-agent/work/8d6339da32842a9d/teamcity-server/tmp-dest
[16:38:10][Execute build]
[16:38:10][Step 1/1] Process exited with code 0

%config for rpm

the spec says there's config_files, useful for .deb, but not so useful for .rpm.

config_files '/etc/redis/redis.conf'

but i wonder what that statement mean? as if i build .rpm package using config_files, the files are marked as %config:

# rpm -qplc pkg/php-ClassLoader-1.2-1.noarch.rpm 
/usr/share/php/AbstractAutoload.php

meaning it's marked as %config, however, %config does have attributes, which really define it's usability, i.e default is to overwrite existing file preserve it as .rpmsave, but more useful is to preserve existing file and store new one as .rpmnew, which can be controlled as (in .spec):

%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/redis/redis.conf

so, i wonder which %config fpm-cookery (fpm?) uses, and can it be further tuned (like set those attributes per file or glob)

File source cannot extract archives like the url source

I appreciate the file source, and I have used it with an extracted tarball. However, it would make more sense if the file source behaved in the same way as the url source, so that using file instead of url could be as simple as downloading the file from the url and the using the file source instead.

At least for me, this would often be the case, especially with self-built tarballs.

Automatic configuration files

The configuration files need to be declared with:

config_files '/etc/init.d/serf'

When doing "real" Debian packages, everything in /etc is automatically declared as a configuration file (unless otherwise specified). It would be convenient to have the same thing.

I am still pretty new at fpm/fpm-cookery, so maybe this is a "problem" in fpm instead. Tell me.

Download artifacts or extra dependancies

So, I'm basically seeing how to to create a packaged version of nginx with various external modules included.

For example, following these instructions: https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source

From what I'm reading of the documentation, you can only download one thing. And if you want to download extra artefacts, thats not natively possible, unless you put them into the one download url and it downloaded them all at once (not ideal)

I thought omnibus might help, but thats more like creating a package of packages right?

calling configure with no args fails

calling configure with no arguments from a recipe fails with

/usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:7:in `system': can't convert nil into String (TypeError)
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:7:in `safesystem'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:41:in `configure'
    from /home/vagrant/build-recipes/recipes/tarsnap/recipe.rb:32:in `build'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:114:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:104:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:104:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:101:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:101:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:113:in `exec'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:77:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/book.rb:16:in `call'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/book.rb:16:in `load_recipe'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:73:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/bin/fpm-cook:7
    from /home/vagrant/bin/fpm-cook:19:in `load'
    from /home/vagrant/bin/fpm-cook:19

The issue is in argument_build (https://github.com/bernd/fpm-cookery/blob/master/lib/fpm/cookery/utils.rb#L24) which returns nil if the last argument is not a hash.

add SVN handler

I've got an MVP of an SVN handler here:

lusis@28a8a54

  • Since VCS urls can look like https, I decided to add a new attr to the block called :handler. It defaults to :curl.
  • The handler factory needs to be reworked a bit more. Right now it's conditional based. FPM::Cookery::SourceHandler::Template should probably have some sort of inheritance hook and drop the whole conditional aspect.
  • I dithered on doing URI-based tricks for revision vs. dealing with yet another attr for specifying VCS revision. In the end, I went the URI route. It's ugly and fragile but it works for now.
  • I created a new attr and query method on the Template to toggle the checksum process. I'm currently overriding it in SVN in the fetch method. This would PROBABLY work better as a constant?

I've tested it here with/without a revision query string and it works well. I've also validated that Curl-based fetches still work and checksum properly.

Before I go on and do a Git handler, I want to run this implementation up the flag pole and get opinions. It's not very testable in its current form so I'll have to refactor that as well. I think I also have some puts statements in there that I need to clean up.

Thoughts?

Support brew for dependancy resolution

$ sudo fpm-cook install-deps

===> Verifying build_depends and depends with Puppet
===> Verifying package: openssl-devel
===> Verifying package: pcre-devel
===> Verifying package: zlib-devel
===> Verifying package: openssl
===> Verifying package: pcre
===> Verifying package: zlib
===> Verifying package: logrotate
===> Verifying package: chkconfig
===> Verifying package: initscripts
===> Verifying package: shadow-utils
===> Verifying package: setup
===> Missing/wrong version packages: openssl-devel, pcre-devel, zlib-devel, openssl, pcre, zlib, logrotate, chkconfig, initscripts, shadow-utils, setup
===> Running as root; installing missing/wrong version build_depends and depends with Puppet
===> Installing package: openssl-devel
FATAL: While processing depends package 'openssl-devel':
FATAL: Mac OS X PKG DMG's must specify a package source.
FATAL: change from absent to present failed: Mac OS X PKG DMG's must specify a package source.

Boxen has done a lot with brew providers for packages in Puppet. It would be cool if fpm-cookery could use brew to look for the dependancies it needs?

Integrate into fpm?

My massive refactor of FPM is almost done. I was thinking:

fpm -s recipe -t rpm zeromq

Will use a cookery recipe to produce an rpm of zeromq. Thoughts?

Omnibus packaging is broken

In cli.rb you pass two arguments through to the Omnibus packager here.

The Omnibus packager is only expecting one in its initializer here. So when you try to package an Omnibus project it bails with:

/var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/omnibus_packager.rb:11:in `initialize': wrong number of arguments (2 for 1) (ArgumentError)
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/cli.rb:101:in `new'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/cli.rb:101:in `exec'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/cli.rb:69:in `block in execute'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/book.rb:16:in `call'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/book.rb:16:in `load_recipe'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/lib/fpm/cookery/cli.rb:65:in `execute'
from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
from /var/lib/gems/1.9.1/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
from /var/lib/gems/1.9.1/gems/fpm-cookery-0.17.1/bin/fpm-cook:7:in `<top (required)>'
from /usr/local/bin/fpm-cook:19:in `load'
from /usr/local/bin/fpm-cook:19:in `<main>'

fpm-cook fails to create rpm with fpm 0.4.36

0.4.35 works fine

0.4.36 gives me the following error output:

===> [FPM] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.u8d50m {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.TQZNi0 {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.npnxBD {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM] Processing files: mosh-1.2.4.fpm1-1.x86_64 {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
ERROR: [FPM] error: Bad syntax: %defattr(,root) {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM]  {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
ERROR: [FPM]     Bad syntax: %defattr(,root) {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM]  {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
===> [FPM] RPM build errors: {"file":"cabin/mixins/pipe.rb","line":"46","method":"block in pipe"}
WARNING: [FPM] no value for epoch is set, defaulting to nil {"file":"fpm/package/rpm.rb","line":"386","method":"epoch"}
===> Created package: /home/ryan/fpm/mosh/pkg/mosh-1.2.4.fpm1-1.x86_64.rpm
/usr/local/lib/ruby/gems/1.9.1/gems/fpm-0.4.36/lib/fpm/util.rb:56:in `safesystem': rpmbuild failed (exit code 1). Full command was:["rpmbuild", "-bb", "--define", "buildroot /tmp/package-rpm-build20130521-12426-1hruz5q/BUILD", "--define", "_topdir /tmp/package-rpm-build20130521-12426-1hruz5q", "--define", "_sourcedir /tmp/package-rpm-build20130521-12426-1hruz5q", "--define", "_rpmdir /tmp/package-rpm-build20130521-12426-1hruz5q/RPMS", "/tmp/package-rpm-build20130521-12426-1hruz5q/SPECS/mosh.spec"] (FPM::Util::ProcessFailed)
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-0.4.36/lib/fpm/package/rpm.rb:352:in `output'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/packager.rb:165:in `block in build_package'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/packager.rb:124:in `chdir'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/packager.rb:124:in `build_package'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/packager.rb:112:in `dispense'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/cli.rb:122:in `block (2 levels) in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/cli.rb:119:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/cli.rb:119:in `block in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/book.rb:8:in `call'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/book.rb:8:in `load_recipe'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/lib/fpm/cookery/cli.rb:115:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/fpm-cookery-0.13.0/bin/fpm-cook:7:in `<top (required)>'
    from /usr/local/bin/fpm-cook:23:in `load'
    from /usr/local/bin/fpm-cook:23:in `<main>'

The output about creating the rpm is also incorrect.

Can't build recipes that aren't named "recipe.rb"

Something's wrong with the Clamp command line parsing.

If I try to package without specifying the recipe name:

fpm-cook package

The package gets built.

If I try to specify the package name, it complains about "too many arguments":

fpm-cook package recipe-aws.rb
ERROR: too many arguments

See: 'fpm-cook package --help'

Cut a new gem

0.15 is incompatible with the latest fpm, and the gemspec doesn't restrict it to a compatible version.

Can you cut a new gem to Rubygems? I realise you're in the middle of making changes, but I think it would be wise to push a new gem as soon as is feasible.

Building with Bundler and custom gem path

When installing fpm-cookery using bundle install --path PATH, Ruby packages build with that version will also be installed to PATH.

e.g.

$ cat Gemfile
source 'https://rubygems.org'
gem 'fpm-cookery'
$ bundle install --path /tmp/gems
$ bundle exec fpm-cook

results in:

$ dpkg -c /home/vagrant/hiera-aws/pkg/rubygem-hiera-aws_0.5.0-0_all.deb
drwx------ 0/0               0 2014-06-14 10:17 ./
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/cache/
-rw-r--r-- 0/0           16896 2014-06-14 10:17 ./tmp/gems/ruby/1.8/cache/hiera-aws-0.5.0.gem
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/doc/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/specifications/
-rw-r--r-- 0/0            1827 2014-06-14 10:17 ./tmp/gems/ruby/1.8/specifications/hiera-aws-0.5.0.gemspec
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/
-rw-rw-r-- 0/0            5317 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/README.md
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/
-rw-rw-r-- 0/0            2271 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/aws_base_spec.rb
-rw-rw-r-- 0/0            5270 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/aws_rds_spec.rb
-rw-rw-r-- 0/0             100 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/spec_helper.rb
-rw-rw-r-- 0/0            2590 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/aws_backend_spec.rb
-rw-rw-r-- 0/0           10860 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/spec/aws_elasticache_spec.rb
-rw-rw-r-- 0/0            1159 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/hiera-aws.gemspec
-rw-rw-r-- 0/0             886 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/CHANGELOG.md
-rw-rw-r-- 0/0           11358 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/LICENSE
-rw-rw-r-- 0/0             288 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/.rubocop.yml
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/
-rw-rw-r-- 0/0            2181 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws_backend.rb
drwxr-xr-x 0/0               0 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws/
-rw-rw-r-- 0/0            4163 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws/elasticache.rb
-rw-rw-r-- 0/0             118 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws/version.rb
-rw-rw-r-- 0/0            2206 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws/rds.rb
-rw-rw-r-- 0/0            1401 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/lib/hiera/backend/aws/base.rb
-rw-rw-r-- 0/0             154 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/.gitignore
-rw-rw-r-- 0/0             410 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/Rakefile
-rw-rw-r-- 0/0             120 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/Gemfile
-rw-rw-r-- 0/0             129 2014-06-14 10:17 ./tmp/gems/ruby/1.8/gems/hiera-aws-0.5.0/.travis.yml

Any way I can fix this to still install to e.g. /var/lib/gems/1.8?

PS: I'm installing gems to /tmp to work around a problem with bundler + sudo + git-based gems.

Test fails on newer Mac OS

The pwd tests fail on Mac when running rake test. I will work on a change to take this into account. On Mac (atleast anything above Mac OS 9.x as far as I know) /tmp is hardlinked to /private/tmp

describe "Path" do
  describe ".pwd" do
    it "returns the current dir" do
      Dir.chdir('/tmp') do
        FPM::Cookery::Path.pwd.to_s.must_equal '/tmp'
      end
    end

    it "adds the given path to the current dir" do
      Dir.chdir('/tmp') do
        FPM::Cookery::Path.pwd('foo').to_s.must_equal '/tmp/foo'
      end
    end
  end

Here is me testing this from irb

1.9.3-p429 :003 > Dir.chdir('/tmp')
 => 0
1.9.3-p429 :004 > Dir.pwd
 => "/private/tmp"

Omnibus Packages don't seem to use a staging directory

When using the basic omnibustest recipe bundled with fpm-cookery, it seems that the "install" process attempts to create things in the omnibus directory on the actual filesystem of the build machine, rather than using a staging directory - this more often than not requires elevated privileges, which is not always desired for package building.

Map package dependencies but no install them on build

Hi all,

While trying to build artifacts I've discovered that fpm-cookery requires installation of packages informed on FPM::Cookery::Recipe.depends. This behavior is useful, of course; but I need to only map dependencies in my package metadata (RPM in this case), without install them.

I've tried to pass some information directly by FPM::Cookery::Recipe.fpm_attributes but after some research on code it not satisfies.

How I handle it? If allowed, it can be a feature to be developed.

Thank you.

Epoch method undefined, and Empty tag: Packager: {}

Greetings,

Testing with erlang r15.rb recipe from fpm-recipes

When the version is set to

version '1:16.b.1'

I get:

/usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:155:in `block in build_package': undefined method `epoch=' for #<FPM::Cookery::Package::Dir:0x002ad0c7ea8540> (NoMethodError)
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:146:in `chdir'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:146:in `build_package'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:133:in `dispense'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:104:in `exec'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:68:in `block in execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/book.rb:16:in `call'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/book.rb:16:in `load_recipe'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:64:in `execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:125:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/bin/fpm-cook:7:in `<top (required)>'
    from /usr/local/bin/fpm-cook:23:in `load'
    from /usr/local/bin/fpm-cook:23:in `<main>'

When I change the version to

version '16.b.1'

I get:

 ===> [FPM] Converting dir to rpm {}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> [FPM] Reading template {"path":"/usr/local/lib/ruby/gems/2.0.0/gems/fpm-0.4.42/templates/rpm.erb"}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> [FPM] Running rpmbuild {"args":["rpmbuild","-bb","--define","buildroot /tmp/package-rpm-build20131014-18734-7gl6w5/BUILD","--define","_topdir /tmp/package-rpm-build20131014-18734-7gl6w5","--define","_sourcedir /tmp/package-rpm-build20131014-18734-7gl6w5","--define","_rpmdir /tmp/package-rpm-build20131014-18734-7gl6w5/RPMS","/tmp/package-rpm-build20131014-18734-7gl6w5/SPECS/erlang-r16.spec"]}
ERROR: [FPM] error: line 50: Empty tag: Packager: {}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> Created package: /src/fpm-recipes/erlang/pkg/erlang-r16-16.b.1.fpm0-1.x86_64.rpm

I tested with other recipes and (such as the redis recipe) and I get

===> Installing into /src/fpm-recipes/redis/tmp-dest
===> [FPM] Converting dir to rpm {}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> [FPM] Reading template {"path":"/usr/local/lib/ruby/gems/2.0.0/gems/fpm-0.4.42/templates/rpm.erb"}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> [FPM] Running rpmbuild {"args":["rpmbuild","-bb","--define","buildroot /tmp/package-rpm-build20131014-23860-ovavku/BUILD","--define","_topdir /tmp/package-rpm-build20131014-23860-ovavku","--define","_sourcedir /tmp/package-rpm-build20131014-23860-ovavku","--define","_rpmdir /tmp/package-rpm-build20131014-23860-ovavku/RPMS","/tmp/package-rpm-build20131014-23860-ovavku/SPECS/redis-server.spec"]}
ERROR: [FPM] error: line 50: Empty tag: Packager: {}
WARNING: [FPM] no value for epoch is set, defaulting to nil {}
===> Created package: /src/fpm-recipes/redis/pkg/redis-server-2.6.5.fpm0-1.x86_64.rpm
/usr/local/lib/ruby/gems/2.0.0/gems/fpm-0.4.42/lib/fpm/util.rb:55:in `safesystem': rpmbuild failed (exit code 1). Full command was:["rpmbuild", "-bb", "--define", "buildroot /tmp/package-rpm-build20131014-23860-ovavku/BUILD", "--define", "_topdir /tmp/package-rpm-build20131014-23860-ovavku", "--define", "_sourcedir /tmp/package-rpm-build20131014-23860-ovavku", "--define", "_rpmdir /tmp/package-rpm-build20131014-23860-ovavku/RPMS", "/tmp/package-rpm-build20131014-23860-ovavku/SPECS/redis-server.spec"] (FPM::Util::ProcessFailed)
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-0.4.42/lib/fpm/package/rpm.rb:352:in `output'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:165:in `block in build_package'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:146:in `chdir'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:146:in `build_package'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/packager.rb:133:in `dispense'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:104:in `exec'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:68:in `block in execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/book.rb:16:in `call'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/book.rb:16:in `load_recipe'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/lib/fpm/cookery/cli.rb:64:in `execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/clamp-0.6.1/lib/clamp/command.rb:125:in `run'
    from /usr/local/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.16.1/bin/fpm-cook:7:in `<top (required)>'
    from /usr/local/bin/fpm-cook:23:in `load'
    from /usr/local/bin/fpm-cook:23:in `<main>'

Running centos5 system for the build.

Ruby 2.0.0

VERSION = '0.16.1'

The omnibustest build is failing?

Something with destdir not working? Haven't looked at it .. yet

[root@centos65 omnibustest]# /opt/fpm-refinery/embedded/bin/fpm-cook package recipe.rb
===> Recipe omnibus-test is an Omnibus package; looking for child recipes to build
===> Loading dependency recipe ruby from /vagrant/fpm-cookery/recipes/omnibustest/ruby.rb
/opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/omnibus_packager.rb:29:in `block (2 levels) in load_omnibus_recipes': undefined method `destdir=' for #<Module:0x00000002e6bcf0>::Ruby200 (NoMethodError)
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/book.rb:16:in `call'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/book.rb:16:in `load_recipe'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/omnibus_packager.rb:28:in `block in load_omnibus_recipes'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/omnibus_packager.rb:20:in `each'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/omnibus_packager.rb:20:in `load_omnibus_recipes'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/omnibus_packager.rb:44:in `run'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/cli.rb:108:in `exec'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/cli.rb:76:in `block in execute'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/book.rb:16:in `call'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/book.rb:16:in `load_recipe'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/lib/fpm/cookery/cli.rb:71:in `execute'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
        from /opt/fpm-refinery/embedded/lib/ruby/gems/2.0.0/gems/fpm-cookery-0.20.0/bin/fpm-cook:7:in `<top (required)>'
        from /opt/fpm-refinery/embedded/bin/fpm-cook:23:in `load'
        from /opt/fpm-refinery/embedded/bin/fpm-cook:23:in `<main>'

Linuxbrew

There is an experimental fork of homebrew to linux - which has the benefit of potentially including all the homebrew formulas, and may be integrated upstream at some point as it tries hard to keep compatible with the osx homebrew as much as possible.

How difficult would it be to integrate this rather than brew2deb?

Trying to build a package with scripts off master breaks

Looks like it's related to the changes to simply the Package objects:

    /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:200:in `block in add_scripts': undefined method `scripts' for #<FPM::Cookery::Package::Dir:0x00000004108b60> (NoMethodError)
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:189:in `each'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:189:in `add_scripts'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:157:in `block in build_package'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:146:in `chdir'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:146:in `build_package'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/packager.rb:133:in `dispense'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/omnibus_packager.rb:58:in `run'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/cli.rb:99:in `exec'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/cli.rb:69:in `block in execute'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/book.rb:16:in `call'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/book.rb:16:in `load_recipe'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/lib/fpm/cookery/cli.rb:65:in `execute'
from /var/lib/gems/1.9.1/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
from /var/lib/gems/1.9.1/gems/clamp-0.6.1/lib/clamp/subcommand/execution.rb:11:in `execute'
from /var/lib/gems/1.9.1/gems/clamp-0.6.1/lib/clamp/command.rb:67:in `run'
from /var/lib/gems/1.9.1/gems/clamp-0.6.1/lib/clamp/command.rb:125:in `run'
from /var/lib/gems/1.9.1/bundler/gems/fpm-cookery-b5813b48f06d/bin/fpm-cook:7:in `<top (required)>'
from /var/lib/gems/1.9.1/bin/fpm-cook:19:in `load'
from /var/lib/gems/1.9.1/bin/fpm-cook:19:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.