forked from cogini/chef-cookbooks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a335ff9
commit 281d4e0
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default[:libav][:version] = 'release/9' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name 'libav' | ||
maintainer 'Cogini' | ||
maintainer_email '[email protected]' | ||
license 'All rights reserved' | ||
description 'Installs/Configures libav' | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | ||
version '0.1.0' | ||
|
||
depends 'apt' | ||
depends 'git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
include_recipe "apt" | ||
include_recipe "git" | ||
include_recipe "fpm" | ||
|
||
|
||
chef_cache = Chef::Config[:file_cache_path] | ||
version = node[:libav][:version] | ||
source_dir = "#{chef_cache}/libav" | ||
|
||
pkg_file = "#{chef_cache}/libav-#{version}.deb" | ||
pkg_type = pkg_file[-3..-1] | ||
|
||
|
||
unless File.exist?(pkg_file) | ||
|
||
bash "Get libav source" do | ||
code <<-EOH | ||
[[ -d #{source_dir} ]] || git clone git://git.libav.org/libav.git #{source_dir} | ||
cd #{source_dir} | ||
git fetch | ||
git checkout #{version} | ||
EOH | ||
end | ||
|
||
bash 'Compile libav' do | ||
cwd source_dir | ||
code <<-EOH | ||
apt-get build-dep -y libav | ||
./configure | ||
make | ||
make install DESTDIR=#{source_dir}/install | ||
fpm -s dir -t #{pkg_type} -n libav -v 1 -p #{pkg_file} -C install . | ||
EOH | ||
end | ||
|
||
end | ||
|
||
|
||
package "libav" do | ||
action :install | ||
source pkg_file | ||
provider node[:fpm][:provider] | ||
end |