Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new formula for Amanda community edition client

New formula for the Amanda cummunity edition client,
Amanda describes themselves as "the most popular open
source backup and recovery software in the world."
Amanda makes publicly available pre-built binary clients
for Linux, Solaris, and Windows, but not OS X.
  • Loading branch information...
commit c2d8d7ccac6cacfd144dfe58713cabccf0823d97 1 parent 9b3044f
@nmadura authored
Showing with 70 additions and 0 deletions.
  1. +70 −0 Library/Formula/amanda.rb
View
70 Library/Formula/amanda.rb
@@ -0,0 +1,70 @@
+require 'formula'
+
+# this formula was created by Nathaniel Madura (nmadura at umich dot edu)
@adamv
adamv added a note

We typically don't carry block comments on formulae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+# It is to make an Amanda (community edition) backup client for OS X
+# Amanda runs a specific user, instructions for creating that user on
+# a 10.5+ machine are included in the caveats.
+
+class Amanda < Formula
+ homepage 'http://amanda.org/'
+ url 'http://downloads.sourceforge.net/project/amanda/amanda%20-%20stable/3.3.1/amanda-3.3.1.tar.gz'
+ md5 'dae7631b4abcf7eac874df6e3740e75b'
+
+ depends_on 'glib'
+ depends_on 'pkg-config' => :build
+ depends_on 'gettext'
+ depends_on 'cairo' if ARGV.include? '--with-gnuplot'
+
+ def options
+ [
+ ['--with-gnuplot', "Enable amanda plotting module."],
+ ]
+ end
+
+ def install
+# ENV.append "PKG_CONFIG", "#{HOMEBREW_PREFIX}/bin/pkg-config"
@adamv
adamv added a note

Please remove this commented-out code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+ args = ["--prefix=#{prefix}",
+ "--disable-dependency-tracking",
+ # specify user and group to run amanda as, see caveats below
+ "--with-user=amandabackup",
+ "--with-group=admin",
+ "--with-ssh-security",
+ # this is the client package, unknow if OS X can be installed with a server package
+ "--without-server",
+ # amanda typically installs perl scripts, for the time being I am hiding these in the
+ # cellar.
+ "--without-amperldir"]
+
+ # cairo, or one of its dependencies does not appear to be installing on PPC

We don't support PPC anymore, so not an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ if ARGV.include? '--with-gnuplot'
+ args << "-I#{Formula.factory('cairo').lib}"
@adamv
adamv added a note

check the indentation here; we use 2 space indents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ args << "-I#{Formula.factory('cairo').include}"
+ end
+
+ system "./configure", *args
+ system "make"
+ # amanda wants setuid root
+ system "echo 'This package requires setuid root on amservice.'"
+ system "sudo make install"
@adamv
adamv added a note

We can't run sudo or other command that requires user input from inside a formula

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ end
+
+ def caveats
+ puts <<BEGIN
+Issue the following to create the correct user account
+sudo dscl localhost -create /Local/Default/Users/amandabackup
+sudo dscl localhost -create /Local/Default/Users/amandabackup RecordName amandabackup
+sudo dscl localhost -create /Local/Default/Users/amandabackup UserShell /bin/bash
+sudo dscl localhost -create /Local/Default/Users/amandabackup RealName "Backup User"
+sudo dscl localhost -create /Local/Default/Users/amandabackup UniqueID 5000
+sudo dscl localhost -create /Local/Default/Users/amandabackup PrimaryGroupID 0
+sudo dscl localhost -append /Local/Default/Groups/admin GroupMembership amandabackup
+sudo dscl localhost -create /Local/Default/Users/amandabackup NFSHomeDirectory /Users/amandabackup
+sudo ditto -rsrcFork '/System/Library/User Template/English.lproj/' /Users/amandabackup
+sudo sh -c "echo 'amandabackup_server.example.com amandabackup' > /Users/amandabackup/.amandahosts"
+sudo chmod 600 /Users/amandabackup/.amandahosts
+sudo chown -R amandabackup:wheel /Users/amandabackup
+sudo passwd amandabackup
+BEGIN

Caveats should return a string, not puts directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ end
+end
@adamv

check the indentation here; we use 2 space indents

@adamv

We typically don't carry block comments on formulae

@adamv

Please remove this commented-out code.

@adamv

We can't run sudo or other command that requires user input from inside a formula

@jacknagel

Caveats should return a string, not puts directly.

@jacknagel

We don't support PPC anymore, so not an issue

Please sign in to comment.
Something went wrong with that request. Please try again.