actions.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. #
  7. # TODO: glibc has to be rebuilt with libtirpc, so that we can enable libtirpc support in samba
  8. from pisi.actionsapi import get
  9. from pisi.actionsapi import autotools
  10. from pisi.actionsapi import pisitools
  11. from pisi.actionsapi import shelltools
  12. shelltools.export("JOBS", get.makeJOBS().replace("-j", ""))
  13. def setup():
  14. shelltools.system("sed -r 's/nss_(setpw|endpw|setgr|endgr)ent/my_&/' \
  15. -i nsswitch/nsstest.c")
  16. shelltools.system("python3 -m venv pyvenv && ./pyvenv/bin/pip3 install cryptography pyasn1 iso8601")
  17. shelltools.system('echo "^samba4.rpc.echo.*on.*ncacn_np.*with.*object.*nt4_dc" >> selftest/knownfail')
  18. shelltools.export("PYTHON", "%s/pyvenv/bin/python3" % get.curDIR())
  19. shelltools.export("CFLAGS", "-I/usr/include/tirpc")
  20. shelltools.export("LDFLAGS", "-ltirpc")
  21. shelltools.system("export PATH=$PWD/pyvenv/bin:$PATH")
  22. autotools.configure("--prefix=/usr \
  23. --sysconfdir=/etc \
  24. --localstatedir=/var \
  25. --with-piddir=/run/samba \
  26. --with-pammodulesdir=/lib/security \
  27. --without-ad-dc \
  28. --enable-fhs \
  29. --without-systemd \
  30. --bundled-libraries=!tdb,!talloc,!pytalloc-util \
  31. --enable-selftest")
  32. def build():
  33. # For some reason, autotools.make() does not work.
  34. shelltools.system("make")
  35. def install():
  36. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  37. shelltools.system("install -d %s/lib" % get.installDIR())
  38. shelltools.move("%s/usr/lib/libnss_wins.so*" % get.installDIR(), "%s/lib" % get.installDIR())
  39. shelltools.move("%s/usr/lib/libnss_winbind.so*" % get.installDIR(), "%s/lib" % get.installDIR())
  40. pisitools.dosym("/lib/libnss_winbind.so.2", "/usr/lib/libnss_winbind.so")
  41. pisitools.dosym("/lib/libnss_wins.so.2", "/usr/lib/libnss_wins.so")
  42. shelltools.system("install -v -m644 examples/smb.conf.default %s/etc/samba/smb.conf.default" % get.installDIR())
  43. pisitools.dodir("/etc/openldap/schema")
  44. shelltools.system("install -v -m644 examples/LDAP/README \
  45. %s/etc/openldap/schema/README.LDAP" % get.installDIR())
  46. shelltools.system("install -v -m644 examples/LDAP/samba* \
  47. %s/etc/openldap/schema" % get.installDIR())
  48. shelltools.system("install -v -m755 examples/LDAP/{get*,ol*} \
  49. %s/etc/openldap/schema" % get.installDIR())
  50. shelltools.system("install -d %s/usr/lib/cups/backend" % get.installDIR())
  51. pisitools.dosym("/usr/bin/smbspool", "/usr/lib/cups/backend/smb")
  52. pisitools.remove("/usr/lib/python3.11/site-packages/_tdb_text.py")
  53. pisitools.remove("/usr/lib/python3.11/site-packages/tdb.cpython-311-x86_64-linux-gnu.so")
  54. pisitools.remove("/usr/lib/python3.11/site-packages/tevent.py")
  55. pisitools.remove("/usr/lib/python3.11/site-packages/_tevent.cpython-311-x86_64-linux-gnu.so")