actions.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. def setup():
  11. pisitools.cflags.add("-fPIC", "-D_GNU_SOURCE")
  12. #shelltools.copytree("%s/dhcp" % get.workDIR(), "pppd/plugins")
  13. pisitools.dosed("pppd/plugins/dhcp/Makefile.linux", "^(CFLAGS=.+)\s-O2", "\\1 %s" % get.CFLAGS())
  14. # Enable atm
  15. # pisitools.dosed("pppd/Makefile.linux", "^#(HAVE_LIBATM=yes)", "\\1")
  16. # Enable pam
  17. # pisitools.dosed("pppd/Makefile.linux", "^#(USE_PAM=y)", "\\1")
  18. # Enable CBCP
  19. # pisitools.dosed("pppd/Makefile.linux", "^#(CBCP=y)", "\\1")
  20. # Enable IPv6
  21. # pisitools.dosed("pppd/Makefile.linux", "^#(HAVE_INET6)", "\\1")
  22. # Enable dhcp
  23. # pisitools.dosed("pppd/plugins/Makefile.linux", "^(SUBDIRS\s:=.+)", "\\1 dhcp")
  24. autotools.configure("--enable-cbcp --enable-multilink")
  25. def build():
  26. autotools.make()
  27. def install():
  28. # The build mechanism is crap. Don't remove \/usr from DESTDIR or else the paths will fail
  29. autotools.rawInstall("DESTDIR=%s INSTROOT=%s install" % ((get.installDIR(),)*2))
  30. # No suid libraries
  31. shelltools.chmod("%s/usr/lib/pppd/%s/*.so" % (get.installDIR(),get.srcVERSION()), 0755)
  32. # Install Radius config files
  33. pisitools.insinto("/etc/radiusclient", "pppd/plugins/radius/etc/*")
  34. # Create peers directory
  35. pisitools.dodir("/run/ppp")
  36. pisitools.dodir("/etc/ppp/peers")
  37. pisitools.dodoc("Changes*", "README*", "FAQ")