added builddep command.
authorMonty Taylor <mordred@inaugust.com>
Sun, 24 Jul 2011 22:12:25 +0000 (18:12 -0400)
committerMonty Taylor <mordred@inaugust.com>
Sun, 24 Jul 2011 22:19:22 +0000 (18:19 -0400)
README.md
manifests/builddep.pp [new file with mode: 0644]
tests/builddep.pp [new file with mode: 0644]

index 8beee7cf3b999b50f4243897674a902a6fcd6757..a6eee8026763c1b666bd313b9b2893dc29fa182c 100644 (file)
--- 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.
+<pre>
+apt::builddep { "glusterfs-server": }
+</pre>
+
 ### apt::force
 Force a package to be installed from a specific release.  Useful when using repositoires like Debian unstable in Ubuntu.
 <pre>
diff --git a/manifests/builddep.pp b/manifests/builddep.pp
new file mode 100644 (file)
index 0000000..79b7e29
--- /dev/null
@@ -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 (file)
index 0000000..c5a7a20
--- /dev/null
@@ -0,0 +1,2 @@
+class { 'apt': }
+apt::builddep{ 'foo': }