actions.py 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. shelltools.export("CFLAGS", "%s -D_GNU_SOURCE -fPIC" % get.CFLAGS())
  12. #in some troff man pages
  13. #for i in ["dhclient.conf.5", "dhclient.leases.5", "dhclient-script.8", "dhclient.8"]:
  14. # pisitools.dosed("client/%s" % i, "CLIENTBINDIR", "/sbin")
  15. # pisitools.dosed("client/%s" % i, "RUNDIR", "/run")
  16. # pisitools.dosed("client/%s" % i, "DBDIR", "/var/lib/dhcpd")
  17. # pisitools.dosed("client/%s" % i, "ETCDIR", "/etc/dhcp")
  18. #for i in ["dhcpd.conf.5", "dhcpd.leases.5", "dhcpd.8"]:
  19. # pisitools.dosed("server/%s" % i, "CLIENTBINDIR", "/sbin")
  20. # pisitools.dosed("server/%s" % i, "RUNDIR", "/run")
  21. # pisitools.dosed("server/%s" % i, "DBDIR", "/var/lib/dhcpd")
  22. # pisitools.dosed("server/%s" % i, "ETCDIR", "/etc/dhcp")
  23. pisitools.dosed("client/scripts/linux", "/etc/dhclient-exit-hooks", "/etc/dhcp/dhclient-exit-hooks")
  24. pisitools.dosed("client/scripts/linux", "/etc/dhclient-enter-hooks", "/etc/dhcp/dhclient-enter-hooks")
  25. autotools.autoreconf("-vfi")
  26. autotools.configure("--with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
  27. --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
  28. --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
  29. --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
  30. --with-srv-pid-file=/run/dhcpd.pid \
  31. --with-srv6-pid-file=/run/dhcpd6.pid \
  32. --with-cli-pid-file=/run/dhclient.pid \
  33. --with-cli6-pid-file=/run/dhclient6.pid \
  34. --with-relay-pid-file=/run/dhcrelay.pid \
  35. --with-ldap \
  36. --with-ldapcrypto")
  37. def build():
  38. autotools.make("-j1")
  39. def install():
  40. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  41. # Remove files we don't want
  42. pisitools.remove("/etc/dhcpd.conf.example")
  43. pisitools.remove("/etc/dhclient.conf.example")
  44. # Install dhcp.schema for LDAP configuration
  45. pisitools.insinto("/etc/openldap/schema", "contrib/ldap/dhcp.schema")
  46. # dhclient configuration per service support is not ready yet, no need to create this directory for now
  47. # Install empty directory for dhclient.d scripts
  48. #pisitools.dodir("/etc/dhcp/dhclient.d")
  49. # Create directory hierarchy in /var
  50. pisitools.dodir("/var/lib/dhcpd")
  51. pisitools.dodir("/var/lib/dhclient")
  52. # Sample configuration files
  53. pisitools.insinto("/usr/share/doc/dhcp", "client/dhclient.conf.5", "dhclient.conf.exsample")
  54. pisitools.insinto("/usr/share/doc/dhcp", "server/dhcpd.conf.5", "dhcpd.conf.example")
  55. pisitools.insinto("/usr/share/doc/dhcp", "doc/examples/dhclient-dhcpv6.conf")
  56. pisitools.insinto("/usr/share/doc/dhcp", "doc/examples/dhcpd-dhcpv6.conf")
  57. pisitools.dodoc("LICENSE", "README", "RELNOTES")