Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netatalk 4.0.8 (new formula) #202713

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions Formula/n/netatalk.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
class Netatalk < Formula
desc "File server for Macs, compliant with Apple Filing Protocol (AFP)"
homepage "https://netatalk.io"
url "https://github.com/Netatalk/netatalk/releases/download/netatalk-4-0-8/netatalk-4.0.8.tar.xz"
sha256 "d09d591521b27b91b1c2a6255a2e059af8c9fda43570f983f0a145706e5f7628"
license all_of: [
"GPL-2.0-only",
"GPL-2.0-or-later",
"LGPL-2.0-only",
"LGPL-2.1-or-later",
"BSD-2-Clause",
"BSD-3-Clause",
"MIT",
]
head "https://github.com/Netatalk/netatalk.git", branch: "main"

depends_on "docbook-xsl" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => :build

depends_on "berkeley-db@5" # macOS bdb library lacks DBC type etc.
depends_on "cracklib"
depends_on "libevent"
depends_on "libgcrypt"
depends_on "mysql"
depends_on "openldap" # macOS LDAP.Framework is not fork safe

uses_from_macos "libxslt" => :build

uses_from_macos "krb5"
uses_from_macos "libxcrypt"
uses_from_macos "perl"

on_linux do
depends_on "avahi" # on macOS we use native mDNS instead
depends_on "cups" # used by the AppleTalk print server
depends_on "libtirpc" # on macOS we use native RPC instead
end

patch do
url "https://github.com/Netatalk/netatalk/commit/206fb7771862b9b98452c934dac884aaa397c8ca.patch?full_index=1"
sha256 "fd448734556daf0344be4fa0bb09e4704c4123078ad804069d288aa0e3e104d6"
end

def install
inreplace "distrib/initscripts/macos.netatalk.in", "@sbindir@", opt_sbin
inreplace "distrib/initscripts/macos.netatalk.plist.in", "@bindir@", opt_bin
inreplace "distrib/initscripts/macos.netatalk.plist.in", "@sbindir@", opt_sbin
EricFromCanada marked this conversation as resolved.
Show resolved Hide resolved
inreplace "distrib/initscripts/systemd.netatalk.service.in", "@sbindir@", opt_sbin
bdb5_rpath = rpath(target: Formula["berkeley-db@5"].opt_lib)
ENV.append "LDFLAGS", "-Wl,-rpath,#{bdb5_rpath}" if OS.linux?
args = [
"-Dwith-afpstats=false",
"-Dwith-appletalk=#{OS.linux?}", # macOS doesn't have an AppleTalk stack
"-Dwith-bdb-path=#{Formula["berkeley-db@5"].opt_prefix}",
rdmark marked this conversation as resolved.
Show resolved Hide resolved
"-Dwith-docbook-path=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl",
"-Dwith-init-dir=#{prefix}",
carlocab marked this conversation as resolved.
Show resolved Hide resolved
"-Dwith-init-hooks=false",
"-Dwith-install-hooks=false",
"-Dwith-statedir-path=#{var}",
"-Dwith-pam-config-path=#{etc}/pam.d",
"-Dwith-rpath=false",
"-Dwith-spotlight=false",
]

system "meson", "setup", "build", *args, *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end

service do
name macos: "io.netatalk.daemon", linux: "netatalk"
rdmark marked this conversation as resolved.
Show resolved Hide resolved
require_root true
end

test do
system sbin/"netatalk", "-V"
system sbin/"afpd", "-V"
carlocab marked this conversation as resolved.
Show resolved Hide resolved
assert_empty shell_output(sbin/"netatalk")
end
end
Loading