actions.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. def setup():
  11. autotools.configure("--with-python \
  12. --with-perl \
  13. --include=/usr/include/postgresql \
  14. --with-includes=/usr/include/libxml2/ \
  15. --with-tcl \
  16. --with-krb5 \
  17. --with-openssl \
  18. --enable-nls \
  19. --with-pam \
  20. --with-libxml \
  21. --with-libxslt \
  22. --with-ldap \
  23. --enable-integer-datetimes \
  24. --enable-thread-safety \
  25. --enable-depend \
  26. --host=%s \
  27. --libdir=/usr/lib \
  28. --disable-rpath \
  29. --with-docdir=/usr/share/doc/postgresql" % get.CHOST())
  30. def build():
  31. if get.LDFLAGS():
  32. ld = "-j1 LD=%s %s" % (get.LD(), get.LDFLAGS())
  33. else:
  34. ld = "-j1 LD=%s" % get.LD()
  35. autotools.make(ld)
  36. shelltools.cd("contrib")
  37. autotools.make(ld)
  38. shelltools.cd("..")
  39. shelltools.cd("contrib/xml2")
  40. autotools.make(ld)
  41. shelltools.cd("../..")
  42. shelltools.cd("src/interfaces/libpq")
  43. autotools.make(ld)
  44. shelltools.cd("../../..")
  45. shelltools.cd("doc")
  46. autotools.make(ld)
  47. shelltools.cd("..")
  48. def install():
  49. autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
  50. shelltools.cd("contrib")
  51. autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
  52. shelltools.cd("..")
  53. shelltools.cd("contrib/xml2")
  54. autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
  55. shelltools.cd("../..")
  56. shelltools.cd("src/interfaces/libpq")
  57. autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
  58. shelltools.cd("../../..")
  59. shelltools.cd("doc")
  60. autotools.rawInstall("DESTDIR=%s LIBDIR=%s/usr/lib" % (get.installDIR(), get.installDIR()))
  61. shelltools.cd("..")
  62. # No static libs
  63. pisitools.remove("/usr/lib/*.a")
  64. pisitools.dodoc("README", "HISTORY", "COPYRIGHT")
  65. pisitools.dodoc("doc/MISSING_FEATURES", "doc/KNOWN_BUGS", "doc/TODO")
  66. pisitools.dodir("/var/lib/postgresql")
  67. pisitools.dodir("/var/lib/postgresql/data")
  68. pisitools.dodir("/var/lib/postgresql/backups")