diff --git a/pkgs/tools/filesystems/netatalk/default.nix b/pkgs/tools/filesystems/netatalk/default.nix index 786c39c0100c..33b473df5a22 100644 --- a/pkgs/tools/filesystems/netatalk/default.nix +++ b/pkgs/tools/filesystems/netatalk/default.nix @@ -1,4 +1,7 @@ -{ fetchurl, stdenv, pkgconfig, db, libgcrypt, avahi, libiconv, pam, openssl, acl, ed, glibc, perl, python2 }: +{ fetchurl, stdenv, autoreconfHook, pkgconfig, perl, python +, db, libgcrypt, avahi, libiconv, pam, openssl, acl +, ed, glibc +}: stdenv.mkDerivation rec{ name = "netatalk-3.1.11"; @@ -8,14 +11,18 @@ stdenv.mkDerivation rec{ sha256 = "3434472ba96d3bbe3b024274438daad83b784ced720f7662a4c1d0a1078799a6"; }; - nativeBuildInputs = [ pkgconfig perl python2 ]; - buildInputs = [ db libgcrypt avahi libiconv pam openssl acl ]; + patches = [ + ./no-suid.patch + ./omitLocalstatedirCreation.patch + ]; - patches = ./omitLocalstatedirCreation.patch; + nativeBuildInputs = [ autoreconfHook pkgconfig perl python python.pkgs.wrapPython ]; + + buildInputs = [ db libgcrypt avahi libiconv pam openssl acl ]; configureFlags = [ "--with-bdb=${db}" - "--with-openssl=${openssl.dev}" + "--with-ssl-dir=${openssl.dev}" "--with-lockfile=/run/lock/netatalk" "--localstatedir=/var/lib" ]; @@ -36,6 +43,11 @@ stdenv.mkDerivation rec{ EOF ''; + postInstall = '' + buildPythonPath ${python.pkgs.dbus-python} + patchPythonScript $out/bin/afpstats + ''; + enableParallelBuilding = true; meta = { @@ -46,4 +58,3 @@ stdenv.mkDerivation rec{ maintainers = with stdenv.lib.maintainers; [ jcumming ]; }; } - diff --git a/pkgs/tools/filesystems/netatalk/no-suid.patch b/pkgs/tools/filesystems/netatalk/no-suid.patch new file mode 100644 index 000000000000..194c1f5fac9f --- /dev/null +++ b/pkgs/tools/filesystems/netatalk/no-suid.patch @@ -0,0 +1,11 @@ +diff --git a/bin/afppasswd/Makefile.am b/bin/afppasswd/Makefile.am +index 578eac1..d17aa22 100644 +--- a/bin/afppasswd/Makefile.am ++++ b/bin/afppasswd/Makefile.am +@@ -16,5 +16,5 @@ AM_CFLAGS = @SSL_CFLAGS@ -I$(top_srcdir)/sys \ + + install-exec-hook: + if HAVE_OPENSSL +- chmod u+s $(DESTDIR)$(bindir)/afppasswd ++# chmod u+s $(DESTDIR)$(bindir)/afppasswd + endif diff --git a/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch b/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch index 02a36df24a13..01c4ee9ba478 100644 --- a/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch +++ b/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch @@ -1,35 +1,19 @@ -diff -ur netatalk-3.1.11-old/config/Makefile.in netatalk-3.1.11-new/config/Makefile.in ---- netatalk-3.1.11-old/config/Makefile.in 2017-11-07 17:16:50.000000000 -0500 -+++ netatalk-3.1.11-new/config/Makefile.in 2017-11-07 17:17:33.000000000 -0500 -@@ -735,7 +735,7 @@ - - info-am: - --install-data-am: install-data-local install-dbusserviceDATA -+install-data-am: install-dbusserviceDATA - - install-dvi: install-dvi-recursive - -@@ -788,7 +788,7 @@ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ -- install-data-local install-dbusserviceDATA install-dvi \ -+ install-dbusserviceDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ -@@ -817,12 +817,6 @@ - # install configuration files +diff --git a/config/Makefile.am b/config/Makefile.am +index c98a2ab..58b7f0a 100644 +--- a/config/Makefile.am ++++ b/config/Makefile.am +@@ -36,10 +36,10 @@ endif # --install-data-local: install-config-files + install-data-local: install-config-files - mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/ - mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/ - $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/ - $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/ -- ++# mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/ ++# mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/ ++# $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/ ++# $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/ + uninstall-local: @for f in $(CONFFILES) $(GENFILES); do \ - echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \ -