Skip to content

Commit 15c2c5f

Browse files
committed
netatalk 4.0.8
1 parent 1074ae9 commit 15c2c5f

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

Formula/n/netatalk.rb

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
class Netatalk < Formula
2+
desc "File server for Macs, compliant with Apple Filing Protocol (AFP)"
3+
homepage "https://netatalk.io"
4+
url "https://github.com/Netatalk/netatalk/releases/download/netatalk-4-0-8/netatalk-4.0.8.tar.xz"
5+
sha256 "d09d591521b27b91b1c2a6255a2e059af8c9fda43570f983f0a145706e5f7628"
6+
license all_of: [
7+
"GPL-2.0-only",
8+
"GPL-2.0-or-later",
9+
"LGPL-2.0-only",
10+
"LGPL-2.1-or-later",
11+
"BSD-2-Clause",
12+
"BSD-3-Clause",
13+
"MIT",
14+
]
15+
head "https://github.com/Netatalk/netatalk.git", branch: "main"
16+
17+
depends_on "docbook-xsl" => :build
18+
depends_on "meson" => :build
19+
depends_on "ninja" => :build
20+
depends_on "pkgconf" => :build
21+
22+
depends_on "berkeley-db@5" # macOS bdb library lacks DBC type etc.
23+
depends_on "cracklib"
24+
depends_on "libevent"
25+
depends_on "libgcrypt"
26+
depends_on "mysql"
27+
depends_on "openldap" # macOS LDAP.Framework is not fork safe
28+
29+
uses_from_macos "libxslt" => :build
30+
31+
uses_from_macos "krb5"
32+
uses_from_macos "libxcrypt"
33+
uses_from_macos "perl"
34+
35+
on_linux do
36+
depends_on "avahi" # on macOS we use native mDNS instead
37+
depends_on "cups" # used by the AppleTalk print server
38+
depends_on "libtirpc" # on macOS we use native RPC instead
39+
end
40+
41+
patch do
42+
url "https://github.com/Netatalk/netatalk/commit/206fb7771862b9b98452c934dac884aaa397c8ca.patch?full_index=1"
43+
sha256 "fd448734556daf0344be4fa0bb09e4704c4123078ad804069d288aa0e3e104d6"
44+
end
45+
46+
def install
47+
inreplace "distrib/initscripts/macos.netatalk.in", "@sbindir@", opt_sbin
48+
inreplace "distrib/initscripts/macos.netatalk.plist.in", "@bindir@", opt_bin
49+
inreplace "distrib/initscripts/macos.netatalk.plist.in", "@sbindir@", opt_sbin
50+
inreplace "distrib/initscripts/systemd.netatalk.service.in", "@sbindir@", opt_sbin
51+
bdb5_rpath = rpath(target: Formula["berkeley-db@5"].opt_lib)
52+
ENV.append "LDFLAGS", "-Wl,-rpath,#{bdb5_rpath}" if OS.linux?
53+
args = [
54+
"-Dwith-afpstats=false",
55+
"-Dwith-appletalk=#{OS.linux?}", # macOS doesn't have an AppleTalk stack
56+
"-Dwith-bdb-path=#{Formula["berkeley-db@5"].opt_prefix}",
57+
"-Dwith-docbook-path=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl",
58+
"-Dwith-init-dir=#{prefix}",
59+
"-Dwith-init-hooks=false",
60+
"-Dwith-install-hooks=false",
61+
"-Dwith-statedir-path=#{var}",
62+
"-Dwith-pam-config-path=#{etc}/pam.d",
63+
"-Dwith-rpath=false",
64+
"-Dwith-spotlight=false",
65+
]
66+
67+
system "meson", "setup", "build", *args, *std_meson_args
68+
system "meson", "compile", "-C", "build", "--verbose"
69+
system "meson", "install", "-C", "build"
70+
end
71+
72+
service do
73+
name macos: "io.netatalk.daemon", linux: "netatalk"
74+
require_root true
75+
end
76+
77+
test do
78+
system sbin/"netatalk", "-V"
79+
system sbin/"afpd", "-V"
80+
assert_empty shell_output(sbin/"netatalk")
81+
end
82+
end

0 commit comments

Comments
 (0)