From: Monty Taylor Date: Sun, 24 Jul 2011 22:12:25 +0000 (-0400) Subject: added builddep command. X-Git-Tag: 0.0.1~23 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5c05fa0f913be3047e0787c7bc25f518cb050384;hp=a11af502cd839efbdab56da95aa1965e75d7ae1c;p=puppet-modules%2Fpuppetlabs-apt.git added builddep command. --- diff --git a/README.md b/README.md index 8beee7c..a6eee80 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ Provides helpful definitions for dealing with Apt. ## Usage +### apt:builddep +Install the build depends of a specified package. +
+apt::builddep { "glusterfs-server": }
+
+ ### apt::force Force a package to be installed from a specific release. Useful when using repositoires like Debian unstable in Ubuntu.
diff --git a/manifests/builddep.pp b/manifests/builddep.pp
new file mode 100644
index 0000000..79b7e29
--- /dev/null
+++ b/manifests/builddep.pp
@@ -0,0 +1,16 @@
+# builddep.pp
+
+define apt::builddep() {
+
+  Class['apt'] -> Apt::Ppa[$title]
+
+  exec { "apt-update-${name}":
+    command     => "/usr/bin/apt-get update",
+    refreshonly => true,
+  }
+
+  exec { "apt-builddep-${name}":
+    command     => "/usr/bin/apt-get -y --force-yes build-dep $name",
+    notify  => Exec["apt-update-${name}"],
+  }
+}
diff --git a/tests/builddep.pp b/tests/builddep.pp
new file mode 100644
index 0000000..c5a7a20
--- /dev/null
+++ b/tests/builddep.pp
@@ -0,0 +1,2 @@
+class { 'apt': }
+apt::builddep{ 'foo': }