actions.py 4.2 KB

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