<?xml version="1.0" encoding="utf-8"?>
<appendix id="compile">
	<appendixinfo>
		<pubdate>2024-10-18</pubdate>
	</appendixinfo>
	<title>Compile Netatalk from Source</title>
	<sect1 id="compile-overview">
		<title>Overview</title>
	</sect1>
	<sect1>
		<para>
  This appendix describes how to compile Netatalk from source for specific operating systems.
  Before starting, please read through the Installation chapter first.
  You need to have a copy of Netatalk's source code before proceeding.
  </para>
		<para>
  Please note that these guides are automatically generated, and may not be optimized for your system.
  Also, the steps for launching Netatalk are incomplete for some OSes, because of technical constraints.
  </para>
	</sect1>
	<sect1 id="compile-os">
		<title>Operating Systems</title>
	</sect1>
	<sect1>
		<sect2 id="build-alpine">
			<title>Alpine Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>apk add \
  acl-dev \
  avahi-compat-libdns_sd \
  avahi-dev \
  bison \
  build-base \
  cracklib \
  cracklib-dev \
  cracklib-words \
  cups \
  cups-dev \
  curl \
  db-dev \
  dbus-dev \
  docbook-xsl \
  flex \
  gcc \
  krb5-dev \
  libevent-dev \
  libgcrypt-dev \
  libtirpc-dev \
  libtracker \
  libxslt \
  linux-pam-dev \
  mariadb-dev \
  meson \
  ninja \
  openldap-dev \
  openrc \
  perl \
  pkgconfig \
  rpcsvc-proto-dev \
  talloc-dev \
  tracker \
  tracker-dev \
  tracker-miners \
  unicode-character-database
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-archlinux">
			<title>Arch Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>pacman -Sy --noconfirm \
  avahi \
  cmark-gfm \
  cracklib \
  cups \
  db \
  docbook-xsl \
  gcc \
  libxslt \
  mariadb-clients \
  meson \
  ninja \
  perl \
  pkgconfig \
  rpcsvc-proto \
  unicode-character-database
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-docbook-path=/usr/share/xml/docbook/xsl-stylesheets-1.79.2 \
  -Dwith-init-hooks=false \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-debian">
			<title>Debian Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>apt-get update
apt-get install --assume-yes --no-install-recommends \
  bison \
  cmark-gfm \
  cracklib-runtime \
  docbook-xsl \
  file \
  flex \
  libacl1-dev \
  libavahi-client-dev \
  libcrack2-dev \
  libcups2-dev \
  libdb-dev \
  libdbus-1-dev \
  libevent-dev \
  libgcrypt-dev \
  libglib2.0-dev \
  libkrb5-dev \
  libldap2-dev \
  libmariadb-dev \
  libpam0g-dev \
  libtalloc-dev \
  libtirpc-dev \
  libtracker-sparql-3.0-dev \
  libwrap0-dev \
  meson \
  ninja-build \
  quota \
  systemtap-sdt-dev \
  tcpd \
  tracker \
  tracker-miner-fs \
  unicode-data \
  xsltproc
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-init-hooks=false \
  -Dwith-init-style=debian-sysv,systemd \
  -Dwith-pkgconfdir-path=/etc/netatalk \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-fedora">
			<title>Fedora Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>dnf --setopt=install_weak_deps=False --assumeyes install \
  avahi-devel \
  bison \
  chkconfig \
  cracklib-devel \
  cups-devel \
  dbus-devel \
  docbook-style-xsl \
  flex \
  glib2-devel \
  krb5-devel \
  libacl-devel \
  libdb-devel \
  libgcrypt-devel \
  libtalloc-devel \
  libxslt \
  mariadb-connector-c-devel \
  meson \
  ninja-build \
  openldap-devel \
  pam-devel \
  perl \
  perl-Net-DBus \
  quota-devel \
  systemd \
  systemtap-sdt-devel \
  tracker \
  tracker-devel \
  unicode-ucd
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-init-hooks=false \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>sudo meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>sudo ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-opensuse">
			<title>openSUSE Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>zypper in -y \
  bison \
  cracklib-devel \
  dbus-1-devel \
  docbook-xsl-stylesheets \
  file \
  flex \
  gawk \
  gcc \
  libacl-devel \
  libavahi-devel \
  libdb-4_8-devel \
  libevent-devel \
  libgcrypt-devel \
  libmariadb-devel \
  libtalloc-devel \
  libtdb-devel \
  libtracker-sparql-3_0-0 \
  libxslt-tools \
  meson \
  ninja \
  openldap2-devel \
  pam-devel \
  perl \
  pkg-config \
  systemd \
  systemtap-sdt-devel \
  tcpd-devel \
  tracker \
  unicode-ucd
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-docbook-path=/usr/share/xml/docbook/stylesheet/nwalsh/1.79.2 \
  -Dwith-init-hooks=false \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-ubuntu">
			<title>Ubuntu Linux</title>
			<para>Install dependencies</para>
			<para>
				<screen>sudo apt-get update
