From 5c05fa0f913be3047e0787c7bc25f518cb050384 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 24 Jul 2011 18:12:25 -0400 Subject: [PATCH] added builddep command. --- README.md | 6 ++++++ manifests/builddep.pp | 16 ++++++++++++++++ tests/builddep.pp | 2 ++ 3 files changed, 24 insertions(+) create mode 100644 manifests/builddep.pp create mode 100644 tests/builddep.pp 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': }
-- 
2.32.3