actions.py 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 2.
  5. # See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import libtools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. from pisi.actionsapi import get
  11. #~ WorkDir="%s-%s" % (get.srcNAME(), get.srcVERSION().replace("_", "-").upper())
  12. BINDDIR="/var/named"
  13. CHROOT="%s/chroot" % BINDDIR
  14. shelltools.export("CPPFLAGS", "%s -DDIG_SIGCHASE" % get.CXXFLAGS())
  15. def setup():
  16. shelltools.makedirs("m4")
  17. # Fix PATHs in manpages
  18. # pisitools.dosed("bin/named/named.8", "/etc/named.conf", "/etc/bind/named.conf")
  19. # pisitools.dosed("bin/check/named-checkconf.8", "/etc/named.conf", "/etc/bind/named.conf")
  20. # pisitools.dosed("bin/rndc/rndc.8", "/etc/rndc.conf", "/etc/bind/rndc.conf")
  21. # pisitools.dosed("bin/rndc/rndc.8", "/etc/rndc.key", "/etc/bind/rndc.key")
  22. # Adjust version
  23. # pisitools.dosed("version", "^RELEASEVER=.*$", "RELEASEVER=Pisi Linux-1.0")
  24. libtools.libtoolize("-cf")
  25. autotools.aclocal("-I m4")
  26. autotools.autoreconf("-vfi")
  27. autotools.configure("--localstatedir=/var \
  28. --sysconfdir=/etc/bind \
  29. --with-openssl \
  30. --with-pic \
  31. --enable-linux-caps \
  32. --includedir=/usr/include/bind9 \
  33. --enable-largefile \
  34. --disable-static \
  35. --with-randomdev=/dev/urandom \
  36. --with-libtool \
  37. --enable-threads \
  38. --enable-ipv6 \
  39. --with-maxminddb \
  40. --with-tuning=large \
  41. --enable-fixed-rrset \
  42. --enable-full-report \
  43. --with-python=/usr/bin/python3 \
  44. NAMED_CONF=/etc/bind/named.conf \
  45. DRNDC_CONFFILE=/etc/bind/rndc.conf \
  46. DRNDC_KEYFILE=/etc/bind/rndc.key \
  47. PYTHON=/usr/bin/python3")
  48. pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  49. def build():
  50. autotools.make("-j1")
  51. def install():
  52. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  53. # pisitools.insinto("/etc/bind", "bin/tests/system/common/rndc.key")
  54. # Prepare chroot jail
  55. for d in ("dev", "etc/bind", "etc/pki/dnssec-keys", "lib/bind", "var/tmp", "var/log", "var/run/named", "var/named", "etc/bind/rndc.key"):
  56. pisitools.dodir("%s/%s" % (CHROOT, d))
  57. # At least drop a file in it
  58. shelltools.echo("%s%s/README" % (get.installDIR(), CHROOT), "Chroot jail for named")
  59. # Create directories
  60. pisitools.dodir("/var/run/named")
  61. for d in ("pri", "sec", "slaves", "data", "dynamic"):
  62. pisitools.dodir("%s/%s" % (BINDDIR, d))
  63. # Create symlinks
  64. for src, dest in [("named.ca", "%s/root.cache" % BINDDIR),
  65. ("%s/pri" % BINDDIR, "/etc/bind/pri"),
  66. ("%s/sec" % BINDDIR, "/etc/bind/sec")]:
  67. pisitools.dosym(src, dest)
  68. # Documentation
  69. pisitools.dodoc("CHANGES", "COPYRIGHT", "README*")
  70. # pisitools.dodoc("doc/misc/*", "contrib/scripts/named-bootconf.sh", "contrib/scripts/nanny.pl")
  71. pisitools.dohtml("doc/arm/*")
  72. # pisitools.remove("/usr/share/doc/%s/Makefile*" % get.srcNAME())