sudo apt-get install --assume-yes --no-install-recommends \
  bison \
  cmark-gfm \
  cracklib-runtime \
  docbook-xsl \
  file \
  flex \
  libacl1-dev \
  libavahi-client-dev \
  libcrack2-dev \
  libcups2-dev \
  libdb-dev \
  libdbus-1-dev \
  libevent-dev \
  libgcrypt-dev \
  libglib2.0-dev \
  libkrb5-dev \
  libldap2-dev \
  libmariadb-dev \
  libpam0g-dev \
  libtalloc-dev \
  libtirpc-dev \
  libtracker-sparql-3.0-dev \
  libwrap0-dev \
  meson \
  ninja-build \
  quota \
  systemtap-sdt-dev \
  tcpd \
  tracker \
  tracker-miner-fs \
  unicode-data \
  xsltproc
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-init-hooks=false \
  -Dwith-manual-l10n=ja \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run distribution tests</para>
			<para>
				<screen>cd build &amp;&amp; meson dist &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>sudo meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
</screen>
			</para>
			<para>Start netatalk</para>
			<para>
				<screen>sudo systemctl start netatalk
sleep 1
asip-status localhost
</screen>
			</para>
			<para>Stop netatalk</para>
			<para>
				<screen>sudo systemctl stop netatalk</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>sudo ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-macos">
			<title>macOS</title>
			<para>Install dependencies</para>
			<para>
				<screen>brew install berkeley-db cmark-gfm docbook-xsl libxslt meson mysql talloc
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
</screen>
			</para>
			<para>Configure</para>
			<para>
				<screen>meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-tests=true \
  -Dwith-testsuite=true
</screen>
			</para>
			<para>Build</para>
			<para>
				<screen>meson compile -C build</screen>
			</para>
			<para>Run integration tests</para>
			<para>
				<screen>cd build &amp;&amp; meson test &amp;&amp; cd ..</screen>
			</para>
			<para>Install</para>
			<para>
				<screen>sudo meson install -C build</screen>
			</para>
			<para>Check netatalk capabilities</para>
			<para>
				<screen>/opt/homebrew/sbin/netatalk -V
/opt/homebrew/sbin/afpd -V
</screen>
			</para>
			<para>Start netatalk</para>
			<para>
				<screen>sudo netatalkd start
sleep 1
asip-status localhost
</screen>
			</para>
			<para>Stop netatalk</para>
			<para>
				<screen>sudo netatalkd stop</screen>
			</para>
			<para>Uninstall</para>
			<para>
				<screen>sudo ninja -C build uninstall</screen>
			</para>
		</sect2>
		<sect2 id="build-dflybsd">
			<title>DragonflyBSD</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg install -y \
  avahi \
  bison \
  db5 \
  docbook-xsl \
  krb5-devel \
  libevent \
  libgcrypt \
  libxslt \
  meson \
  mysql80-client \
  openldap26-client \
  perl5 \
  pkgconf \
  py39-gdbm \
  py39-sqlite3 \
  py39-tkinter \
  talloc \
  tracker3
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
meson setup build \
  -Dbuildtype=release \
  -Dwith-appletalk=true \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2 id="build-freebsd">
			<title>FreeBSD</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg install -y \
  avahi \
  bison \
  db5 \
  docbook-xsl \
  flex \
  libevent \
  libgcrypt \
  libxslt \
  meson \
  mysql84-client \
  openldap26-client-2.6.8 \
  p5-Net-DBus \
  perl5 \
  pkgconf \
  talloc \
  tracker3
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
meson setup build \
  -Dbuildtype=release \
  -Dpkg_config_path=/usr/local/libdata/pkgconfig \
  -Dwith-appletalk=true \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
cd build
meson test
cd ..
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
/usr/local/etc/rc.d/netatalk start
sleep 1
/usr/local/bin/asip-status localhost
/usr/local/etc/rc.d/netatalk stop
/usr/local/etc/rc.d/netatalk disable
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2 id="build-netbsd">
			<title>NetBSD</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg_add \
  avahi \
  bison \
  db5 \
  docbook-xsl \
  flex \
  gcc13 \
  gnome-tracker \
  heimdal \
  libcups \
  libevent \
  libgcrypt \
  libxslt \
  meson \
  mysql-client \
  p5-Net-DBus \
  perl \
  pkg-config \
  talloc \
  tex-unicode-data
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
meson setup build \
  -Dbuildtype=release \
  -Dpkg_config_path=/usr/pkg/lib/pkgconfig \
  -Dwith-appletalk=true \
  -Dwith-dtrace=false \
  -Dwith-krbV-uam=false \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
cd build
meson test
cd ..
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
service netatalk onestart
sleep 1
asip-status localhost
service netatalk onestop
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2 id="build-openbsd">
			<title>OpenBSD</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg_add -I \
  avahi \
  bison \
  db-4.6.21p7v0 \
  dbus \
  docbook-xsl \
  gcc-11.2.0p14 \
  libevent \
  libgcrypt \
  libtalloc \
  libxslt \
  mariadb-client \
  meson \
  openldap-client-2.6.8v0 \
  openpam \
  p5-Net-DBus \
  pkgconf \
  tracker3
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
meson setup build \
  -Dbuildtype=release \
  -Dpkg_config_path=/usr/local/lib/pkgconfig \
  -Dwith-appletalk=true \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
rcctl -d start netatalk
sleep 1
asip-status localhost
rcctl -d stop netatalk
rcctl -d disable netatalk
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2 id="build-omnios">
			<title>OmniOS</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg install \
  build-essential \
  pkg-config
curl -O https://pkgsrc.smartos.org/packages/SmartOS/bootstrap/bootstrap-trunk-x86_64-20240116.tar.gz
tar -zxpf bootstrap-trunk-x86_64-20240116.tar.gz -C /
export PATH=/opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:$PATH
pkgin -y install \
  avahi \
  docbook-xsl \
  gnome-tracker \
  libevent \
  libgcrypt \
  libxslt \
  meson \
  mysql-client \
  talloc
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
export PATH=/opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:$PATH
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
meson setup build \
  -Dbuildtype=release \
  -Dpkg_config_path=/opt/local/lib/pkgconfig \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-ldap-path=/opt/local \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
cd build
meson test
cd ..
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
sleep 1
svcadm enable svc:/network/netatalk:default
sleep 1
/usr/local/bin/asip-status localhost
svcadm disable svc:/network/netatalk:default
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2 id="build-solaris">
			<title>Solaris</title>
			<para>Install required packages</para>
			<para>
				<screen>pkg install \
  bison \
  flex \
  gcc \
  libevent \
  libgcrypt \
  ninja \
  pkg-config \
  python/pip
pip install meson
</screen>
			</para>
			<para>Configure and build</para>
			<para>
				<screen>set -e
curl https://www.unicode.org/Public/UNIDATA/UnicodeData.txt --output UnicodeData.txt
meson setup build \
  -Dbuildtype=release \
  -Dpkg_config_path=/usr/lib/amd64/pkgconfig \
  -Dwith-appletalk=true \
  -Dwith-dbus-sysconf-path=/usr/share/dbus-1/system.d \
  -Dwith-docbook-path=/usr/share/sgml/docbook/xsl-stylesheets \
  -Dwith-tests=true \
  -Dwith-testsuite=true
meson compile -C build
cd build
meson test
cd ..
meson install -C build
/usr/local/sbin/netatalk -V
/usr/local/sbin/afpd -V
sleep 1
svcadm enable svc:/network/netatalk:default
sleep 1
/usr/local/bin/asip-status localhost
svcadm disable svc:/network/netatalk:default
ninja -C build uninstall
</screen>
			</para>
		</sect2>
		<sect2></sect2>
	</sect1>
</appendix>