Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* new netatalk version - 3.0.3 allows symlinks \o/

  • Loading branch information...
commit 92324186561025430d9b11c57bb8fc675645f24f 1 parent d2ce0ad
Ali Jelveh authored February 15, 2013
69  netatalk.rb
... ...
@@ -1,7 +1,7 @@
1 1
 dep "netatalk.complete" do
2 2
   requires  "cups.managed", "libpam0g-dev.managed", 
3 3
             "libdb4.8.managed", "libdb4.8-dev.managed", 
4  
-            "netatalk.source", "netatalk config", "netatalk permissions", "enable timemachine volumes"
  4
+            "netatalk.source", "netatalk config", "libavahi-client-dev.managed"
5 5
 end
6 6
 
7 7
 dep "libssl-dev.managed" do
@@ -36,72 +36,35 @@
36 36
   provides []
37 37
 end
38 38
 
  39
+dep "libavahi-client-dev.managed" do
  40
+  provides []
  41
+end
  42
+
39 43
 dep "netatalk.source" do
40 44
   met? {
41  
-    which('netatalk-config')
  45
+    which('netatalk-config') && shell("netatalk-config --version") == "3.0.2"
42 46
   }
43 47
   meet {
44 48
     cd('/tmp') { |path|
45  
-      log_shell "downloading netatalk", "curl -LO http://prdownloads.sourceforge.net/netatalk/netatalk-2.2.4.tar.gz", {:spinner => true}
46  
-      log_shell "expanding", "tar xzf netatalk-2.2.4.tar.gz", {:spinner => true}
47  
-      # hostapd needs to build in the hostapd dir
48  
-      cd("netatalk-2.2.4") {
49  
-        log_shell "configuring", "./configure --enable-debian --with-pam"
  49
+      log_shell "downloading netatalk", "curl -LO http://downloads.sourceforge.net/project/netatalk/netatalk/3.0.2/netatalk-3.0.2.tar.gz", {:spinner => true}
  50
+      log_shell "expanding", "tar xzf netatalk-3.0.2.tar.gz", {:spinner => true}
  51
+      cd("netatalk-3.0.2") {
  52
+        log_shell "configuring", "./configure --enable-debian --with-pam --with-init-style=debian"
50 53
         log_shell "making", "make", {:spinner => true}
51 54
         log_shell "installing", "make install", {:spinner => true, :sudo => true}
52 55
       }
53 56
     }
54 57
   }
55  
-  
56 58
 end
57 59
 
58 60
 dep "netatalk config" do
59  
-  
60  
-  def config_path
61  
-    "/usr/local/etc/netatalk/afpd.conf"
62  
-  end
63  
-  
64  
-  met? {
65  
-    section_exists?(config_path, 'protonet-pam')
  61
+  met? { 
  62
+    babushka_config? ""
66 63
   }
67  
-  meet {
68  
-    append_to_file_with_section("- -tcp -noddp -uamlist uams_dhx_pam.so,uams_dhx2_pam.so", config_path, 'protonet-pam', :sudo => true)
69  
-  }
70  
-  
71  
-end
72  
-
73  
-dep "netatalk permissions" do
74  
-  def config_path
75  
-    "/usr/local/etc/netatalk/AppleVolumes.default"
76  
-  end
77  
-  
78  
-  met? {
79  
-    grep(/:DEFAULT: options:upriv,usedots dperm:0770 fperm:0660 umask:0007/, "#{config_path}")
  64
+  meet { 
  65
+    render_erb "netatalk/netatalk.conf.erb", :to => "/usr/local/etc/afp.conf", :sudo => true
80 66
   }
81  
-  meet{
82  
-    old_defaults = ":DEFAULT: options:upriv,usedots"
83  
-    new_defaults = ":DEFAULT: options:upriv,usedots dperm:0770 fperm:0660 umask:0007"
84  
-    ruby = which("ruby")
85  
-    sudo("#{ruby} -pi -e \"gsub(/^#{old_defaults}$/, '#{new_defaults}')\" #{config_path}")    
  67
+  after {
  68
+    sudo "/etc/init.d/netatalk restart"
86 69
   }
87 70
 end
88  
-
89  
-dep "enable timemachine volumes" do
90  
-  
91  
-  def config_path
92  
-    "/usr/local/etc/netatalk/AppleVolumes.default"
93  
-  end
94  
-  
95  
-  met? {
96  
-    grep(/^~ options:tm$/, "#{config_path}")
97  
-  }
98  
-  meet {
99  
-    ruby = which("ruby")
100  
-    sudo("#{ruby} -pi -e \"gsub(/^~$/, '~ options:tm')\" #{config_path}")
101  
-    sudo("/etc/init.d/netatalk restart")
102  
-  }
103  
-end
104  
-
105  
-# sudo /etc/init.d/netatalk restart
106  
-
107  
-# add to monitoring
25  netatalk/afp.conf.erb
... ...
@@ -0,0 +1,25 @@
  1
+;
  2
+; Netatalk 3.x configuration file
  3
+;
  4
+
  5
+[Global]
  6
+; Global server settings
  7
+vol preset = default_for_all_vol
  8
+log file = /var/log/netatalk.log
  9
+uam list = uams_dhx.so,uams_dhx2.so
  10
+save password = no
  11
+
  12
+[default_for_all_vol]
  13
+file perm = 0660
  14
+directory perm = 0770
  15
+cnid scheme = dbd
  16
+;valid users = @protonet
  17
+
  18
+[Homes]
  19
+basedir regex = /home
  20
+follow symlinks = yes
  21
+
  22
+;[TimeMachine]
  23
+;path = /afp/tm_backup
  24
+;time machine = yes
  25
+;vol size limit = 350000

0 notes on commit 9232418

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