diff --git a/server/samba/actions.py b/server/samba/actions.py index fc009168d4..ad562044ff 100644 --- a/server/samba/actions.py +++ b/server/samba/actions.py @@ -3,6 +3,8 @@ # # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/licenses/gpl.txt +# +# TODO: glibc has to be rebuilt with libtirpc, so that we can enable libtirpc support in samba from pisi.actionsapi import get from pisi.actionsapi import autotools @@ -11,53 +13,56 @@ from pisi.actionsapi import shelltools shelltools.export("JOBS", get.makeJOBS().replace("-j", "")) -MODULES = "idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2,\ -pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4,\ -auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4" - - def setup(): - pisitools.flags.add("-D_FILE_OFFSET_BITS=64", "-D_GNU_SOURCE", "-DLDAP_DEPRECATED", "-fPIC") + shelltools.system("sed -r 's/nss_(setpw|endpw|setgr|endgr)ent/my_&/' \ + -i nsswitch/nsstest.c") - autotools.configure("\ - --libdir=/usr/lib \ - --with-cachedir=/var/lib/samba \ - --with-configdir=/etc/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-modulesdir=/usr/lib/samba \ - --with-pammodulesdir=/lib/security \ - --with-piddir=/run/samba \ - --with-privatedir=/var/lib/samba/private \ - --with-sockets-dir=/run/samba \ - --disable-rpath \ - --disable-rpath-install \ - --enable-fhs \ - --nopyc \ - --nopyo \ - --with-acl-support \ - --with-ads \ - --with-automount \ - --with-cluster-support \ - --with-dnsupdate \ - --with-pam \ - --with-quotas \ - --with-sendfile-support \ - --with-shared-modules=%s \ - --with-syslog \ - --with-utmp \ - --with-winbind \ - --without-systemd \ - --bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt \ - " % MODULES) - # !ldb,!pyldb-util + shelltools.system("python3 -m venv pyvenv && ./pyvenv/bin/pip3 install cryptography pyasn1 iso8601") + shelltools.system('echo "^samba4.rpc.echo.*on.*ncacn_np.*with.*object.*nt4_dc" >> selftest/knownfail') + + shelltools.export("PYTHON", "%s/pyvenv/bin/python3" % get.curDIR()) + shelltools.export("CFLAGS", "-I/usr/include/tirpc") + shelltools.export("LDFLAGS", "-ltirpc") + shelltools.system("export PATH=$PWD/pyvenv/bin:$PATH") + + autotools.configure("--prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-piddir=/run/samba \ + --with-pammodulesdir=/lib/security \ + --without-ad-dc \ + --enable-fhs \ + --without-systemd \ + --bundled-libraries=!tdb,!talloc,!pytalloc-util \ + --enable-selftest") def build(): + # For some reason, autotools.make() does not work. shelltools.system("make") def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) - pisitools.dosym("samba-4.0/libsmbclient.h", "/usr/include/libsmbclient.h") - - # remove unneeded files - pisitools.removeDir("/usr/share/ctdb") + + shelltools.system("install -d %s/lib" % get.installDIR()) + shelltools.move("%s/usr/lib/libnss_wins.so*" % get.installDIR(), "%s/lib" % get.installDIR()) + shelltools.move("%s/usr/lib/libnss_winbind.so*" % get.installDIR(), "%s/lib" % get.installDIR()) + pisitools.dosym("/lib/libnss_winbind.so.2", "/usr/lib/libnss_winbind.so") + pisitools.dosym("/lib/libnss_wins.so.2", "/usr/lib/libnss_wins.so") + + shelltools.system("install -v -m644 examples/smb.conf.default %s/etc/samba/smb.conf.default" % get.installDIR()) + + pisitools.dodir("/etc/openldap/schema") + shelltools.system("install -v -m644 examples/LDAP/README \ + %s/etc/openldap/schema/README.LDAP" % get.installDIR()) + shelltools.system("install -v -m644 examples/LDAP/samba* \ + %s/etc/openldap/schema" % get.installDIR()) + shelltools.system("install -v -m755 examples/LDAP/{get*,ol*} \ + %s/etc/openldap/schema" % get.installDIR()) + + shelltools.system("install -d %s/usr/lib/cups/backend" % get.installDIR()) + pisitools.dosym("/usr/bin/smbspool", "/usr/lib/cups/backend/smb") + + pisitools.remove("/usr/lib/python3.8/site-packages/_tdb_text.py") + pisitools.remove("/usr/lib/python3.8/site-packages/tdb.cpython-38-x86_64-linux-gnu.so") + pisitools.remove("/usr/lib/python3.8/site-packages/tevent.py") + pisitools.remove("/usr/lib/python3.8/site-packages/_tevent.cpython-38-x86_64-linux-gnu.so") diff --git a/server/samba/files/0001-Fix-build-on-libtirpc-less-glibc.patch b/server/samba/files/0001-Fix-build-on-libtirpc-less-glibc.patch new file mode 100644 index 0000000000..297a546ec8 --- /dev/null +++ b/server/samba/files/0001-Fix-build-on-libtirpc-less-glibc.patch @@ -0,0 +1,23 @@ +From: Berk Cakar +Date: Tue, 22 Jun 2021 20:19:32 +0300 +Subject: [PATCH] Fix build on libtirpc-less glibc + +--- + lib/replace/wscript | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index 5d6324ef619..80afda75c96 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -109,6 +109,7 @@ def configure(conf): + + conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h') + conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h') ++ conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') + + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h') + conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h') +-- +2.24.3 (Apple Git-128) + diff --git a/server/samba/files/samba.pam b/server/samba/files/samba.pam index 1266be0979..6d960575f4 100644 --- a/server/samba/files/samba.pam +++ b/server/samba/files/samba.pam @@ -1,5 +1,9 @@ -#%PAM-1.0 -auth required pam_unix.so -account required pam_unix.so -session required pam_unix.so -password required pam_unix.so nodelay smbconf=/etc/samba/smb.conf +# Begin /etc/pam.d/samba + +auth required pam_nologin.so +auth include system-auth +account include system-account +session include system-session +password include system-password + +# End /etc/pam.d/samba diff --git a/server/samba/files/tmpfiles.conf b/server/samba/files/tmpfiles.conf index d98ba64110..32e7228456 100644 --- a/server/samba/files/tmpfiles.conf +++ b/server/samba/files/tmpfiles.conf @@ -1,2 +1,2 @@ -D /run/samba 0755 root root -d /var/log/samba 0755 root root +D /run/samba 0755 - - - +d /var/log/samba 0755 - - - \ No newline at end of file diff --git a/server/samba/pspec.xml b/server/samba/pspec.xml index c621f81a09..5bfda1d132 100644 --- a/server/samba/pspec.xml +++ b/server/samba/pspec.xml @@ -1,5 +1,5 @@ - + samba @@ -14,55 +14,31 @@ samba is a free software implementation of Microsoft's networking protocol released under the GNU General Public License. As of version 4, Samba not only provides file and print services for various Microsoft Windows clients but can also integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a Domain Member. It can also be part of an Active Directory domain. https://download.samba.org/pub/samba/samba-4.14.5.tar.gz - keyutils acl-devel pam-devel - attr-devel - popt-devel - zlib-devel - libcap-devel - python3-devel - ncurses-devel - readline-devel - e2fsprogs-devel - libgcrypt-devel - libbsd-devel - avahi-libs - perl-parse-yapp - - cups-devel - avahi-devel - dmapi-devel - - gnutls-devel - libaio-devel - - mit-kerberos - iniparser-devel - libtalloc-devel - libtevent-devel - openldap-client - libarchive-devel - nss-devel - docbook-xsl - libxslt-devel - lmdb-devel - fuse-devel - dbus-devel - gpgme-devel + perl-parse-yapp jansson-devel - libtirpc-devel rpcsvc-proto-devel - libtdb-devel - cyrus-sasl-devel - + docbook-xsl + avahi-devel + gnutls-devel + libgpg-error-devel + popt-devel + libtalloc-devel + python3-devel + icu4c-devel + cups-devel + mit-kerberos + libcap-devel + openldap-client + libtdb-devel + libarchive-devel + dbus-devel + libtirpc-devel libnsl-devel - audit-devel - python3-markdown - python3-dnspython - + 0001-Fix-build-on-libtirpc-less-glibc.patch @@ -71,70 +47,45 @@ acl pam + cups dbus - lmdb - attr popt zlib - gpgme - libnsl - libcap - jansson - libtirpc - ncurses - python3 - readline - e2fsprogs - libtasn1 - libgcrypt - libarchive - cups - avahi - gdb - + icu4c gnutls libbsd - libaio - - keyutils - iniparser - perl-parse-yapp - libtalloc - libtevent + libcap + libnsl + libtdb + jansson + python3 + libtasn1 + libtirpc + libtalloc avahi-libs openldap-client - cyrus-sasl - libtdb - /run /etc - /var/lib - /var/log - /usr/lib - /sbin - /usr/share/man + /lib + /run + /var /usr/bin + /usr/lib/cups + /usr/lib/lib*.so* + /usr/lib/python3.8 + /usr/lib/samba + /usr/lib/tmpfiles.d + /usr/libexec /usr/sbin - /lib/security /usr/share/samba - /usr/share/perl5 - /usr/libexec/samba/ - /usr/libexec/ctdb/ - /var/cache/samba - /var/run/ctdb - /usr/share/locale - /usr/lib/tmpfiles.d/samba.conf lmhosts samba.pam smbusers smb.conf - samba.confd tmpfiles.conf - system-auth-winbind System.Package @@ -146,10 +97,9 @@ samba-devel Development files for samba - + samba libtalloc-devel libtevent-devel - samba /usr/include @@ -158,6 +108,13 @@ + + 2021-06-22 + 4.14.5 + Rebuild. + Berk Çakar + berk2238@hotmail.com + 2021-06-20 4.14.5