File netatalk.spec of Package netatalk.34547
#
# spec file for package netatalk
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define with_afpstats 0
%define with_tracker_spotlight 0
%define libmaj 0
%define dash_version %(echo %{version} | tr '.' '-')
Name: netatalk
Version: 3.1.18
Release: 0
Summary: AFP Fileserver for Macintosh Clients
License: GPL-2.0-or-later
Group: Productivity/Networking/System
URL: https://netatalk.sourceforge.net/
Source: https://github.com/Netatalk/netatalk/releases/download/netatalk-%{dash_version}/netatalk-%{version}.tar.xz
Source1: netatalk-latinize.pl
Source3: netatalk-upgrade_netatalk_AppleDB.sh
# see bnc#849598 and http://sourceforge.net/p/netatalk/bugs/538/
Patch0: %{name}-wrong-error-message.patch
Patch2: netatalk-libc-xattr.patch
Patch3: fce-afpd-fix-fce_event_names-array-overflow.patch
Patch4: netatalk-no-return-in-nonvoid.patch
# CVE-2024-38439 [bsc#1226430], off-by-one error resultant in a heap-based buffer overflow because of setting ibuf[PASSWDLEN] to \0 in FPLoginExt in login in etc/uams/uams_pam.c.|CVE-2024-38440 [bsc#1226429], off-by-one error resultant in a heap-based buffer overflow because of incorrectly using FPLoginExt in BN_bin2bn in etc/uams/uams_dhx_pam.c|CVE-2024-38441 [bsc#1226431], off-by-one error resultant in a heap-based buffer overflow because of setting ibuf[len] to \0 in FPMapName in afp_mapname in etc/afp/directory.c.
Patch5: netatalk-CVE-2024-38439,38440,38441.patch
BuildRequires: automake
BuildRequires: db-devel
BuildRequires: fdupes
BuildRequires: gcc7
BuildRequires: krb5-devel
BuildRequires: libacl-devel
BuildRequires: libavahi-devel
BuildRequires: libevent-devel
BuildRequires: libgcrypt-devel
BuildRequires: libtdb-devel
BuildRequires: libtool
BuildRequires: openldap2-devel
BuildRequires: openssl-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: systemd
BuildRequires: tcpd-devel
BuildRequires: zlib-devel
Requires: cyrus-sasl
Requires: db-utils
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %fillup_prereq
%{?systemd_requires}
%if 0%{?with_afpstats}%{?with_tracker_spotlight}
BuildRequires: dbus-1-devel
BuildRequires: dbus-1-glib-devel
%if 0%{?with_tracker_spotlight}
BuildRequires: tracker-devel
%endif
%endif
%description
Netatalk is an AFP fileserver. A system running Netatalk is capable
of serving many Macintosh clients simultaneously as an AppleShare
file server (AFP).
%package -n libatalk%{libmaj}
Summary: Netatalk AFP Fileserver for Macintosh Clients
Group: Development/Libraries/C and C++
%description -n libatalk%{libmaj}
Netatalk is an AFP fileserver. A system running Netatalk is capable
of serving many Macintosh clients simultaneously as an AppleShare
file server (AFP).
%package devel
Summary: Netatalk AFP Fileserver for Macintosh Clients
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: glibc-devel
%description devel
Netatalk is an AFP fileserver. A system running Netatalk is capable
of serving many Macintosh clients simultaneously as an AppleShare
file server (AFP).
This subpackage contains libraries and header files for developing
applications that want to make use of libatalk.
%prep
%setup -q -n netatalk-%{version}
%patch0 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
cp -avL %{SOURCE1} .
%build
autoreconf -fiv
LDFLAGS="-lpthread" \
CFLAGS="%{optflags} -Wall -g -pie -fpie -fno-strict-aliasing" \
%if 0%{?with_tracker_spotlight}
tracker_ver=$(rpm -q --queryformat="%%{VERSION}" tracker-devel|cut -d . -f 1-2)
%endif
export CC=gcc-7
%configure --bindir=%{_bindir} \
--disable-static \
--with-shadow \
--with-pam \
--with-ldap \
--with-acls \
--enable-pgp-uam \
--enable-krbV-uam \
--enable-overwrite \
--enable-quota \
--with-libevent=no \
--with-tdb=no \
--libexecdir=%{_libdir}/netatalk \
--localstatedir=%{_localstatedir}/lib \
--with-pkgconfdir=%{_sysconfdir}/netatalk \
%if %{with_afpstats} == 1
--with-afpstats \
%endif
%if 0%{?with_tracker_spotlight}
--with-tracker-pkgconfig-version=${tracker_ver} \
%endif
--with-init-style=suse-systemd
make
mkdir examples
cp netatalk-latinize.pl examples
%install
%make_install
install -m 755 %{SOURCE3} %{buildroot}%{_sbindir}/upgrade_netatalk_AppleDB.sh
#
find %{buildroot} -type f -name "*.la" -delete -print
%fdupes -s %{buildroot}%{_mandir}
%fdupes -s %{buildroot}%{_localstatedir}/lib
%pre
test -f etc/atalk/afpd.conf && {
echo
echo "netatalk config files have been moved to %{_sysconfdir}/afp.conf"
echo "a backup can be found in %{_sysconfdir}/atalk"
echo "please compare them before restarting the netatalk server"
}
test -f etc/netatalk/afpd.conf && {
echo
echo "netatalk config files have been moved to %{_sysconfdir}/afp.conf"
echo "a backup can be found in %{_sysconfdir}/netatalk"
echo "please compare them before restarting the netatalk server"
}
%service_add_pre netatalk.service
exit 0
%preun
%service_del_preun netatalk.service
%post
%service_add_post netatalk.service
%{fillup_only netatalk}
%postun
%service_del_postun netatalk.service
%post -n libatalk%{libmaj} -p /sbin/ldconfig
%postun -n libatalk%{libmaj} -p /sbin/ldconfig
%files
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%dir %{_libdir}/netatalk
%{_libdir}/netatalk/*
%{_mandir}/man?/*
%license COPYING
%doc AUTHORS CONTRIBUTORS COPYRIGHT NEWS VERSION examples
#
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/afp.conf
%config(noreplace) %{_sysconfdir}/%{name}/extmap.conf
%config(noreplace) %{_sysconfdir}/%{name}/dbus-session.conf
%if 0%{?with_afpstats}%{?with_tracker_spotlight}
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/netatalk-dbus.conf
%endif
%dir %{_sysconfdir}/pam.d
%config %{_sysconfdir}/pam.d/*
#
%{_unitdir}/netatalk.service
%{_localstatedir}/lib/%{name}
%files -n libatalk%{libmaj}
%{_libdir}/libatalk.so.*
%license COPYING
%doc COPYRIGHT
%files devel
%dir %{_datadir}/aclocal
%dir %{_includedir}/atalk
%{_libdir}/libatalk.so
%{_datadir}/aclocal/*
%{_includedir}/atalk/*
%changelog