actions.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/bin/env python3
  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. from inary.actionsapi import get
  7. from inary.actionsapi import autotools
  8. from inary.actionsapi import inarytools
  9. from inary.actionsapi import shelltools
  10. KeepSpecial = ["libtool"]
  11. def setup():
  12. inarytools.dosed(
  13. "include/ldap_defaults.h",
  14. "(#define LDAPI_SOCK).*",
  15. '\\1 "/run/openldap/slapd.sock"'
  16. )
  17. inarytools.dosed("servers/slapd/Makefile.in", "(\$\(DESTDIR\))\$\(localstatedir\)(\/run)", r"\1\2")
  18. inarytools.flags.add("-D_REENTRANT -D_GNU_SOURCE -fPIC -Wl,--as-needed -DLDAP_CONNECTIONLESS")
  19. #inarytools.ldflags.add("-pie")
  20. options = "--prefix=/usr \
  21. --disable-bdb \
  22. --disable-hdb \
  23. --enable-sql \
  24. --enable-backends=mod \
  25. --enable-slapd \
  26. --enable-passwd=mod \
  27. --enable-dnssrv=mod \
  28. --enable-ldap \
  29. --enable-wrappers \
  30. --enable-meta=mod \
  31. --enable-monitor=mod \
  32. --enable-null=mod \
  33. --enable-shell=mod \
  34. --enable-rewrite \
  35. --enable-rlookups \
  36. --enable-aci \
  37. --enable-modules \
  38. --enable-cleartext \
  39. --enable-lmpasswd \
  40. --enable-spasswd \
  41. --enable-slapi \
  42. --enable-dyngroup \
  43. --enable-proxycache \
  44. --enable-perl \
  45. --enable-syslog \
  46. --enable-dynamic \
  47. --enable-local \
  48. --enable-proctitle \
  49. --enable-overlays=mod \
  50. --enable-ndb=no \
  51. --with-pic \
  52. --with-threads \
  53. --with-cyrus-sasl \
  54. --without-fetch \
  55. --without-threads \
  56. --enable-crypt \
  57. --enable-ipv6 \
  58. --enable-dynacl \
  59. --enable-shared \
  60. --disable-static \
  61. --disable-slp \
  62. --localstatedir=/var/lib"
  63. if get.buildTYPE() == "emul32":
  64. options = " --prefix=/emul32 \
  65. --libdir=/usr/lib32 \
  66. --libexecdir=/emul32/libexec \
  67. --disable-bdb \
  68. --disable-hdb \
  69. --disable-wrappers \
  70. --disable-spasswd \
  71. --disable-perl \
  72. --without-tls \
  73. --without-cyrus-sasl"
  74. else: options += " --with-tls=auto"
  75. shelltools.export("AUTOMAKE", "/bin/true")
  76. autotools.autoreconf("-fi")
  77. autotools.configure(options)
  78. inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  79. def build():
  80. autotools.make("-j1")
  81. def install():
  82. if get.buildTYPE() == "emul32":
  83. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  84. return
  85. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  86. inarytools.dodir("/run/openldap")
  87. inarytools.dodir("/etc/openldap/ssl")
  88. inarytools.dodoc("ANNOUNCEMENT", "CHANGES", "COPYRIGHT", "README", "LICENSE")
  89. inarytools.remove("/usr/lib/*.la")
  90. inarytools.remove("/usr/libexec/openldap/*.la")